Announcement

Collapse
No announcement yet.

How to wait?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to wait?

    How can I insert a small pause between these commands? I'm thinking they're running too fast for the devices to update properly, essentially running on top of each other as far as the devices are concerned. The result is that many devices will have the same data.


    Code:
    Sub Main(Parm As Object)
        
        hs.SetDeviceString(899, hs.DeviceString(898), True)
        hs.SetDeviceString(898, hs.DeviceString(897), True)
        hs.SetDeviceString(897, hs.DeviceString(896), True)
        hs.SetDeviceString(896, hs.DeviceString(895), True)
        hs.SetDeviceString(895, hs.DeviceString(843), True)
        hs.SetDeviceString(843, hs.DeviceString(842), True)
        hs.SetDeviceString(842, hs.DeviceString(840), True)
        hs.SetDeviceString(840, hs.DeviceString(833), True)
        hs.SetDeviceString(833, hs.DeviceString(841), True)
        hs.SetDeviceString(841, hs.DeviceString(186) & " " & hs.DeviceString(187) & " " & hs.DeviceLastChangeRef(186), True) 
    
    End Sub
    Originally posted by rprade
    There is no rhyme or reason to the anarchy a defective Z-Wave device can cause

    #2
    Try hs.WaitSecs(). The docs say the resolution is only to the second but you can do something like hs.WaitSecs(0.2)
    Don

    Comment


      #3
      So like


      hs.SetDeviceString(899, hs.DeviceString(898), True)
      hs.WaitSecs(0.5)
      hs.SetDeviceString(898, hs.DeviceString(897), True)

      and so on? No additional commas or parentheses or any such?
      Originally posted by rprade
      There is no rhyme or reason to the anarchy a defective Z-Wave device can cause

      Comment


        #4
        If you want even shorter waits, there's also an HSPhone function: hsp.WaitMS()
        hsp.WaitMS(400) = hs.WaitSecs(0.4)
        I haven't explored the limits, but presumably it's near 1 msec.
        Mike____________________________________________________________ __________________
        HS3 Pro Edition 3.0.0.548, NUC i3

        HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

        Comment


          #5
          Originally posted by S-F View Post
          So like
          hs.SetDeviceString(899, hs.DeviceString(898), True)
          hs.WaitSecs(0.5)
          hs.SetDeviceString(898, hs.DeviceString(897), True)
          Yes.
          Mike____________________________________________________________ __________________
          HS3 Pro Edition 3.0.0.548, NUC i3

          HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

          Comment


            #6
            Beautiful. Thanks guys.
            Originally posted by rprade
            There is no rhyme or reason to the anarchy a defective Z-Wave device can cause

            Comment

            Working...
            X