Author Topic: Program First Loop  (Read 3284 times)

radioact

  • Guest
Program First Loop
« on: November 10, 2010, 06:18:58 PM »
Hello,

So I am still learning GUIDE even tho I have a fairly extensive past with programming controllers some things still elude me in GUIDE. Since I can not find the block where I enter 'c' code, my question is about program initialization.

Is there a way to have some code run during start up or first loop? Like something that loads saved values from memory or sends some initialization commands to a devices on the can bus to make sure all devices are ready to run before the rest of the program is allowed to run. I may be approaching this the wrong way, but can I have a certain block of code run first then when its satisfied it releases some sort of lock on other blocks? If this is not the correct approach, then what is the excepted way?

thanks,
Tyler

Offline hproffitt

  • PLUS+1 Developer
  • ***
  • Posts: 28
  • Karma: +0/-0
Re: Program First Loop
« Reply #1 on: November 11, 2010, 01:12:20 AM »
Tyler-

There is an internal signal (OS_Start) that is 'pulsed' on powerup of the controller.  You could use this to trigger a block of logic that looks at the status of other inputs; and you just don't allow critical functions to operate unless everything checks out.




Hope this helps.

-HP

Volker

  • Guest
Re: Program First Loop
« Reply #2 on: November 11, 2010, 07:54:33 AM »
Hello Tyler,

you can use a module to set your specific startup values and control your network. Then you place your programm in a other modul that only get enabled when the first modul is correctlly processed. I havn't tested it yet but normally this solution will work.

Volker