Skip to Content

Message processor: using scripts 🔒

2.5 Script handling

To create a new script:

1. Go to the Configuration/Message Processor menu.
2. To the right of prototype, select the arrow and select Add.
3. Give the script an identifier and a name.
4. Select the script type in the Interface section.
5. Enter any data server to be created in ALERT.
6. Click on OK to confirm.
7. Click on Open to save the files associated with the script.
8. This script should be hooked up to a data source if necessary (Serial, TCPIP, API...).


To modify script parameters or external variables associated with the script :

1. Go to the Configuration/Message Processor menu.
2. In the prototype list, select the script to be modified.
3. To the right of the prototype, select the arrow and select Edit.
4. Click on the Variables button to add or modify variables.
5. Click on OK to confirm.
To import an existing script.
1. Copy the .pro and .prg files into the ALERT directory.
2. Go to the Configuration/Message Processor menu.
3. To the right of Prototype, select the arrow and select Import.
4. Select the .pro file previously copied.
5. Click on Open to load the script.
6. Click on INIT to initialize the script.
7. The script will only start when it is attached to a communication port or a functional driver. (Except for Other and Alarm scripts).
8. Click on OK to close the message processor window.


To delete a script:

1. Go to the Configuration/Message Processor menu.
2. In the prototype list, select the script to be deleted.
3. To the right of the prototype, select the arrow and select Delete.
4. Click OK to close the message processor window.


2.6 Script editing


To edit script code :

1. Go to the Configuration/Message Processor menu.
2. In the prototype list, select the script to be modified.
3. In the bottom left-hand corner, click on the Script button to edit the script.


Find help with a function :

  • Select the function in the code and click on to access them directly.

Add a breakpoint in the script :

  • Select a code line.
  • Click on the buttonto insert a breakpoint in code.
  • A red dot appears at the beginning of a line.
  • To remove the breakpoint, select the line and click the button again..
  • Select the floppy disk button to save the script.
  • Select EXIT to quit the script.
  • Click on INIT to reinitialize the script and take the changes into account.
  • When code execution passes the breakpoint, an information pane with variable values opens below the code.
  • The line in progress is indicated by a > sign.

 

​Execute the code step by step using the buttons :
The information window with variable values is updated each time a new line of code is executed.
line of code.
​Step-by-step execution by entering subroutines and functions.
​Step-by-step execution without entering subroutines and functions.
​Resume execution from the current line.
Complete script stop to edit the code.


2.7 Debug tools

ALERT provides the following tools for debugging script code:

  • Step-by-step execution with variable value information window.
  • Add traces in the code that will be displayed in the ALERT event log (Trace function).
  • Create a log file containing all traces added to the code (LogView object).
  • Line monitor: analyzes data transiting the communication port and saves it in a file saved in the saved in the ..\Alert\Comlog directory.

o Green colored data : Incoming data
o Red data: Outg
oing data