18.01.2015 Views

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Appendix: Built-in Scripting Language<br />

Event Logger functions<br />

These functions are used to send events and comments to the Event Logger.<br />

SendEvent<br />

Sends an event to the Event Logger.<br />

Function Group Execution Windows Embedded Thin Client<br />

SendEvent Event Logger Synchronous Supported Supported Supported<br />

Description<br />

Use to send an event to the Event Log file. When the Comment option is enabled, the user is prompted to enter<br />

a comment after executing the SendEvent() function. This comment will be saved in the Event Log file.<br />

Syntax<br />

SendEvent( strEvent, optBoolFlag, optStrComment )<br />

strEvent<br />

optBoolFlag<br />

The text to be saved in the Event Logger.<br />

If omitted or 0 (zero), the event does not have a comment. Otherwise, there is a comment<br />

associated to the event.<br />

optStrComment<br />

The text of the comment for the event saved in the database. If omitted, a standard dialog<br />

prompts the user to type a comment.<br />

Returned value<br />

0 Success<br />

1 Event Logger is disabled in the Event Settings dialog<br />

2 Event Logger is enabled, but Custom Messages are disabled in the Event Settings dialog<br />

Notes<br />

This function is synchronous. Therefore, the execution of the function finishes only after the event data<br />

(including the comment, if any) is saved in the database file. It is recommended that you do not configure<br />

this function in background tasks (e.g., Math and Scheduler), unless you do not plan to use the comment or<br />

configure it directly (type from the dialog) in the function.<br />

Examples<br />

Tag Name<br />

Tag<br />

Tag<br />

Tag<br />

Tag<br />

Expression<br />

SendEvent( "Valve Open" ) // Saves the event message.<br />

SendEvent( "Valve Open Oven No. " + OvenID ) // Saves the event message concatenated with<br />

the value of the OvenID tag.<br />

SendEvent( "Valve Open" , 1 ) // Displays the dialog where the operator can type comments.<br />

SendEvent( "Valve Open" , 1 , TagComment) // Saves the event message with the comment<br />

configured in the TagComment tag.<br />

Page 732<br />

<strong>InduSoft</strong> Web Studio

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!