System Number in define_device?
Jeff
Posts: 374
I think what I want to do isn't possible, but I thought I'd check to see if anyone knows how to do it.
I'd like to define a device on a remote system, with the port on the remote system matching the system number of my local system. For example, I'd like System 4 to define this device as 10001:4:1, and I'd like System 52 to define the device as 10001:52:1.
Every other piece of code on these systems is identical. Right now, I've just made the entire code an include file, and the individual files for each room just have this device definition and the include file called, but I'd love to get just one .axs file that gets loaded to every room.
defining it as 10001:system_number:1 doesn't work. putting the device definition after define_constant and defining the system number as a constant doesn't work.
Is there any way to do this? Or am I just dreaming?
J
I'd like to define a device on a remote system, with the port on the remote system matching the system number of my local system. For example, I'd like System 4 to define this device as 10001:4:1, and I'd like System 52 to define the device as 10001:52:1.
Every other piece of code on these systems is identical. Right now, I've just made the entire code an include file, and the individual files for each room just have this device definition and the include file called, but I'd love to get just one .axs file that gets loaded to every room.
defining it as 10001:system_number:1 doesn't work. putting the device definition after define_constant and defining the system number as a constant doesn't work.
Is there any way to do this? Or am I just dreaming?
J
0
Comments
The main problem I see of going down the port approach is with virtual devices. I believe they can only utilise port 1. You could probably even have all your systems set to #1 provided they don't interact with each other or a RMS server. However, in practice I find it useful to allocate a different number to each system. Admittedly, I use both RMS and Master2Master, so I _have_ to use different system numbers. It also makes it easier for G4 touch panels - I use Auto Mode where I jsut specify the system number that the panel connects to (rather than the IP address).
Where equipment in rooms differ slightly from my 'standard' design, I tend to use compiler directives. You then have to manipulate the #define flags before compiling. I suppose you could just as easily put these into the include files that you are already using.
Roger McLean
Swinburne Uni
Basically, what I have is a master touchpanel sitting on my desk. It has a complete set of buttons for every room in the building. What I have done so far is make every room's page the same, with the projector power on button always being channel 1, and the projector power off button is always channel 2. For controlling system two, all of the buttons are on port 2. For controlling system 53, all of the buttons are on port 53. This makes it easy to not keep renumbering every time I had a new button, and means I can load the same code on everything.
However, this means that for each room, in the code I need to have
In this instance, 4 is the local system number, and 1 is my master system number. For system 53, you would see
So what I'm trying to figure out how to do, is get the code to not need me to manually enter the system number each time. It seems, however, that system_number isn't actually an integer. Does anyone know the appropriate use for that keyword?
J
And, for the record, Annuello: you can define virtual devices with multiple ports.
Basically, the master panel (which is on system 1) has a title page with buttons for each room. I hit the room button and it goes to a page for that room.
The page for system 3 has a projector power on button for it. That button is channel 1, port 3. System 3 has defined on it dvMasterTP as 10001:3:1. there's a projector on button event for [dvMasterTP,1]
The page for system 51 similarly has a projector power on button for it. That button is still channel 1, but is now port 51. System 51 has the same projector on button event for [dvMasterTP,1]. However, I have to differently define dvMasterTP as 10001:51:1. The events are all identical in every room, but changing up this panel definition means I can't load the same file to everything.
I was hoping that I could use system_number in define_device and just define it as 10001:system_number:1. That way every system would automatically define dvMasterTP correctly. Its not really a big deal, I have a workaround already (the entirety of the code is in an include file and then each room has a file that is basically such
Still, I'd like to find a way to do it all with one file.
----
If I define dvMasterTP as 10001:system_number_1, I get the following error
C10204: RHS for [DVMASTERTP] is not a constant
My guess is this means that define_device and define_constant are both things that are taken care of at compile time, not at run time, and there's nothing I can do to make the device definitions change dynamically, but if someone would like to point out how I'm wrong . . . .
J
define_combine did it.
can't do it in a device array, it appears to pretty much HAVE to happen in define_combine. Still, thats amazing.
Thanks so much
J
So far I've only tried it on one room. I watched Notifications though, and I can see both my master panel button presses and the virtual device's button presses, which means its definitely working correctly. Once I've tried it on multiple rooms, I'll let you know how its working.
J