mc-Things

General Category => mc-Things General Discussion => Topic started by: Junkboy on June 25, 2018, 05:36:59 pm

Title: How can I put an mcMod120 in sleep mode for 10 minutes and then run the program?
Post by: Junkboy on June 25, 2018, 05:36:59 pm
Basically what I want is to put the mcMod120 to send data 60 minutes, then put it in sleep mode for 20 minutes, then again 60 minutes sending and 20 minutes in sleep mode, and this is repeated infinitely.

I currently use this line to send data every 5 seconds:
Shared Event Publish() RaiseEvent Every 5 Seconds

What I'm going to do, is put in place of 5 seconds, 60 minutes, and I'm looking for a function to put:

Sleep (20 min)

And let this start again ..
Title: Re: How can I put an mcMod120 in sleep mode for 10 minutes and then run the program?
Post by: mc-T2 on June 27, 2018, 10:41:08 am
Hi Junkboy,

yes, you can insert a 'sleep' function into your code. Check out the attached mcScript guide (Also available on the website) and search through it for the function. I think i remember that it is discussed or displayed on page 23 (and other areas within the document).

The concept would be, to complete what you are asking below, is to raise an event every 60 minutes, insert the sleep function for a certain period of time (I believe the sleep function calculates time in milliseconds so you'll need to do some conversion). Should allow you to do what you are asking below.

Good luck!