Skip to content

SCADA Events And Scripts ​

1. Event Types ​

EventUsage
ClickOpen dialog, switch page, deliver command, or run script.
Value changeTrigger style changes or linkage when a variable changes.
TimerPeriodically refresh data or run a script.
Page loadInitialize variables, load data, or set default state.

2. Common Interaction Flow ​

3. Script Usage ​

Scripts are suitable for value formatting, simple conditional display, and lightweight linkage. Keep scripts short and deterministic. Complex business logic should be implemented in backend rules or services.

ScenarioRecommendation
Format valueConvert raw number into display text or color.
Show or hideControl component visibility by variable value.
Simple linkageChange style or open a panel when a condition is met.
Command preparationAssemble command parameters before delivery.

4. Safety Notes ​

  • Add confirmation for commands that affect real devices.
  • Do not expose sensitive tokens or private API addresses in page scripts.
  • Test scripts with missing, null, and abnormal values.
  • Keep permission validation on the backend as well as the frontend.

5. FAQ ​

Click has no effect ​

Check whether the component is covered by an upper-layer element, whether the event is enabled, and whether the target component or variable exists.

Command delivered but state unchanged ​

Check whether the device reports back the result; the platform state usually refreshes based on device reporting.

Script error ​

Check whether variables are empty, whether field names have changed, whether component IDs have changed, and whether the script relies on syntax not supported by the browser.

Visibility behaves incorrectly ​

Check whether component groups are duplicated, whether the event order conflicts, and whether the default state is correct.

FastBee | fastbee.cn