HJTrost Posted April 24, 2014 Share Posted April 24, 2014 I have a slew of problems with the gather technique. I need to monitor coordinated moves in the x-y plane of a 3-axis machine with all three axes in a single coordinate system. I am trying to do this using the gather technique and am running into problems. To have everything reproducible, I am writing a single-shot PLC (no.15). All is okay except that Define Gather 1536 gives an error 3 during download, which disappears if I drop the length parameter. Interactively in the Terminal window of PEWin32 Pro, I can give this command without problem. Because I use the rear part of the DPRAM for other things, the gather buffer there cannot be maximal and I need the size parameter. Why can I not do this? Do I have to go into a PROG? Next problem: How do I get the gather data out? If I go interactively and say (in the PEWin32 Pro terminal window) Define Gather 64 Gather Endgather List Gather I get an ERR003 on the "List Gather" command. Would assigning an M variable each to the first and last word respectively and saying M(one)..(two) do the trick? I could then simply save the terminal output ... I work on a PMAC2-PC104 with ACC-2P, firmware version 1.17C, PEWin32 Pro 3.2.2.1 (service pack 2.0 is applied but not 4.0), Windows XP SP3, USB 2.0 communication. I appreciate any and all suggestions. Jochen Link to comment Share on other sites More sharing options...
Sina.Sattari Posted April 25, 2014 Share Posted April 25, 2014 Jochen, The gather commands, such as "define gather", "gather", "endgather" and "list gather" are online commands, and can only be directly called from a terminal window or a communication channel. However, you can use the COMMAND"" (or short form CMD"") command in PLCs and PROGs in order to execute these commands. For example: DELGAT CLOSE OPEN PROG 1 CLEAR LINEAR INC F10 TA 250 TS 50 CMD"DELGAT" // delete the existing gather buffer CMD"DEFGAT" // define the gather buffer. You can also define a size here CMD"GAT" // Start gathering DWELL 0 // interrupt the lookahead and make sure all CMDs are processed before proceeding X20 DWELL 0 // make sure program completes execution up to this point before next line is processed CMD"ENDG" // End gather DWELL 0 CLOSE if you're trying to do this from a PLC, since there are no dwell commands for PLCs, you need to add a while loop in the PLC after calling each CMD in order to allow the background cycle to exit the PLC, process the CMD buffer and get back to the PLC execution on the next run of background PLC scan. Link to comment Share on other sites More sharing options...
HJTrost Posted April 25, 2014 Author Share Posted April 25, 2014 Jochen, The gather commands, such as "define gather", "gather", "endgather" and "list gather" are online commands, and can only be directly called from a terminal window or a communication channel. However, you can use the COMMAND"" (or short form CMD"") command in PLCs and PROGs in order to execute these commands. For example: Thanks, Sina, that got me over the hump with the DEFINE GATHER. I'm debugging my program right for things that the compilation and download don't notice. I have yet to look at the LIST GATHER which is not in my program but I have tried it in the terminal window with an ERR003 resulting. If that is due to the gather buffer being defined but empty then I should be fine on that count, too. Cheers, Jochen Link to comment Share on other sites More sharing options...
Sina.Sattari Posted April 26, 2014 Share Posted April 26, 2014 Jochen, In addition to PMAC User's manual section titled "Data Gathering" You may find the following document useful:GATHER decode.pdf Link to comment Share on other sites More sharing options...
HJTrost Posted May 21, 2014 Author Share Posted May 21, 2014 Jochen, In addition to PMAC User's manual section titled "Data Gathering" You may find the following document useful: Sina, as a belated feedback, that helped and I got my gather project going. Only the "list gather" continued to fail (where does its output go? why does it always give ERR003?) and I abandoned it in favor of writing a custom program to inspect a noncyclic (I45=2) gather buffer in DPRAM after the fact. The noncyclic operation turned out to be sufficient for my purposes. Thanks again, Jochen Link to comment Share on other sites More sharing options...
Recommended Posts