Condition Handler

  • Please How can I use Condition handler to let it running in background to check the status for DI[10] TO trigger some output according to the DI[10].


    So I need to do that in parallel with the running program.


    How can I do that In Karel , please a sample program if you have will be great.



    Thanks,

    Moelsayed

  • If all you want is to tie a specific output to a specific input at all times, set up an I/O interconnect. It is a much simpler solution than using condition handlers, bglogic, or karel.


    If this won't work for you for some reason, post what exactly you are trying to accomplish and we can help you figure out what the best solution is.

  • Thanks for your response.

    so what I should I do after creating the karel file?

    should I call this file in Background-LG ? Or running it as Background-LG ?


    I would like to know what is the next step after building the karel program?



    Thanks,

    Moelsayed

  • If you want to run it in parallel, use the RUN command. The program does not have to be a Karel program though and I would stay away from Karel unless you are trying to do something that cannot be done with TPP.

  • Background Logic is for TP programs only, and has some limits on how much TP language it can use -- for example, Mixed Logic is not allowed (IIRC).


    If you want to run a KAREL program as a background task, it has to be called using a RUN command from a TP program (instead of a CALL). If you want the KAREL program to keep running indefinitely in the background, you'll need to make an infinite loop inside it, but that loop will need to include:

    1. A time delay each cycle. Otherwise, the runaway loop will eat all the system resources

    2. A way to stop it -- say, exiting the loop if a particular Flag or DO is set. Otherwise, you'll find yourself in situations where you need to kill that task, and can't.


    Do you have a means to compile your ASCII file (.LS or .KL) into the Fanuc binary format (.TP or .PC)?

Advertising from our partners