Using Online Data Events to Configure Devices in NetLinx
Technical Support Guide
Brand:
- AMX
Models:
- Netlinx
Overview:
In Axcess, devices were often configured in the DEFINE_START section of the program. However, in NetLinx, all device configurations should take place in the online event, for each individual device or dev array. With this, the system should be configured for correct operation at device online events, without any other technician intervention. For IR devices, setup of mode (IR/Serial) and carrier (on/off) should be configured. It is also customary to provide any default feedback for IR controlled devices as well. For example, the SYSTEM_CALL 'FUNCTION'(dvVCR,STOP,0) should be used in the IR Online event.
DATA_EVENT[dvVCR]
{
ONLINE:
{
SEND_COMMAND Data.Device,'SET MODE IR' SEND_COMMAND Data.Device,'CARON' SYSTEM_CALL 'FUNCTION' (Data.Device,2,0) // Stop deck
}
}For 232 devices, setup of baud rate, parity, data bits, stop bits, and 485 status should be configured. With 232 devices, it is recommended to use CREATE_BUFFER in startup. Then parse over the buffer under the STRING event. All buffer parsing should be done with a separate subroutine, usually passing the device number, the buffer, and sometimes an index pointer, as parameters. A single buffer parsing routine could then be used to parse data for many different devices of the same type.
DATA_EVENT[dvVideoSwt]
{
ONLINE:
{
SEND_COMMAND Data.Device,'SET BAUD 9600,N,8,1 485 DISABLE'
}
OFFLINE:
{ }
STRING:
{
WHILE(FIND_STRING(VideoSwtBuff,"13,10",1))
{
CALL 'Parse Video Swt Buff' (dvVideoSwt,1,VideoSwtBuff)
}
}
}