Virtual Device ports
cmason
Posts: 123
I'm a bit confused. Everywhere on the forum and Netlinx help it is stated virtual devices have only one port (unless adjusted by SET_VIRTUAL_PORT_COUNT).
I made a quick test code:
I pulsed both of the channels I defined and here is the DIAG ouput:
Why did it work?
I made a quick test code:
PROGRAM_NAME='Test' DEFINE_DEVICE vdvDevice1 = 33001:1:0 vdvDevice2 = 33001:2:0 DEFINE_START DEFINE_EVENT CHANNEL_EVENT[vdvDevice1,1] { ON: { SEND_STRING 0, "'Port 1'" } } CHANNEL_EVENT[vdvDevice2,1] { ON: { SEND_STRING 0, "'Port 2'" } }
I pulsed both of the channels I defined and here is the DIAG ouput:
Line 1 (15:03:31.994):: Port 1 Line 2 (15:03:31.994):: Memory Available = 208963064 <18624> Line 3 (15:03:36.850):: Port 2
Why did it work?
0
Comments
The main reasons to define them using SET_VIRTUAL_PORT_COUNT are if you will be using just higher port numbers without defining the lower ones, or if you will be calculating the ports in code and don't want to list them all in advance.
As far as I can recall, I have never run into a case where I needed to use SET_VIRTUAL_PORT_COUNT.
If this is true now I don't think it used to be.
I had an issue way back when I first started programming with higher number virtual ports without calling set_virtual_port_count. Things like pushes worked but iirc levels and possibly feedback did not function correctly and the additional ports did not actually show up in the device tree. It's possible this has been changed though as that was maybe 8-9 years ago at this point (which is a terrifying thought).
I'm curious if your additional ports are there without using set_virtual_port_count so let us know
Frank Krauch, AMX ACE
And this also works on both masters (which I didn't expect, so it might be a new v4+ firmware feature):
I tried to downgrade to 3.x firmware in the NI700, but apparently that isn't supported. If I remember sometime over the weekend I'll give it a shot against an old NXI I have hanging around.
Thanks for the responses.
I thought that defining them might have made the difference, but all of the documentation I have read, seemed so adamant about the limitations and never mentioned "unless defined".
Perhaps AMX should/will generate definitive updated documentation about the current limitations on Ports, Channels, and levels.
Consider the following code:
Pushing Buttons 1,2,3 and 4 results in the following:
Notice how only port 1 generates String To and String From.
If you look at the online tree only 1 port shows up under 33001.
Add the following code:
Pushing Buttons 1,2,3 and 4 results in the following:
Notice that all 3 ports generate String To and String From.
If you look at the online tree all 3 ports show up under 33001.
There is clearly a difference when you use SET_VIRTUAL_PORT_COUNT and if you don’t use it things may work fine perfectly for your situation but I would recommend following the protocol and add the 1 line of code just to avoid any gotchas down the road.