13-26 VersaMax® Modules, Power Supplies, and Carriers User's Manual – March 2003 GFK-1504K
13
IC200MDD841
Mixed Module, 24VDC Positive Logic Input 20 Points / Output 12 Point /
(4) High Speed Counter, PWM, or Pulse Train Configurable Points
Using the COMREQ Function to Send Data Commands
The VersaMax PLC CPU can use the COMREQ function to send Data Commands to the
High Speed Counter module. These commands are all 6 bytes in length. The command
data must be placed in the correct order (in a
command block
) in CPU memory before the
command is executed. Program logic should be set up to assure that the command is sent
to the module once, not repeatedly. This function is effective only on counters that are
enabled.
Command Block
The format for Data Commands is as follows:
MSB LSB
command word
data word (LSW)
where: n=counter 1-4
cc=subcommand code
dd=data type
0n cc
dd dd
dd dd
data word (MSW)
The command block used to send Data Commands is composed of 10 words as shown
below. All values are hexadecimal unless otherwise indicated. Note that if the command
block is not set up correctly, unexpected operation may occur. The command block can be
placed in any word-oriented area of memory that is not reserved.
Location Data Description
%R0001 0004 Should be 0004
%R0002 0000 Reserved (must be zero)
%R0003 nnnn Status Data type (0008 = R, 000A=AI, 000C=AQ, 0010=I, 0012=Q)
%R0004 nnnn Start location of COMREQ Status word
%R0005 0000 Reserved (must be zero)
%R0006 0000 Reserved (must be zero)
%R0007 0003 HSC application request (always 3)
%R0008 nnnn Command word
%R0009 nnnn LS data word
%R0010 nnnn MS data word