Check to see if TP is online
jcerecke
Junior Member
At the moment I have a variable that changes itself to 1/0 on the online and offline data events from the TP. Is there a way to eliminate the need for this and do something like "if (dvTP = online)"?
Comments
-
Waiting to be trumped
If you are truly trying to set something to change on ONLINE or OFFLINE Events, then that's where you should place your variable. -
I agree with Jeff, however, you can do this:
if(Device_ID(dvTp) > 0) { }
--D -
If you are truly trying to set something to change on ONLINE or OFFLINE Events, then that's where you should place your variable.
My reasoning is this:
I have a bargraph (or 6) on my TP which controls channels on an audio mixing desk via RS232. When the TP goes offline, it somehow generates a level event of 0 for all bargraphs, which then gets rid of all my audio.
So I want to check if the TP is online when the level event occurs and if it is to change the level else do nothing. -
My reasoning is this:
I have a bargraph (or 6) on my TP which controls channels on an audio mixing desk via RS232. When the TP goes offline, it somehow generates a level event of 0 for all bargraphs, which then gets rid of all my audio.
So I want to check if the TP is online when the level event occurs and if it is to change the level else do nothing.
What about just doing if (level.value) then control my mixing desk. However I would use a virtualTP for level control because it does not go off line. Combine the VirtTP with the RealTP. -
My reasoning is this:
I have a bargraph (or 6) on my TP which controls channels on an audio mixing desk via RS232. When the TP goes offline, it somehow generates a level event of 0 for all bargraphs, which then gets rid of all my audio.
So I want to check if the TP is online when the level event occurs and if it is to change the level else do nothing.
That is just an issue. When a panel goes offline it sends a level.event 0. -
-
Thats cool. Thanks for all the suggestions.
-
That is just an issue. When a panel goes offline it sends a level.event 0.
No actually, kbeattyAMX is correct. If you combine the physical device(s) level with a virtual device level you WON'T get the level event with value = 0 when the/a physical device goes offline. This is because the virtual device never goes offline and therefore the level is always tracked in memory.
It's possible to combine the levels using COMBINE_LEVELS or COMBINE_DEVICES. Using device arrays is generally better practice/more desirable than combining devices - as such COMBINE_LEVELS would be recommended.
I'm not sure of the context in which you're dealing with the incoming level events, but something along these lines would achieve what you're after:DEFINE_DEVICE // Physical devices dvTP_1 = 10001:1:0 dvTP_2 = 10001:2:0 dvTP_3 = 10001:3:0 vdvTP = 33001:1:0 // Virtual which maintains the level regardless // of the online state of the physical devices vdvAUDIO = 33002:1:0 DEFINE_CONSTANT // Index of the level being tracked char LVL_VOLUME = 1 // A level on a virtual device is used to keep a // constant record of the level's current value devlev lvlTRACKED_VOLUME = {vdvAUDIO, LVL_VOLUME} // This is the level array to catch incoming level // events from (ie. from the panels) devlev lvlTP_VOLUME[] = { {vdvTP, LVL_VOLUME}, {dvTP_1, LVL_VOLUME}, {dvTP_2, LVL_VOLUME}, {dvTP_3, LVL_VOLUME} } DEFINE_START // Combine levels to prevent unwanted events // when physical devices go online/offline combine_levels(lvlTRACKED_VOLUME, lvlTP_VOLUME) DEFINE_EVENT level_event[lvlTP_VOLUME] { // Handle the event here... }
The same can be achieved for devices which generate channel events when they go offline using COMBINE_CHANNELS.
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums