In a script, I'm creating a device successfully.
However I'm having some trouble defining Value/Status pairs for the device, even manually in the Advanced tab for the device.
Preferably, I'd like to make the definitions during the device creation phase, in the script, where values 0 to 299 will have a status "Off", and values 300 and above will have a status "On". The device will be "Status Only"
No matter what however, the Status indicates UNKNOWN, never Off nor On.
Here's what I have done: (Description, Device and DeviceCode are all defined elsewhere)
Device = hs.NewDeviceRef(Description)
Dim dv As Object = hs.GetDeviceByRef(Device)
dv.Address(hs) = DeviceCode
dv.Location(hs) = "System"
dv.Location2(hs) = "Data"
dv.Status_Support(hs) = True
DeviceRefArray(DeviceAryPtr) = Device
DeviceAryPtr = DeviceAryPtr + 1
Any ideas?
However I'm having some trouble defining Value/Status pairs for the device, even manually in the Advanced tab for the device.
Preferably, I'd like to make the definitions during the device creation phase, in the script, where values 0 to 299 will have a status "Off", and values 300 and above will have a status "On". The device will be "Status Only"
No matter what however, the Status indicates UNKNOWN, never Off nor On.
Here's what I have done: (Description, Device and DeviceCode are all defined elsewhere)
Device = hs.NewDeviceRef(Description)
Dim dv As Object = hs.GetDeviceByRef(Device)
dv.Address(hs) = DeviceCode
dv.Location(hs) = "System"
dv.Location2(hs) = "Data"
dv.Status_Support(hs) = True
DeviceRefArray(DeviceAryPtr) = Device
DeviceAryPtr = DeviceAryPtr + 1
Any ideas?
Comment