SPELCom_Event

Generates a user event from a Spel class instance.

SPELCom_Event

Syntax
SPELCom_Event eventNumber [, msgArg1, msgArg2, msgArg3,... ]

Parameters

  • Event Number
    An expression or integer from 1000 to 32767.
  • msgArg1, msgArg2, msgArg3...
    Optional. Each message argument can be either a number, string literal, or a variable name.
    Description
    This instruction makes it easy to send real time information to an application from a Spel task running in the Controller. For example, you can update parts count, lot number, etc. by sending an event.

SPELCom_Event Example
In this example, a SPEL+ task sends cycle data to an application using the RC+ API .

Function RunParts  
    Integer cycNum  
    String lot$  
    Double cycTime  
      
    cycNum = 0  
    Do   
        TmrReset(0)  
        …  
        …  
        cycTime = Tmr(0)  
        cycNum = cycNum + 1  
        Spelcom_Event 3000, cycNum, lot$, cycTime  
        Wait 0.01  
    Loop  
Fend