ADICON Support Forum Applied Digital, Inc.
Page 1 of 1 1
Topic Options
#22693 - 09/29/11 03:39 PM Question about a Ocelot Program
Nettec Offline
newbie


Registered: 09/29/11
Posts: 1
I am trying to setup a program so that to runs on the boot up of the Ocelot from the mains power. Is there a way to do that?
Id like to set a timer to start when the unit powers up and then 60 seconds later start excuting commands.

We are setting up a system to automatically turn on a series of TVs and issue IR commands.

Thanks for your help

Top
#22694 - 09/29/11 04:40 PM Re: Question about a Ocelot Program [Re: Nettec]
Guy Lavoie Administrator Offline
Beyond All Hope
*****

Registered: 12/21/02
Posts: 6406
Loc: Montreal, QC, Canada
Yes you can do that. Just use a variable as a flag. Since non-volatile variables are set to 0 when powering up, use a code section at the beginning to skip over your entire code until the flag is set to 2, like this:

IF Variable #1 = 0 //if set to 0
THEN Timer #1 = 1 //start timer
THEN Variable #1 = 1

IF Timer #1 becomes > 60 //60 seconds later
THEN Timer #1 = 0 //stop timer
THEN Variable #1 = 2 //normal running state

IF Variable #1 is NOT = 2
THEN Skip to (highest line number you have)



get the idea? The thing about setting variable #1 to 1 initially is to avoid having the first two lines restarting the timer over and over.
_________________________
"If you don't know what you're doing, do it neatly..."

Top
Page 1 of 1 1


Moderator:  Dan Smith, Monte G, ADI Tech Support, Guy Lavoie 
Hop to:
Who's Online
1 registered (John Vomastic) and 13 anonymous users online.
Recent Posts
SECU16IR Output Connecting To A Xantech Connecting Block
by Guy Lavoie
02/10/12 06:14 AM
SECU16IR Output Connecting To A Xantech Connecting Block
by Jean-Marie
02/09/12 08:34 AM
how to post an icon
by manu
02/03/12 03:40 AM
Command Pair
by kuro
02/01/12 12:49 AM
Does anyone have a copy of the latest TSE?
by sevenzenith1
01/30/12 05:17 AM
Shout Box

Newest Members
Paul M. Willis, feshh, manu, chuck214, Funkhauser
2747 Registered Users
Forum Stats
2745 Members
19 Forums
3837 Topics
22722 Posts

Max Online: 67 @ 08/16/11 03:08 PM
February
Su M Tu W Th F Sa
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29