![SMAC LAC-25 Technical Reference Manual Download Page 61](http://html1.mh-extra.com/html/smac/lac-25/lac-25_technical-reference-manual_1294649061.webp)
SMAC
LAC-25 Technical Reference Manual
66
Command:
CDn
-- Capture Data --
Argument:
0 <= n <= 16383
This command allows for the capture and recording of data from an internal variable with
the user being able to later download and plot this data for analysis. The number of samples that
can be recorded depends on the amount of macro memory available at the time that the Capture
Storage (CS) command is issued.
The argument determines the number of samples to record. If an argument is used that is
greater than the allocated storage space, then the argument will be truncated to fit that space. All
data sizes are extended to 32 bits before they are stored.
Before using the CD command, a few things must be taken care of. The first of these is to
define an area to store the data. The Capture Storage (CS) command is used for this in that i t
allocates a storage area in the macro memory to where the data can be recorded. The next thing
to do is to specify the location and size of the data to be recorded. The internal 16-bit variable
ÒRecAddrÓ (see Register commands) is used to specify the location (or address) of the variable to be
recorded. The internal 16-bit variable ÒRecSizeÓ is used to specify the data size. If bit 0 of
ÒRecSizeÓ is equal to Ò1Ó then 8 bit data samples are recorded. If bit 1 of ÒRecSizeÓ is equal to Ò1Ó
then 16 bit data samples are recorded. If bits 0 and 1 of ÒRecSizeÓ are both Ò0Ó then 32 data
samples are recorded. The last thing that needs to be specified is the sample rate at which the data
is captured. This is set by writing the appropriate value to the 16-bit variable ÒRecRateÓ. The
sample rate will be whatever the servo sample rate is (see SS command) divided by ÒRecRateÓ.
RecSize
Recorded Variable Size
1
8 Bits
2
16 Bits
0
32 Bits
After using the CD command, the Dump Data (DD) command can be used to display the
data that was captured.
Example:
To make 2000 records of the actual position of axis 2 you would issue the following
commands:
CS2000
; Reserve space for 2000 samples.
;
;
;
AL4,WW422
; Servo rate = 1mS so Data rate = 4mS.
AL638,WW424
; Set address of axis 2 Curp.
AL0,WW426
; Set for 32-bit variable size.
The CS command should be used only once. After that, the CD and DD commands can be
used repeatedly.
Related Commands: CS, DD