Triggering System Calls Under Button Event In Netlinx
Technical Support Guide
Table of Contents
Brand:
- AMX
Models:
- Netlinx
Overview:
Button Events Will Keep The Same Button Numbers From Running In Mainline, Causing Some System Calls To Not Operate.
In NetLinx, creating a Button Event to a button number of 0 will trap all pushes from that device. This will also stop any pushes from that device from working in Mainline, due to the fact that the event handler skips Mainline while it is running, and the event handler will grab that push from the stack so when Mainline resumes, the push has already occurred and does not run in Mainline. This can cause system calls from running in Mainline if their button numbers, or the button number of 0, has been used in a button event.
Solution:
If a system call needs to be triggered from a Button Event in NetLinx, this is how to achieve this:
- Create a DEVCHAN for the buttons needed.
- Create a Button Event for that DEVCHAN.
- Under the PUSH, add the system call just as you would in Mainline, using the button numbers declared in the DEVCHAN.
- Most system calls have feedback handling that needs to run in Mainline, so repeat the system call in Mainline to handle the feedback.
Example Code:
DEFINE_VARIABLE
DEVCHAN dcVCR_TRANSPORT[ ] = { {TP, 1}, {TP, 2}, {TP, 3}{TP, 4}, {TP, 5}, {TP, 6}, {TP, 7},{TP,8} }
DEFINE_EVENT
BUTTON_EVENT[dcVCR_TRANSPORT]
{
PUSH:
{
SYSTEM_CALL [VCR] 'VCR 1' (VCR,TP,1,2,3,4,5,6,7,8,0)
}
}
DEFINE_PROGRAM
SYSTEM_CALL [VCR] 'VCR 1' (VCR,TP,1,2,3,4,5,6,7,8,0)
Table of Contents