Polling a Device for current state

Moderator: Moderator Group

Polling a Device for current state

Postby crotkosky » Wed Jan 13, 2016 9:45 pm

something like DevState,SiteID,DeviceID,ParamName,RelativeValue. My goal is to find out what the current opacity is of a device, and toggle a button with two colors, RED for opacity ranging from 1-255, and GREEN for an Opacity of Zero. I apologize in advance if this has been discussed, I've looked through the posts on Devices. Thanks everyone for your help!!

Best,
Chris
crotkosky
 
Posts: 10
Joined: Wed Jan 06, 2016 8:50 pm

Re: Polling a Device for current state

Postby crotkosky » Wed Jan 13, 2016 10:42 pm

OK so I have been playing with the NODES, PB Device Parameter Input, As I set the input, what Im finding is when I input the Device ID example: 2.32 when I apply it and click ok when I go back to the box, I find that the Device ID has rounded the digit and decimal down to just the whole digit, so 2.32 becomes just 2. The feedback value now does not track.

Thanks again for the help!

Chris
crotkosky
 
Posts: 10
Joined: Wed Jan 06, 2016 8:50 pm

Re: Polling a Device for current state

Postby JustynR » Thu Jan 14, 2016 4:35 am

To change the colour of your button, I'd do it with a Script Node.

Take the PB Device Parameter Input Node and attach it to a Script Node.


In the first field of the node select the output of the PB Device node.
Set the second field to "="
Set the third field to "0"

Now enter your script into the first large field "TRUE" ... something like:

WDCustomScriptTint,ID,0,255,0

In the second "ELSE" field, enter your second script:

WDCustomScriptTint,ID,,255,0,0


If the value isn't 0, it'll be red, if it is 0 it'll be Green


Let me know if this works for you.
Justyn Roy
Toronto Ontario Canada
JustynR
 
Posts: 560
Joined: Wed Mar 25, 2009 1:33 am
Location: Toronto, Canada

Re: Polling a Device for current state

Postby Markus Zeppenfeld » Thu Jan 14, 2016 9:52 am

Hi crotkosky,

you need to type in the Site ID (which is the major ID of your server / player) and the Device ID (which is the layer ID) separately.
Is the layer number can only be a whole number, it is "rounded". Please type in
Site ID: 2
Device ID: 32

In addition to Justyns explanation which is very good and suits your workflow, there is a command to recall this values as well.
VGetDeviceParam,VarName,SiteID,DeviceID,ParamName

Combined with an if-clause if it is larger as a specifies number, you could run your desired script without the need of any node.
http://www.coolux.de/root/downloads/sup ... f_else.htm

Cheers
Markus
Markus Zeppenfeld
Senior Product Manager, Pandoras Box

"Have you tried turning it off and on again?" (from "The IT Crowd" / channel 4)
Markus Zeppenfeld
 
Posts: 824
Joined: Wed Mar 02, 2011 10:12 am
Location: Cologne - Germany

Re: Polling a Device for current state

Postby crotkosky » Tue Jan 19, 2016 8:35 pm

JustynR and Markus -
Thanks for the help. All great info. I went with using the NODES, I've posted another question about disabling a button, instead of hiding it.

Have a great day.

Thanks again.

Chris
crotkosky
 
Posts: 10
Joined: Wed Jan 06, 2016 8:50 pm


Return to Widget Designer V4.7

Who is online

Users browsing this forum: No registered users and 21 guests

cron