No ONLINE Event From Virtual Device with a Port Number of 2 or Higher
Frequently Asked Questions
Written by Wesley Moore
Updated at April 3rd, 2026
Brand:
- AMX
Models:
- Programming
- Netlinx
Question:
Why is there no ONLINE event from port 2 or higher of my virtual device?
Answer:
If you have written code for a virtual device with a port number of 2 or higher, you may find the ONLINE handler of a DATA_EVENT never runs.
Virtual devices only have one port by default and will not run the ONLINE handler until the virtual port count is set. This may seem a little counterintuitive, as some things such as the STRING handler do work even though the ONLINE handler does not.
To be safe, if you are using virtual devices with a port number higher than one, always set the virtual port count for the virtual device in an online event for port one of the virtual device using SET_VIRTUAL_PORT_COUNT (DATA.DEVICE,2).