The text of a manual · part 41 of 60
SYSMAC CQM1/CPM1/CPM1A/SRM1 Programmable Controllers Programming Manual: SECTION 6 Host Link Commands, pages 375 to 382
Pages 375 to 382 of 520, from SYSMAC CQM1/CPM1/CPM1A/SRM1 Programmable Controllers Programming Manual
The original document is the PDF (2.1 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Omron CQM1-CPU21
Page 375
Section
Host Link Commands Parameters
6-3
Read Data (Response) The contents of the number of words specified by the command are returned in hexadecimal as a response. The words are returned in order, starting with the specified beginning word.
6-3-3 HR AREA READ –– RH Reads the contents of the specified number of HR words, starting from the specified word. Command Format @ x 101 x 100
R
Node no.
H
Header code
Note
Response Format @ x 103 x 102 x 101 x 100 x 103 x 102 x 101 x 100 Beginning word1
No. of words2
FCS
↵
Terminator
1. Beginning word: 0000 to 0099 in CQM1 PCs, 0000 to 0019 in CPM1/CPM1A/SRM1 PCs 2. No. of words: 0001 to 0100 in CQM1 PCs, 0001 to 0020 in CPM1/CPM1A/SRM1 PCs An end code of 00 indicates normal completion.
x 101 x 100
R
Node no.
H
Header code
Parameters x 161 x 160 x 163 x 162 x 161 x 160
End code
Read data (1 word)
FCS
↵
Terminator
Read data (for number of words read)
Read Data (Response) The contents of the number of words specified by the command are returned in hexadecimal as a response. The words are returned in order, starting with the specified beginning word.
6-3-4 PV READ –– RC Reads the contents of the specified number of timer/counter PVs (present values), starting from the specified timer/counter. Command Format @ x 101 x 100
Node no.
C x 103 x 102 x 101 x 100 x 103 x 102 x 101 x 100
Header code
Beginning timer/counter1 No. of timers/counters2
R
Note
Response Format @ x 101 x 100
Node no.
FCS
↵
Terminator
1. Beginning T/C: 0000 to 0511 in CQM1 PCs, 0000 to 0127 in CPM1/CPM1A/SRM1 PCs 2. No. of T/Cs: 0001 to 0512 in CQM1 PCs, 0001 to 0128 in CPM1/CPM1A/SRM1 PCs An end code of 00 indicates normal completion.
R
C
Header code x 161 x 160 x 103 x 102 x 101 x 100
End code
Read data (1 word) Read data (for number of words read)
FCS
↵
Terminator
The response will be divided when reading more than 30 words of data.
357
Page 376
Section
Host Link Commands Parameters
6-3
Read Data (Response) The number of present values specified by the command is returned in hexadecimal as a response. The PVs are returned in order, starting with the specified beginning timer/counter.
6-3-5 TC STATUS READ –– RG Reads the status of the Completion Flags of the specified number of timers/ counters, starting from the specified timer/counter. Command Format @ x 101 x 100
G x 103 x 102 x 101 x 100 x 103 x 102 x 101 x 100
Header code
Beginning timer/counter1 No. of timers/counters2
R
Node no.
Note
Response Format
FCS
↵
Terminator
1. Beginning T/C: 0000 to 0511 in CQM1 PCs, 0000 to 0127 in CPM1/CPM1A/SRM1 PCs 2. No. of T/Cs: 0001 to 0512 in CQM1 PCs, 0001 to 0128 in CPM1/CPM1A/SRM1 PCs An end code of 00 indicates normal completion. @ x 101 x 100 Node no.
R
G
Header code x 161 x 160 ON/ OFF
End code
FCS
↵
Terminator
Read data (1 timer/counter) Read data (for number of TC read)
The response will be divided when reading the status of more than 123 timer/ counters. Parameters
Read Data (Response) The status of the number of Completion Flags specified by the command is returned as a response. “1” indicates that the Completion Flag is ON.
6-3-6 DM AREA READ –– RD Reads the contents of the specified number of DM words, starting from the specified word. Command Format @ x 101 x 100
R
Node no.
Header code
D x 103 x 102 x 101 x 100 x 103 x 102 x 101 x 100
Beginning word*
No. of words (0001 to 6656)
FCS
↵
Terminator
Note Beginning word: 0000 to 6655 in CQM1 PCs, 0000 to 1023 and 6144 to 6655 in CPM1/CPM1A PCs, and 0000 to 2047 and 6144 to 6655 in SRM1 PCs. Response Format @ x 101 x 100
Node no.
358
An end code of 00 indicates normal completion. R
D
Header code x 161 x 160 x 163 x 162 x 161 x 160
End code
Read data (1 word) Read data (for number of words read)
FCS
↵
Terminator
Page 377
Section
Host Link Commands Note
Parameters
6-3
1. Words 1024 to 6143 in CPM1/CPM1A PCs and words 2048 to 6143 in SRM1 PCs cannot be specified. If an attempt to read any of these words is made, a response of 0000 will be returned. 2. The response will be divided when reading more than 30 words of data. Read Data (Response) The contents of the number of words specified by the command are returned in hexadecimal as a response. The words are returned in order, starting with the specified beginning word.
Note Be careful about the configuration of the DM area, as it varies depending on the CPU Unit model.
6-3-7 AR AREA READ –– RJ Reads the contents of the specified number of AR words, starting from the specified word. Command Format @ x 101 x 100
Node no.
R
Header code
Note
Response Format @
J x 103 x 102 x 101 x 100 x 103 x 102 x 101 x 100 Beginning word1
No. of words2
FCS
↵
Terminator
1. Beginning word: 0000 to 0027 in CQM1 PCs, 0000 to 0015 in CPM1/CPM1A/SRM1 PCs 2. No. of words: 0001 to 0028 in CQM1 PCs, 0001 to 0016 in CPM1/CPM1A/SRM1 PCs An end code of 00 indicates normal completion.
x 101 x 100
R
Node no.
Header code
Parameters
J x 161 x 160 x 163 x 162 x 161 x 160
End code
Read data (1 word )
FCS
↵
Terminator
Read data (for number of words read)
Read Data (Response) The contents of the number of words specified by the command are returned in hexadecimal as a response. The words are returned in order, starting with the specified beginning word.
6-3-8 IR/SR AREA WRITE –– WR Writes data to the IR and SR areas, starting from the specified word. Writing is done word by word. Command Format @ x 101 x 100
W
Node no.
Header code
R
Note x 103 x 102 x 101 x 100 x 163 x 162 x 161 x 160
Beginning word*
Write data (1 word)
FCS
↵
Terminator
Write data (for number of words to write)
1. Beginning word: 0000 to 0252 in CQM1 PCs, 0000 to 0019 and 0200 to 0252 in CPM1/CPM1A/SRM1 PCs. 2. Divide the command when writing more than 30 words of data.
359
Page 378
Section
Host Link Commands Response Format
6-3
An end code of 00 indicates normal completion. @ x 101 x 100
Node no.
R x 161 x 160
Header code
End code
W
FCS
↵
Terminator
Note Words 0020 to 0199 in CPM1/CPM1A/SRM1 PCs cannot be specified. If an attempt to write to any of these words is made, the writing operation will not be executed and normal completion occurs. Parameters
Write Data (Command) Specify in order the contents of the number of words to be written to the IR or SR area in hexadecimal, starting with the specified beginning word. Note If data is specified for writing which exceeds the allowable range, an error will be generated and the writing operation will not be executed. If, for example, 252 is specified as the beginning word for writing,and two words of data are specified, then 253 will become the last word for writing data, and the command will not be executed because SR 253 is beyond the writable range.
6-3-9 LR AREA WRITE –– WL Writes data to the LR area, starting from the specified word. Writing is done word by word. Command Format @ x 101 x 100
W
Node no.
Header code
L x 103 x 102 x 101 x 100 x 163 x 162 x 161 x 160
Beginning word*
Write data (1 word)
FCS
↵
Terminator
Write data (for number of words to write )
Note Beginning word: 0000 to 0063 in CQM1 PCs, 0000 to 0015 in CPM1/CPM1A/SRM1 PCs Response Format
An end code of 00 indicates normal completion. @
Parameters x 101 x 100
W
L x 161 x 160
Node no.
Header code
End code
FCS
↵
Terminator
Write Data (Command) Specify in order the contents of the number of words to be written to the LR area in hexadecimal, starting with the specified beginning word. Note If data is specified for writing which exceeds the allowable range, an error will be generated and the writing operation will not be executed. If, for example, 60 is specified as the beginning word for writing and five words of data are specified, then 64 will become the last word for writing data, and the command will not be executed because LR 64 is beyond area boundary.
6-3-10 HR AREA WRITE –– WH Writes data to the HR area, starting from the specified word. Writing is done word by word.
360
Page 379
Section
Host Link Commands
6-3
Command Format @ x 101 x 100
Node no.
W
H
Header code x 103 x 102 x 101 x 100 x 163 x 162 x 161 x 160
Beginning word*
↵
Write data (1 word)
FCS
Terminator
Write data (for no. of words to write)
Note Beginning word: 0000 to 0063 in CQM1 PCs, 0000 to 0019 in CPM1/CPM1A/SRM1 PCs Response Format
An end code of 00 indicates normal completion. @ x 101 x 100
Node no.
Parameters
H x 161 x 160
Header code
End code
W
↵
FCS
Terminator
Write Data (Command) Specify in order the contents of the number of words to be written to the HR area in hexadecimal, starting with the specified beginning word. Note If data is specified for writing which exceeds the allowable range, an error will be generated and the writing operation will not be executed. If, for example, 98 is specified as the beginning word for writing, and three words of data are specified, then 100 will become the last word for writing data, and the command will not be executed because HR 100 is beyond area boundary.
6-3-11 PV WRITE –– WC Writes the PVs (present values) of timers/counters starting from the specified timer/counter. Command Format @ x 101 x 100
W
Node no.
Header code
C x 103 x 102 x 101 x 100 x 103 x 102 x 101 x 100
Beginning timer/counter*
Write data (1 timer/counter)
↵
Terminator
FCS
Write data (for no. of PV to write)
Note
Response Format
1. Beginning T/C: 0000 to 0511 in CQM1 PCs, 0000 to 0127 in CPM1/ CPM1A/SRM1 PCs 2. Divide the command when writing more than 29 words of data. An end code of 00 indicates normal completion. @ x 101 x 100
Node no.
Parameters
C x 161 x 160
Header code
End code
W
FCS
↵
Terminator
Write Data (Command) Specify in decimal numbers (BCD) the present values for the number of timers/ counters that are to be written, starting from the beginning timer/counter. Note
1. When this command is used to write data to the PV area, the Completion Flags for the timers/counters that are written will be turned OFF.
361
Page 380
Section
Host Link Commands
6-3
2. If data is specified for writing which exceeds the allowable range, an error will be generated and the writing operation will not be executed. If, for example, 510 is specified as the beginning word for writing, and three words of data are specified, then 512 will become the last word for writing data, and the command will not be executed because TC 512 is beyond area boundary.
6-3-12 TC STATUS WRITE –– WG Writes the status of the Completion Flags for timers and counters in the TC area, starting from the specified timer/counter (number). Writing is done number by number. Command Format @ x 101 x 100
W
Node no.
G
Header code x 103 x 102 x 101 x 100 ON/ OFF
↵
Beginning timer/counter*
Terminator
FCS Write data (1 timer/counter) Write data (for number of TC to write)
Note
Response Format
1. Beginning T/C: 0000 to 0511 in CQM1 PCs, 0000 to 0127 in CPM1/CPM1A/SRM1 PCs 2. Divide the command when writing the status of more than 118 timer/counters. An end code of 00 indicates normal completion. @
Parameters x 101 x 100
W
G x 161 x 160
Node no.
Header code
End code
FCS
↵
Terminator
Write Data (Command) Specify the status of the Completion Flags, for the number of timers/counters to be written, in order (from the beginning word) as ON (i.e., “1”) or OFF (i.e., “0”). When a Completion Flag is ON, it indicates that the time or count is up. Note If data is specified for writing which exceeds the allowable range, an error will be generated and the writing operation will not be executed. If, for example, 510 is specified as the beginning word for writing, and three words of data are specified, then 512 will become the last word for writing data, and the command will not be executed because TC 512 is beyond area boundary.
6-3-13 DM AREA WRITE –– WD Writes data to the DM area, starting from the specified word. Writing is done word by word. Command Format @ x 101 x 100 Node no.
W
D
Header code
Note
362 x 103 x 102 x 101 x 100 x 163 x 162 x 161 x 160 Beginning word*
Write data (1 word)
FCS
↵
Terminator
Write data (for number of words to write)
1. Beginning word: 0000 to 6143 in CQM1 PCs, 0000 to 1023 and 6144 to 6655 in CPM1/CPM1A PCs, and 0000 to 2047 and 6144 to 6655 in SRM1 PCs
Page 381
Section
Host Link Commands
6-3
2. Divide the command when writing more than 29 words of data. Response Format
An end code of 00 indicates normal completion. @ x 101 x 100
Node no.
D x 161 x 160
Header code
End code
W
FCS
↵
Terminator
Note DM 1024 to DM 6143 in CPM1/CPM1A PCs and DM 2048 to DM 6143 in SRM1 PCs cannot be specified. If an attempt to write to any of these words is made, the writing operation will not be executed for these words and the command will end normally Parameters
Write Data (Command) Specify in order the contents of the number of words to be written to the DM area in hexadecimal, starting with the specified beginning word. Note
1. If data is specified for writing which exceeds the allowable range, an error will be generated and the writing operation will not be executed. If, for example, 6142 is specified as the beginning word for writing, and three words of data are specified, then 6144 will become the last word for writing data, and the command will not be executed because DM 6144 is beyond the writable range. 2. Be careful about the configuration of the DM area, as it varies depending on the CPU Unit model.
6-3-14 AR AREA WRITE –– WJ Writes data to the AR area, starting from the specified word. Writing is done word by word. Command Format @ x 101 x 100
Node no.
W
J
Header code x 103 x 102 x 101 x 100 x 163 x 162 x 161 x 160
Beginning word*
Write data (1 word)
↵
Terminator
FCS
Write data (for the number of words to write)
Note Beginning word: 0000 to 0027 in CQM1 PCs, 0000 to 0015 in CPM1/CPM1A and SRM1 PCs Response Format
An end code of 00 indicates normal completion. @ x 101 x 100 Node no.
Parameters
J x 161 x 160
Header code
End code
W
: FCS
↵
Terminator
Write Data (Command) Specify in order the contents of the number of words to be written to the AR area in hexadecimal, starting with the specified beginning word. Note If data is specified for writing which exceeds the allowable range, an error will be generated and the writing operation will not be executed. If, for example, 26 is specified as the beginning word for writing, and three words of data are specified, then 28 will become the last word for writing data, and the command will not be executed because AR 28 is beyond the writable range.
363
Page 382
Section
Host Link Commands
6-3
6-3-15 SV READ 1 –– R# Searches for the first instance of a TIM, TIMH(15), CNT, and CNTR(12) instruction with the specified TC number in the user’s program and reads the PV, which assumed to be set as a constant. The SV that is read is a 4-digit decimal number (BCD). The program is searched from the beginning, which may take as much as 10 seconds to produce a response. Command Format @ x 101 x 100 Node no.
R
#
OP1 OP2 OP3 OP4 x 103 x 102 x 101 x 100
Header code
Name
TC number*
↵
Terminator
FCS
Note TC number: 0000 to 0511 in CQM1 PCs, 0000 to 0127 in CPM1/CPM1A/SRM1 PCs Response Format @ x 101 x 100
R
Node no.
Header code
Parameters
# x 161 x 160 x 103 x 102 x 101 x 100
End code
↵
SV
FCS
Terminator
Name, TC Number (Command) Specify the instruction for reading the SV in “Name.” Make this setting in 4 characters. In “TC number,” specify the timer/counter number used for the instruction. Instruction name OP1
OP2
OP3
Classification
T
I
M
OP4 (Space)
T
I
M
H
HIGH-SPEED TIMER
C
N
T
(Space)
COUNTER
C
N
T
R
REVERSIBLE COUNTER
TIMER
SV (Response) The constant SV is returned. Note
1. The instruction specified under “Name” must be in four characters. 2. If the same instruction is used more than once in a program, only the first one will be read. 3. Use this command only when it is definite that a constant SV has been set. 4. The response end code will indicate an error (16) if the SV wasn’t entered as a constant.
6-3-16 SV READ 2 –– R$ Reads the constant SV or the word address where the SV is stored. The SV that is read is a 4-digit decimal number (BCD) written as the second operand for the TIM, TIMH(15), CNT, or CNTR(12) instruction at the specified program address in the user’s program. This can only be done with a program of less than 10K. Command Format @ x 101 x 100
Node no.
364
R
$
Header code x 103 x 102 x 101 x 100 OP1 OP2 OP3 OP4 x 103 x 102 x 101 x 100
Program address
Name
TC number*
FCS
↵
Terminator