Specifying M2M system number at run time?
annuello
Posts: 294
Hello,
I'm trying to make a master-to-master system where I send commands to a virtual device on the remote system. Usually this is a straight-forward process. However, I need to specify the remote system number at run time rather than compile time. *The same code will be deployed into several installations which all report to one RMS server, hence the need for unique system numbers, and my desire to avoid code changes & recompiling for every installation.
*
I'm hoping that I can specify the remote system number in an XML file (or persistent variable) and use that value. *Once the remote system number has been set up I don't expect/need it to change. Obviously I will still need to enter the remote system IP into the URL list for each installation.
I've been trying to figure this out for the last few days but with no success.
Yours,
Roger McLean
Swinburne University*
**
I'm trying to make a master-to-master system where I send commands to a virtual device on the remote system. Usually this is a straight-forward process. However, I need to specify the remote system number at run time rather than compile time. *The same code will be deployed into several installations which all report to one RMS server, hence the need for unique system numbers, and my desire to avoid code changes & recompiling for every installation.
*
I'm hoping that I can specify the remote system number in an XML file (or persistent variable) and use that value. *Once the remote system number has been set up I don't expect/need it to change. Obviously I will still need to enter the remote system IP into the URL list for each installation.
I've been trying to figure this out for the last few days but with no success.
Yours,
Roger McLean
Swinburne University*
**
0
Comments
I've tried using a dev variable (array with one element) which I can easily "fill out" at run time. However the device on the remote system does not respond when I send_command vdvRemoteDevice. I've tried using set_length_array() and rebuild_event() after setting up my dev variable, but that didn't seem to help. The IP for system 123 is in the URL list for the local system only, and system 123 shows up in the Online Tree when I choose the Show Network option.
Roger McLean
Swinburne University
I will try to find that reload command if I get a moment, but hopefully someone with more knowledge on the subject will post before then with more specific data.
Jeff
1. Create a virtual device for your actual control.
2. Assign your remote device in a variable ... it could even read a config file at this point.
3. Combine the variable with the virtual.
You would have to make sure to also run the various SET_VIRTUAL_ commands if it has more than the default number of devices/levels/etc.
Thanks to all for your suggestions, and a double thanks to Dave.
Roger McLean
Swinburne University