Jump to content
OMRON Forums

shu

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by shu

  1. Thank you Charles, I wanted a bit status for control, so your first solution suits me very well.

     

    Shu,

     

    No, there is no built-in structure for determining if a background C program is running. You can monitor this in one two ways:

     

    1. Create a global variable which you set when you start the program. This can be, for example, a "global" defined in global definitions.pmh.

    2. Issue the "top" command in Linux and look to see if your program is in the list of programs running. Please google "Linux top command" for details on how "top" works.

  2. Hi,

     

    We're using PowerPmac with C Background Programs (Capp) and CPLCs. I know that we can see if a CPLC is running from "UserAlgo.BgCplc[n]" or "UserAlgo.RtiCplc". How could we know if a Capp program is running (from terminal window or a CPLC program)? Is there a similar register like "UserAlgo.BgCplc[n]" for Capp?

     

    Many thanks,

    Regards,

    Shu

  3. Make sure you are using the latest firmware and IDE from FileDepot.

     

    I'm using IDE 2.0.3.40, the firmware version is 2.0.2.14.

    However I tried on another PC using the same IDE version and same project on same PowerBrick, it succeed to compiler the code. I can't really understand what's wrong...

  4. Hi Brad,

    Thanks for your advices. The terminal and watch window work now with the IDE updated.

    I'm trying to compile the usrcode.c with the CfromScript function. But a compilation error occurred:

    Error : The compiler was not able to generate an executable file.  Please open the following error log file for more information
    

    The log references to "..\Realtime Routines\\err.log" and "..\Realtime Routines\\msg.log" files. The "..\Realtime Routines\err.log" shows:

    cp: cannot stat '/usr/local/usralgo/usralgomain.c': No such file or directory
    make: *** [all] Error 1
    

    Have you met this problem?

  5. Hi,

    I'm trying to find a way to get axis positions in a C program (Capp or Cplc). The GetCoordPos() function takes about 700µs to obtain all the structure information. Is there a faster way instead?

     

    I've tried something in a Capp program as below:

    double x, y, aa;
    pshm->Ldata.coord = cs_number;
    Command("pread");
    x = pshm->Ldata.D[6];
    y = pshm->Ldata.D[7];
    aa = pshm->Ldata.D[9];
    

     

    and:

    double x, y, aa;
    char  *szdata = (char *)malloc(CHAR_BUF_SIZE*sizeof(unsigned char));
    sprintf(szdata,"Ldata.coord = %u", cs_number);	
    Command(szdata);
    Command("pread");
    x = pshm->Ldata.D[6];
    y = pshm->Ldata.D[7];
    aa = pshm->Ldata.D[9];
    

     

    and:

    double x, y, aa;
    char  *szdata = (char *)malloc(CHAR_BUF_SIZE*sizeof(unsigned char));
    sprintf(szdata,"&%u p", cs_number);
    x = pshm->Ldata.D[6];
    y = pshm->Ldata.D[7];
    aa = pshm->Ldata.D[9];
    

    But none of them worked, the results showed always : x=0, y=0, aa=0 with the debugger tool.

     

    Another question, I tried with a script program:

    open plc 10
    ldata.coord = 9 
    pread 
    p100 = D6
    p101 = D7
    close
    

    But I couldn't really understand the result, as shown attached pictures : "watch window.PNG" and "terminal window.PNG", the responses for "&9p" axes position are not the same from different query command calls.

    1584869685_watchwindow.PNG.0c100ae4be79b760d4193bd6e40e69c1.PNG208287357_terminalwindow.PNG.206ddba297e91e1cc3db0cf434470431.PNG

    Do I make some mistakes somewhere?

     

    Thanks in advance for help!

×
×
  • Create New...