General info on how to install macros
Configure it
The macro must be configured to use the right serial port on the system. The easiest way to uniquely identify a device in Omnicast is through Logical ID. You must now modify the script to use the proper serial port on your system.
Using the Omnicast Config Tool
- In the Physical View, select the serial port you want to use.
- On the identity Tab, locate the field called "Logical ID" and remember its value.
- Select the macro again and jump in the code tab
' Serial port to listen to (Logical Number)
Const g_nSerialPortID = 1
How it works?
This macros is design to run until a schedule end or the user stop it.
When the macro starts, it creates its own custom event in the system, see
Sub CreateCustomEvents().
- Connected to serial port: Raised as soon as we establish connectivity with the encoder
- Length of received data: Event generated that contains the number of byte received
- Received data: Event that contains the Bytes
Sub Serial_OnData(Handle, Data) is called.
Currently this generates a 2 custom events (Lenght and Received) and attached the byte receive in the description.
The code in Serial_OnData could be easily modified to generate specific events on specific data or simply just call some methode from the Matrix SDK.
I hope it helps!
Jo

0 comments:
Post a Comment