Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems using gather in a PLC
#1
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
Reply
#2
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:

Code:
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.
Sina Sattari
Chief Engineer
Delta Tau Data Systems, Inc.
Reply
#3
(04-25-2014, 09:24 AM)Sina Wrote: 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:
<snip>

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
Reply
#4
Jochen,

In addition to PMAC User's manual section titled "Data Gathering" You may find the following document useful:


Attached Files
.pdf   GATHER decode.pdf (Size: 18.26 KB / Downloads: 30)
Sina Sattari
Chief Engineer
Delta Tau Data Systems, Inc.
Reply
#5
(04-25-2014, 05:18 PM)Sina Wrote: 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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)