Jump to content
OMRON Forums

How to start(execute) a background C app program


qchen3

Recommended Posts

  • Replies 10
  • Created
  • Last Reply

Top Posters In This Topic

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.

 

256626046_PowerPMACSuite_2012-03-22_08-05-32.png.b5478d857c456008c3b6e4c3b3a3f167.png

 

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

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

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

  • 9 months later...

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

  • 7 years later...
Guest
This topic is now closed to further replies.

×
×
  • Create New...