Adding Functions to Modules Using PASSTHRU Mode
Technical Support Guide
Table of Contents
Brand:
- AMX
Models:
- NI-Series Controllers
- NX-Series Controllers
Overview:
Many AMX developed modules supply a mechanism to allow additional device features to be added to software using the module. This is the PASSTHRU command, which allows protocol strings to be passed through the module.
Commands to the device:
The device-specific protocol must be known in order to use this feature. As an example, suppose that a module for a projector has not implemented the 'white balance adjustment' feature. The command that the projector protocol requires is 03H, 10H, 05H, 14H, followed by a checksum. The documentation for the PASSTHRU command specifies that the module will automatically generate the checksum. In this case, the following string should be sent from the UI code to implement 'white balance adjustment'.
SEND_COMMAND vdvDevice,"'PASSTHRU-',$03,$10,$05,$14"
The reason to use PASSTHRU, instead of sending a protocol string directly to the device port, is that the device may require command queuing, calculation of checksums, or other internal processing, which would not be done if the string was sent directly. Because of this, it is best to filter all communication TO the device through the module. (The module documentation will indicate any processing that will be automatically done to the PASSTHRU string, like checksum calculation.)
Additional Feedback from the Device
The module documentation indicates what feedback is provided. If additional feedback is required, a CREATE_BUFFER for the device must be implemented in the user code to process the strings manually. Note that the module will still be processing the response strings independently and sending the interpreted feedback up to the user code.
Please see the individual documentation per module to determine what PASSTHRU and feedback options are available
DUET modules may also implement the PASSBACK function in addition to PASSTHRU. If the documentation says PASSBACK is implemented, you do not need a CREATE_BUFFER statement for the real device. Send the command “'PASSBACK-1'" to the DUET virtual device. You can then create a STRING DATA_EVENT for the DUET virtual device and all responses from the real device will get channeled back to you via the STRING DATA_EVENT.
Example Code:
DEFINE_DEVICE dvMyIpDevice = 0:2:0 // Ip Device
vdvDevice = 41001:1:0 // DUET Virtual
DEFINE_EVENT
DATA_EVENT[vdvDevice]
{
ONLINE:
{
//SET IP ADDRESS MODULE WILL TALK TO, TURN ON PASSBACK etc.
SEND_COMMAND vdvDevice,"'PROPERTY-IP_Address,192.168.14.4'"
SEND_COMMAND vdvDevice,"'PASSBACK-1'"
SEND_COMMAND vdvDevice,"'REINIT'"
}
COMMAND:
{
//MODULE FEEDBACK
}
STRING:
{
//RAW FEEDBACK FROM THE REAL DEVICE
}
}