SCADA Events And Scripts
1. Event Types
| Event | Usage |
|---|---|
| Click | Open dialog, switch page, deliver command, or run script. |
| Value change | Trigger style changes or linkage when a variable changes. |
| Timer | Periodically refresh data or run a script. |
| Page load | Initialize 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.
| Scenario | Recommendation |
|---|---|
| Format value | Convert raw number into display text or color. |
| Show or hide | Control component visibility by variable value. |
| Simple linkage | Change style or open a panel when a condition is met. |
| Command preparation | Assemble 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.

