Delta Tau GEO BRICK LV 用户手册
Turbo PMAC User Manual
Writing a Host Communications Program
421
Setting bit 0 of I5000 to 1 enables the wrap-around. This mode is required for gathering to DPRAM and
real-time upload; it can be useful in gathering to main memory when trying to catch an intermittent
problem. When gathering in this mode, it is a good idea to gather the servo-cycle counter at X:$000000,
so it is possible for the host-computer software to unwrap the data properly. The PMAC Executive
program’s data gathering and plotting routines can upload and plot data from a buffer that has wrapped
around, but it cannot unwrap this data to plot it in the proper time order.
real-time upload; it can be useful in gathering to main memory when trying to catch an intermittent
problem. When gathering in this mode, it is a good idea to gather the servo-cycle counter at X:$000000,
so it is possible for the host-computer software to unwrap the data properly. The PMAC Executive
program’s data gathering and plotting routines can upload and plot data from a buffer that has wrapped
around, but it cannot unwrap this data to plot it in the proper time order.
The user specifies up to 48 source addresses in I-variables I5001 to I5048. The low 19 bits of these
variables represent the word address itself. The top 2 bits control whether the X word, the Y word, or
both (in fixed or floating format) will be gathered. He sets a “mask” in 24-bit variables I5050 and I5051
to specify which of these 48 addresses will be collected, and defines the gathering period in servo
interrupt cycles with I5049.
variables represent the word address itself. The top 2 bits control whether the X word, the Y word, or
both (in fixed or floating format) will be gathered. He sets a “mask” in 24-bit variables I5050 and I5051
to specify which of these 48 addresses will be collected, and defines the gathering period in servo
interrupt cycles with I5049.
Gathering Commands
The buffer in Turbo PMAC’s memory is set up with the on-line DEFINE GATHER [{constant}]
command. If no value is specified, the whole of Turbo PMAC’s open memory is reserved for this buffer.
(This means that no new motion or PLC programs can be added to Turbo PMAC as long as this space is
reserved). If a data-gathering buffer is present in Turbo PMAC’s memory, even if it does not occupy all
open memory no other buffer of the type created with a DEFINE {buffer} command (e.g. COMP,
LOOKAHEAD) may be added to memory until the data-gathering buffer is deleted.
command. If no value is specified, the whole of Turbo PMAC’s open memory is reserved for this buffer.
(This means that no new motion or PLC programs can be added to Turbo PMAC as long as this space is
reserved). If a data-gathering buffer is present in Turbo PMAC’s memory, even if it does not occupy all
open memory no other buffer of the type created with a DEFINE {buffer} command (e.g. COMP,
LOOKAHEAD) may be added to memory until the data-gathering buffer is deleted.
The actual data gathering function is started with the GATHER command. When this has been done,
Turbo PMAC will store the specified data at the specified rate into the gather buffer until told to stop with
the ENDGATHER, or until space runs out. These are on-line commands; from within a motion program or
PLC program, the CMD"GATHER" and CMD"ENDGATHER" statements are used.
In a motion program, these statements are executed at the program calculation time, which can be well
ahead of the move execution time, so if you are not careful, it is easy to miss gathering the last one or two
commanded moves because the CMD"ENDGATHER" statement is issued before these moves actually
execute. Typically, it is a good idea to precede the CMD"ENDGATHER" statement with a DWELL
statement in the motion program. The DWELL statement stops any lookahead in the program, so the
CMD"ENDGATHER" statement will not be issued until the actual execution of the dwell is completed.
Even a DWELL 0 will ensure that the end of the last commanded move is gathered; a longer dwell can
catch the final settling.
Turbo PMAC will store the specified data at the specified rate into the gather buffer until told to stop with
the ENDGATHER, or until space runs out. These are on-line commands; from within a motion program or
PLC program, the CMD"GATHER" and CMD"ENDGATHER" statements are used.
In a motion program, these statements are executed at the program calculation time, which can be well
ahead of the move execution time, so if you are not careful, it is easy to miss gathering the last one or two
commanded moves because the CMD"ENDGATHER" statement is issued before these moves actually
execute. Typically, it is a good idea to precede the CMD"ENDGATHER" statement with a DWELL
statement in the motion program. The DWELL statement stops any lookahead in the program, so the
CMD"ENDGATHER" statement will not be issued until the actual execution of the dwell is completed.
Even a DWELL 0 will ensure that the end of the last commanded move is gathered; a longer dwell can
catch the final settling.
The statements CMD"GATHER" and CMD"ENDGATHER" are executed as background tasks in Turbo
PMAC. Their function is simply to set and clear, respectively, the data gathering control bit at
X:$000006 bit 19. To do this without a background-cycle delay, you could assign an M-variable to this
bit (e.g. M89->X:$000006,19), then set and clear this bit directly in the program.
The stored data can be uploaded to the host with the LIST GATHER command. The data is sent to the
host in ASCII hexadecimal form, with 6 characters per item for the single (X or Y) words, and 12
characters per item for the double (L or D) words. The data is provided in 12-character groupings. If the
data gathered for a sample leaves the last grouping with only six characters, this last grouping is filled out
with the contents of the servo cycle counter register X:$000000.
PMAC. Their function is simply to set and clear, respectively, the data gathering control bit at
X:$000006 bit 19. To do this without a background-cycle delay, you could assign an M-variable to this
bit (e.g. M89->X:$000006,19), then set and clear this bit directly in the program.
The stored data can be uploaded to the host with the LIST GATHER command. The data is sent to the
host in ASCII hexadecimal form, with 6 characters per item for the single (X or Y) words, and 12
characters per item for the double (L or D) words. The data is provided in 12-character groupings. If the
data gathered for a sample leaves the last grouping with only six characters, this last grouping is filled out
with the contents of the servo cycle counter register X:$000000.
It is the host program’s responsibility to decode and process this data, for plotting, storage, analysis, or
other use.
other use.
The space reserved for the data-gathering buffer can be freed with the DELETE GATHER command.