Sends an event to the Event Logger.

Function Group Execution Windows Embedded Thin Client Mobile Access
SendEvent Event Logger Synchronous Supported Supported Supported Supported


Use to send an event to the Event Log file. When the Comment option is enabled, the user is prompted to enter a comment after executing the SendEvent() function. This comment will be saved in the Event Log file.


  SendEvent( strEvent, optBoolFlag, optStrComment, optCustom1, …, optCustom10 )  
The text to be saved in the Event Logger.
If omitted or 0 (zero), the event does not have a comment. Otherwise, there is a comment associated to the event.
The text of the comment for the event saved in the database. If omitted, a standard dialog prompts the user to type a comment.
optCustom1 … optCustom10
Custom fields that will be saved in Event History. Any type of data may be specified.

The number of custom fields can be set in Project Settings: Options.

Returned value

This function returns the following possible values:
Value Description
0 Function executed successfully.
1 Event Logger is disabled in the Event Settings dialog.
2 Event Logger is enabled, but Custom Messages are disabled in the Event Settings dialog.


This function is synchronous. Therefore, the execution of the function finishes only after the event data (including the comment, if any) is saved in the database file. It is recommended that you do not configure this function in background tasks (e.g., Math and Scheduler), unless you do not plan to use the comment or configure it directly (type from the dialog) in the function.


Tag Name Expression
Tag SendEvent( “Valve Open” ) // Saves the event message.
Tag SendEvent( “Valve Open Oven No. ” + OvenID ) // Saves the event message concatenated with the value of the OvenID tag.
Tag SendEvent( “Valve Open” , 1 ) // Displays the dialog where the operator can type comments.
Tag SendEvent( “Valve Open” , 1 , TagComment) // Saves the event message with the comment configured in the TagComment tag.