Jump to content
OMRON Forums

jtaseff

Members
  • Posts

    31
  • Joined

  • Last visited

Everything posted by jtaseff

  1. Ah, found in the User's Manual.
  2. In the power pmac software reference, under Ldata.CmdStatus, there's a small list of error codes that can be returned. But not all of them are listed, I had to hunt around on the forum to find one of the errors I saw (-34 for buffer full). It would be great to have them all in one spot, and perhaps with some more verbose description of what might cause them. Thanks
  3. We have a linear motor that needs to be dynamically reassigned between two coordinate systems. We have a PLC that schedules the motion programs for the coordinate systems, and manages the timing of the axis assignment properly when no motion programs are running. It works 99% of the time, but fails sporadically and irreproducibly, on the order of every 5-20 minutes. The assignments are getting made around every 15 seconds. As suggested in the manual, we are making the release/assignment as follows. cmdSuccess=1; Ldata.CmdStatus=1; cmd"&1 delete lookahead" sendallcmds while(Ldata.CmdStatus>0) {} if (Ldata.CmdStatus<0) { cmdSuccess=-1; send1"delete fail %d",Ldata.CmdStatus } Ldata.CmdStatus=1; cmd"&1#12->0" sendallcmds while(Ldata.CmdStatus>0) {} if (Ldata.CmdStatus<0) { cmdSuccess=-1; send1"assign fail %d",Ldata.CmdStatus } Ldata.CmdStatus=1; cmd"&1 define lookahead 1500" sendallcmds while(Ldata.CmdStatus>0) {} if (Ldata.CmdStatus<0) { cmdSuccess=-1; send1"define fail %d",Ldata.CmdStatus } There are a number of different failure modes observed. 1. The #12->0 command fails and returns -20 (illegal cmd or illegal syntax??) 2. The define lookahead command fails and returns -34 (buffer full??). Trying to define it from the terminal after everything is stopped also returns the -34 error. 3. The commands do not fail, or the send1 debug messages do not get sent, but the LHSize in question is still 0 afterward. Trying to define lookahead later (when a program checks that LHSize==0) succeeds. 4. Same as 3, but trying to define lookhead from a program or the terminal returns the -34 error. I am running a stress test in an almost blank pmac project and have seen all of these failures a few times. Any input on possible causes, what the error codes mean, better ways to check the status, or better ways to have 2 CSs use the same motor at different times would be appreciated.
  4. Hi all, I have another problem coming up in trying to do some vector math. I'm testing the difference in the time it requires to calculate the sum or sumproduct of vectors if I do it using a while loop vs. using the build in vector sum and sumprod functions. The while loop takes around 100 times longer, or a few ms instead of about 0.01 ms for sum and sumprod. Testing code below will calculate the sums of x and x^2 using both methods. It's great to use sum and sumprod for these, but some of my calculations require more complex sum/products like x^3 and xxy that don't have functions. I've tried running it in a motion program and a plc, no major change. I've set the GoBack for the respective coord and plc to much higher than the number of data in the loop, and the loop method still takes a few ms. Without GoBack it takes on the order of 0.3 sec. Is there a more efficient way I'm not seeing to make some of these vector calculations, or to force it to evaluate all the way in one cycle? Thanks for any advice. global testresult1; global testresult2; global timer1; global timer2; sub: test(null) timer1 = Sys.Time; testresult1 = sum(&data(0), 250, 1); testresult2 = sumprod(&data(0), &data(0), 250, 1, 1); timer1 = Sys.Time - timer1; // comes out to 0.00007 sec timer2 = Sys.Time; local ind1 = 0; while (ind1 < 250) { testresult1 += (gbx(ind1)); testresult2 += data(ind1) * data(ind1); ind1++; } timer2 = Sys.Time - timer2; // comes out to 0.002 sec return;
  5. Thanks for the replies, guys. I ended up finding 2 ways around my problems. The first is just gathering the data myself - I was just already using the gather function so it didn't occur to me to change. The other problem was my data copying speed if I was using a while loop to loop through the gather data index, which came up again with my calculation algorithm afterward. I was running up against the GoBack setting, which keeps programs from executing a while loop more than necessary per cycle. Happens for coordinate system sub/programs, motion programs, and PLCs, all of which have their own setting. Bumping up the PLC[x].Ldata.GoBack from 0 to 10 dropped my execution time by 200x, though it didn't help nearly as much when I tried changing Coord[x].GoBack or Coord[x].Ldata.GoBack and running it as a subprog. Just thought I might post this if anyone else sees the same problem with large loops that need to get executed immediately.
  6. Hi all, I'm tackling the implementation of a new metrology method - it involves measuring an analog voltage over the course of a motor move. So far, I've gotten it to work well by using the gather function to log the voltage and motor position, then using gather in the linux terminal and analyzing data offline. However, now I need to implement this live on the controller. I'm having a difficult time just accessing the data stored in Gather.Ddata[...] in a nice way since it isn't in the same space as P variables. Normal syntax for using P variable arrays doesn't work on the gather data the way I imagine it would. Can anyone help out with a correct method to somehow copy or manipulate the data in Gather.Ddata into a P variable array/matrix? The only thing I've gotten to work is looping through and copying each individual value, which takes decades for just a few thousand values. I've tried using ptrs or using the array/matrix functions but nothing seems to work.
×
×
  • Create New...