Jump to content
OMRON Forums

shu

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by shu

  1. Thank you Charles, I wanted a bit status for control, so your first solution suits me very well.
  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. Thanks to all for replies. I think I find a way to compile, there seems to be some differences between PCs.
  4. 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...
  5. Both usercode.h and usercode.c have been correctly set. I tried a new project, but the compile failed with the same error. With Putty, I connected to the ppmac, there is indeed no folder named "usralgo" in '/usr/local/' directory. Should I need to update something?
  6. 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?
  7. 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. Do I make some mistakes somewhere? Thanks in advance for help!
×
×
  • Create New...