JScript Data Logging Example - Iconics-genesis32-scripts Typing CST Test
Loading…
JScript Data Logging Example — Iconics-genesis32-scripts Code
A JScript snippet that logs a process value to an external file in Genesis32.
var fso = new ActiveXObject("Scripting.FileSystemObject");
var logFile = fso.OpenTextFile("C:\\Logs\\process_log.txt", 8, true);
var pressure = ThisDisplay.GetVariable("Tank_Pressure");
logFile.WriteLine("Pressure: " + pressure + " at " + new Date());
logFile.Close();Iconics-genesis32-scripts Language Guide
ICONICS GENESIS32 scripting provides a flexible environment to automate, extend, and customize GENESIS32 HMI/SCADA applications. It enables control logic, event handling, alarm management, and dynamic visualization through built-in scripting languages and VBScript/ActiveX support.
Primary Use Cases
- ▸Dynamic tag calculation and monitoring
- ▸Custom alarm management and notifications
- ▸Automated historical data logging and reporting
- ▸HMI screen interactivity and conditional object control
- ▸Integration with PLCs, OPC servers, and SQL databases
Notable Features
- ▸Real-time scripting within HMI/SCADA runtime
- ▸Access and manipulate GENESIS32 tags dynamically
- ▸Event-driven triggers for alarms and I/O changes
- ▸Customizable HMI object behavior via scripts
- ▸Database connectivity for historical and reporting purposes
Origin & Creator
Developed by ICONICS in the late 1980s, GENESIS32 and its scripting framework were designed to provide engineers a programmable way to extend HMI and SCADA functionality beyond pre-built graphics and controls.
Industrial Note
GENESIS32 scripting is crucial for advanced alarm handling, custom visualization, automated reporting, and multi-system integration where built-in configuration objects are insufficient.
Quick Explain
- ▸GENESIS32 scripting allows dynamic control beyond standard graphical configuration.
- ▸Supports structured programming with variables, loops, conditionals, and functions.
- ▸Enables real-time manipulation of tags, alarms, historical data logging, and visualization objects.
- ▸Facilitates integration with PLCs, databases, OPC servers, and external systems.
- ▸Widely applied in industrial automation for process control, monitoring, and HMI customization.
Core Features
- ▸VBScript and ActiveX object manipulation
- ▸IF/ELSE, FOR, WHILE for logical control
- ▸Access to tags, alarms, and system objects
- ▸Alarm and event scripting
- ▸Integration with external systems via OPC, COM, or SQL
Learning Path
- ▸Learn GENESIS32 basics and tag configuration
- ▸Understand scripting concepts (VBScript/ActiveX)
- ▸Practice event-driven scripting and alarm handling
- ▸Integrate HMI screens and objects with scripts
- ▸Advance to multi-system and database integration projects
Practical Examples
- ▸Dynamically changing object color based on tag value
- ▸Custom alarm escalation and notification workflow
- ▸Historical data logging triggered by events
- ▸Automated calculations for process optimization
- ▸Integration with SQL database for reporting dashboards
Comparisons
- ▸GENESIS32 scripting vs PLC logic: SCADA-centric vs controller-centric
- ▸GENESIS32 scripting vs VBScript standalone: SCADA integration
- ▸GENESIS32 scripting vs Citect Cicode: different runtime environments
- ▸GENESIS32 scripting vs Python: VBScript easier within SCADA
- ▸GENESIS32 scripting vs standard HMI config: dynamic vs static
Strengths
- ▸Extends GENESIS32 functionality without modifying core runtime
- ▸Modular and reusable scripts
- ▸Supports dynamic and event-driven control
- ▸Strong integration with HMI, PLCs, and external systems
- ▸Well-documented API and industry adoption
Limitations
- ▸Proprietary to ICONICS GENESIS32 environment
- ▸Learning curve for beginners not familiar with VBScript or SCADA concepts
- ▸Debugging can be challenging without proper simulation
- ▸Complex scripts may affect runtime performance
- ▸Integration with unsupported systems may require middleware
When NOT to Use
- ▸Non-GENESIS32 environments
- ▸Static HMI projects with no dynamic behavior
- ▸Extremely resource-limited runtime
- ▸Projects requiring direct cloud/AI integrations
- ▸Tasks better handled by PLCs or dedicated control logic
Cheat Sheet
- ▸SET_TAG(tag, value) - write a tag value
- ▸GET_TAG(tag) - read a tag value
- ▸IF … ELSE … ENDIF - conditional statements
- ▸FOR … NEXT / WHILE … WEND - loops
- ▸Function … End Function - reusable code block
FAQ
- ▸Can GENESIS32 scripts run outside runtime? -> No, runtime-dependent
- ▸Does GENESIS32 scripting support databases? -> Yes, via SQL functions or COM
- ▸Can scripts manipulate HMI objects? -> Yes, dynamically
- ▸Is scripting difficult to learn? -> Requires SCADA knowledge and VBScript familiarity
- ▸Does GENESIS32 scripting support OPC? -> Yes, full integration
30-Day Skill Plan
- ▸Week 1: Basic tag read/write scripts
- ▸Week 2: Conditional logic and loops
- ▸Week 3: Event handling and alarms
- ▸Week 4: HMI object manipulation
- ▸Week 5: Database integration and reporting
Final Summary
- ▸GENESIS32 scripting provides automation, event handling, and dynamic HMI behavior.
- ▸Supports structured programming with real-time integration of tags, alarms, and objects.
- ▸Enhances operator interfaces and reporting capabilities.
- ▸Widely used in industrial automation, process control, and visualization.
- ▸Integrates seamlessly with PLCs, databases, and external systems for complete SCADA solutions.
Project Structure
- ▸GENESIS32 project file (.X32 or .GENESIS)
- ▸Script modules (.VBS or embedded)
- ▸Tag database and alarm configuration
- ▸HMI screen layouts
- ▸External data connections (OPC, SQL, etc.)
Monetization
- ▸SCADA automation consulting
- ▸Custom GENESIS32 scripting services
- ▸HMI and alarm optimization
- ▸Training and simulation services
- ▸Integration with MES and industrial IoT
Productivity Tips
- ▸Use functions to reduce repetitive code
- ▸Test scripts in simulation first
- ▸Keep tag names consistent
- ▸Optimize loops and event handling
- ▸Document parameters, logic, and workflows
Basic Concepts
- ▸Tag - variable representing process or system data
- ▸Event - trigger that executes a script
- ▸Alarm - monitored condition reported to operator
- ▸Function - reusable block of script logic
- ▸Object - HMI element that can be dynamically controlled