Author Topic: Problem : SetMidPowerMode(100) not a a function  (Read 115 times)

gaston

  • Newbie
  • *
  • Posts: 26
    • View Profile
Problem : SetMidPowerMode(100) not a a function
« on: June 25, 2016, 09:52:36 am »
I writing programs for mcModule 1 to change the Led being ON and then publish a topic ChangeLED
mcModule2 to subcribe to this topic. However  because by default mcModule2 only weakup and check for publication every minute or so. There is a delay and sometime 2 or 3 publications come at the same time. To avoid this dealy, I added SetMidPowerMode to 100 milliseconds.
I am assuming that my McModule 1, executing my EVENT, will publish immediately (no delay); is this assumption right?

McStudio is giving me an error message that this is NOT oa function. My line of code is  "SetMidPowerMode(100)", is this correct ? Is the function implemented yet?

At same time, does anyone can suggest how I can write a program so that my LEDs goes ON for a certain amount of time and then OFF for a different amount of time (example ON for 1 second and OFF for 10 seconds).

Share on Facebook Share on Twitter


mc-John

  • Global Moderator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
Re: Problem : SetMidPowerMode(100) not a a function
« Reply #1 on: June 25, 2016, 04:19:58 pm »
Hope this answers both of your questions

Code: [Select]
Class test
    Shared Event Boot()
        Lplan.SetMidPowerMode(100)
    End Event
    Shared Event OnOff() RaiseEvent Every 11 Seconds
        LedRed = True
        Thread.Sleep(1000000) // sleep 1 second
        LedRed = False
    End Event
End Class
Like Like x 2 View List