Hi,
I'm trying to set a digital output from a VBScript on an 8/8/8 interface kit ... the output can be set from the HS2 Status page (albeit a page refresh is needed for On or Off to work after each activation).
I can change the HS status of the control using this code, but I can't actually get the output on the 8/8/8 to change using this code:
hs.SetDeviceStatusByName("Phidgets Digital Output 1 - Door Visual Alarm", 2)
hs.SetDeviceValueByName("Phidgets Digital Output 1 - Door Visual Alarm", 1)
Status 2=On (status page light bulb on) and status 3=0ff (light bulb off)
I would think that setting the status to 1 would also activate the output (5V on), but it does nothing.... what am I doing wrong? I have also tried using the device ID rather than the name and the result is the same as you would expect. The same VBScript that the code above is from can reliably read the digital inputs from the same board - so the script is communicating with the phidgets board other than this issue.
As an alternative, I though about having my VBScript return a "1" or a "0" and then using the status to activate an event action (i.e. turn on or off the output from HS2's event interface) but I can't see any way to return a value from VBSripts and act upon the return value in an event action chain.
Help!
Thanks
I'm trying to set a digital output from a VBScript on an 8/8/8 interface kit ... the output can be set from the HS2 Status page (albeit a page refresh is needed for On or Off to work after each activation).
I can change the HS status of the control using this code, but I can't actually get the output on the 8/8/8 to change using this code:
hs.SetDeviceStatusByName("Phidgets Digital Output 1 - Door Visual Alarm", 2)
hs.SetDeviceValueByName("Phidgets Digital Output 1 - Door Visual Alarm", 1)
Status 2=On (status page light bulb on) and status 3=0ff (light bulb off)
I would think that setting the status to 1 would also activate the output (5V on), but it does nothing.... what am I doing wrong? I have also tried using the device ID rather than the name and the result is the same as you would expect. The same VBScript that the code above is from can reliably read the digital inputs from the same board - so the script is communicating with the phidgets board other than this issue.
As an alternative, I though about having my VBScript return a "1" or a "0" and then using the status to activate an event action (i.e. turn on or off the output from HS2's event interface) but I can't see any way to return a value from VBSripts and act upon the return value in an event action chain.
Help!
Thanks
Comment