Sepasoft MES 2.0 Help Documentation
Sepasoft MES 3.0 Help Documentation
Knowledge Base Articles
Online Training (new)
Online Training (legacy)
Most MES Objects have specific events that are fired during the life cycle of the object, such as object creation New which fires every time a new instance of the object is created. Events provide the ability to add custom scripting for your application based on certain events. As an example, the Material Lot object has an event every time a new lot number is generated. You could use this to modify how lot numbers are generated.
Events can be viewed and edited from the Production Model section of the Ignition Designer. Whenever an event is fired, an MESScriptEvent object is passed to the event. You can use this object to get information about the event and the object.
For more information on what events are available for which objects, please refer to the 'Object Event' section on each object help page.
There are two types of MES Object events, system events and custom events. System events are provided by default and cannot be deleted. Custom events can be created by right-clicking in the MES Events table and selecting New. Script can be added for both system and custom events in the Production Model section of the Ignition Designer to alter what happens when these events are triggered.
Custom events can be created by right-clicking in the MES Events table in the Production Model section of the Ignition Designer and selecting 'New'. These events will only fire whenever they are called using the system.mes.executeMESEvent scripting function.
Scripts can be added to change the standard behavior of system events and add functionality when custom events are triggered. This is also done in the Production Model section of the Ignition Designer by right-clicking on the event and selecting 'Edit'.
System events have default behavior that occurs whenever the event fires. When you add custom script to an event, by default the custom script will execute instead of the default behavior. If you also want the default behavior to occur, add
to the custom script.
Whenever an event occurs, an MESScriptEvent object is passed to the script window. The following object functions are provided to allow you to access the MES Object itself as well as execute any default behavior.
This object is used with the MESScriptEvent object to pass parameters to the MES object event and holds name value pairs where the name is a string and value is any value type of object. This object is typically used when executing user MES object events to allow passing values to the event script. The system.mes.object.parameters.create() script function can also be used to create a new instance of this object. The following object functions are available: