Page 1 of 1

Polling a Device for current state

PostPosted: Wed Jan 13, 2016 9:45 pm
by crotkosky
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

Re: Polling a Device for current state

PostPosted: Wed Jan 13, 2016 10:42 pm
by crotkosky
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

Re: Polling a Device for current state

PostPosted: Thu Jan 14, 2016 4:35 am
by JustynR
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.

Re: Polling a Device for current state

PostPosted: Thu Jan 14, 2016 9:52 am
by Markus Zeppenfeld
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

Re: Polling a Device for current state

PostPosted: Tue Jan 19, 2016 8:35 pm
by crotkosky
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