qchen3 Posted March 22, 2012 Share Posted March 22, 2012 There are two threads on preventing Background C program from being executed after a build&download by properly configuing the property. My question: How to start the program after that? Link to comment Share on other sites More sharing options...
Sina.Sattari Posted March 22, 2012 Share Posted March 22, 2012 There are multiple ways for doing so: 1. From IDE: Under Tools menu, select task manager. Under PLC tab, you can see a list of all PLCs, CPLCs and Background C programs. You can right-click on each one and select start. 2. From online terminal (gpascii) cx system "/var/ftp/usrflash/Project/C\ Language/Background\ Programs/capp1.out" Note: you have to replace the "capp1" with the name that you have chosen for your background C program folder in your project. 3. From motion program/script PLC. Issue the following command: system "/var/ftp/usrflash/Project/C\ Language/Background\ Programs/capp1.out" Note: you have to replace the "capp1" with the name that you have chosen for your background C program folder in your project. 4. Calling the program directly through ssh/telnet console/connection as a pure linux prompt call. These are only a few ways of calling and executing your background C programs. There are other ways also available, but I think this should get you started. Link to comment Share on other sites More sharing options...
qchen3 Posted March 29, 2012 Author Share Posted March 29, 2012 The reply from Sina showing the solution to start a background C application from motion program/script PLC. In a second scenario: If I need to disable such C application in the mid of execution, what is the command to be released in the script PLC? Link to comment Share on other sites More sharing options...
Omron Forums Support Posted March 30, 2012 Share Posted March 30, 2012 Try this command: system "killall capp1.out" Change capp1.out to the name of your compiled program, whatever it may be. Link to comment Share on other sites More sharing options...
FEIR Posted April 5, 2012 Share Posted April 5, 2012 What about calling a CAPP from a CPLC program? E.g. rticplc should trigger a CAPP every 1000 cycles? Link to comment Share on other sites More sharing options...
Omron Forums Support Posted April 5, 2012 Share Posted April 5, 2012 I am not sure if the following method is the best method but this method will work: Inside your CPLC you can do this to start capp1.out, for example: Command("cx system \"/var/ftp/usrflash/Project/C\\ Language/Background\\ Programs/capp1.out\""); To stop capp1.out, you can put this in your CPLC: Command("cx system \"killall capp1.out\""); Link to comment Share on other sites More sharing options...
jhendges Posted January 24, 2013 Share Posted January 24, 2013 Is there a way to see check is a Backgroup C Program is running, and then start it on the condition that it is not running at the time? Link to comment Share on other sites More sharing options...
KEJR Posted January 24, 2013 Share Posted January 24, 2013 Is there a way to see check is a Backgroup C Program is running, and then start it on the condition that it is not running at the time? Background C programs are regular linux programs so you can check for them in the output of "task manager" like programs. From the command line type in "ps -e" and it will spit out all processes running. Also the program "pidof" will return the process ID of the program that you specify, for instance, try this: pidof getty it will return several numbers since getty runs as many processes. There are probably several dozen other ways to do this and the approach will depend on whether you call this from a shell script or another C program (some manager application, or HMI program that starts the C code, etc). KEJR Link to comment Share on other sites More sharing options...
michaelthompson Posted January 28, 2013 Share Posted January 28, 2013 FEIR, What about calling a CAPP from a CPLC program? E.g. rticplc should trigger a CAPP every 1000 cycles? From a CPLC, you can use the C system() function as opposed to the Command call to system provided by Charles. Link to comment Share on other sites More sharing options...
tecnico Posted March 24, 2020 Share Posted March 24, 2020 Removed by administrator Link to comment Share on other sites More sharing options...
Alex Anikstein Posted March 24, 2020 Share Posted March 24, 2020 tecnico, Someone will email you shortly to help try to troubleshoot your issue. Link to comment Share on other sites More sharing options...
Recommended Posts