The text of a manual · part 12 of 19
C-series SYSMAC LINK System Manual, pages 104 to 113
Pages 104 to 113 of 174
The original document is the PDF (983 KB). 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 C200HW-SLK24
Page 104
Section 6-5
CV-mode Commands for PCs
6-5
CV-mode Commands for PCs
6-5-1 MEMORY AREA READ Reads the contents of the specified number of consecutive memory area words starting from the specified word. All words must be in the same memory area (here, all memory areas with the same memory area code are considered as one area). Command Block 01
00
01
Command First word code Memory area code
No. of items
Response Block 01
01
Command code
Parameters
Response code
Data
Memory area code (command): The data area to read. First word (command): The address of the first word to read from memory. Set the third byte of the First word to 00. No. of items (command): The number of items to be read. The number of items must be 0000 to 0100 (0 to 256 decimal). A normal completion response will be returned even if the number of items is set to 00. Data (response): The data from the specified words is returned in sequence starting from the first word. Timer/counter PVs are returned in BCD. The total number of bytes is calculated as follows: Bytes/item x No. of items Memory Areas The following data can be read (refer to 6-4 Memory Area Designations for PC word/bit address designations): Memory area
Data
IR, SR, LR, HR, and AR
Word contents
Memory area Bytes/ code item 80 2
Timer/Counter
Completion Flag status
01
1
PV
81
2
DM
Word contents
82
2
EM
Word contents
90 to 98
2
6-5-2 MEMORY AREA WRITE Writes data to the specified number of consecutive words starting from the specified word. All words must be in the same memory area (here, all memory areas with the the same memory area code are considered as one area). Note
90
1. The MEMORY AREA WRITE command can be executed regardless of the PC’s operating mode. It is the user’s responsibility to program steps to prohibit this command from being executed when the PC is in RUN mode if such protection is necessary. Execute the CONTROLLER STATUS READ command (refer to 6-5-10 CONTROLLER STATUS READ) to read the PC’s mode.
Page 105
Section 6-5
CV-mode Commands for PCs
2. When data is written to the Timer/Counter PV Area, the Completion Flags will be turned OFF (0). Command Block 01
00
02
Command First word code Memory area code
No. of items
Data
Response Block 01
02
Command code
Parameters
Response code
Memory area code (command): The data area to write. First word (command): The first word to write. Set the third byte of the first word to 00. No. of items (command): The number of items to be written. The number of items must be 0000 to 0100 (0 to 256 decimal). A normal completion response will be returned even if the number of items is set to 00. Data (command): The data to be written. Timer/counter PVs are returned in BCD. The total number of bytes is calculated as follows: Bytes/item x No. of items The following data can be written (refer 6-4 Memory Area Designations for the word/bit address designations): Memory area
Data
IR, SR, LR, HR, and AR
Word contents
Memory area Bytes/ code item 80 2
Timer/Counter
PV
81
2
DM
Word contents
82
2
EM
Word contents
90 to 98
2
6-5-3 MULTIPLE MEMORY AREA READ Reads the contents of the specified non-consecutive memory area bytes or words. Bytes or words can be read from up to 128 locations. Note
1. If there is an error in even one memory area code or address, no data will be read. 2. If EM is specified in the memory area code, the maximum number of locations from which bytes or words can be read will be 100.
Command Block Up to 128 addresses
01
04
Command Address code Memory area code
Address Memory area code
91
Page 106
Section 6-5
CV-mode Commands for PCs Response Block 01
04
Command code
Parameters
Response Data code Memory area code
Data Memory area code
Memory area code (command): The data area to read. Address (command): The addresses of the words/bits/flags to read. Data (response): The response returns the memory area code(s) paired with the data from the specified memory area(s). There will be either one or two bytes of data per memory area code depending on the access size specified in the memory area code. Refer to 6-4-2 Memory Area Code for details on access size. Memory Areas The following data can be read (refer to 6-4 Memory Area Designations for memory area designations): Memory area
Data Bit status
Memory area Bytes/ code item 00 1
Word contents
80
2
Completion Flag status
01
1
PV
81
2
DM
Word contents
82
2
EM
Word contents
90 to 98
2
IR, SR, LR, HR, and AR Timer/Counter
6-5-4 PARAMETER AREA WRITE Writes data to the parameter area to designate the DM (data memory) size. Note This command is available only on the SYSMAC C1000HF. Command Block 02
02
Command code
80
10
Parameter code
00
00
First word
80
01
No. of items
Data
Response Block 02
02
Command code
Parameters
Response code
Parameter code (command): 8010 (designate to change the DM size) First word (command): 0000 No. of items (command): 8001 Data (command): Input 00 to designate a DM size of 4,095 words. If 00 is not input, a DM size of 10,000 words will be designated.
6-5-5 PROGRAM AREA READ Reads the contents of the specified number of consecutive program area words starting from the specified word. The data is read in machine language (object code level). A maximum of 512 bytes can be read with each command. To read larger amounts of data, use multiple commands and specify the beginning word and number of words for each.
92
Page 107
Section 6-5
CV-mode Commands for PCs Command Block 03
06
Command code
00
00
Program no.
First word
No. of bytes
Response Block 03
06
Command code
00 Response code
Parameters
00
Program no.
First word
No. of bytes
Data (512 bytes max.)
Program no. (command and response): Set to 0000. First word (command and response): The program area begins at 00000000. The first word must be an even number and will be returned as is in the response. No. of bytes (command and response): The number of bytes in an even number up to 0100 (512 decimal). Bit 15 will be ON (1) in the response block when the last word of data from the program area is in the data returned. In the response, the no. of bytes is the actual number of bytes read. Bit 15 OFF (0): Without last word data Bit 15 ON (1): With last word data Bits 0 to 14: No. of bytes read Bits 0 to 7 (second byte) Bits 8 to 15 (first byte)
If the no. of bytes specified in the command exceeds the number of bytes remaining in the program area, data will be read up to the last word in the program area and an 11 04 or 11 0B parameter error response code will be returned. Data (response): The data in the specified program area will be returned in sequence starting from the beginning word.
6-5-6 PROGRAM AREA WRITE Writes data to the specified number of consecutive program area words starting from the specified word. The data is written in machine language (object code level). A maximum of 512 bytes can be written with each command. To write larger amounts of data, use multiple commands and specify the beginning word and number of words for each. Note The PC will generate an index when bit 15 of the no. of bytes is ON, so bit 15 must be ON when data is written through the last word in the program area. If the no. of bytes is set to 8000, the PC will just generate an index. Command Block 03
07
Command code
00
00
Program no.
First word
No. of bytes
Data (512 bytes max.)
Response Block 03
07
Command code
00 Response code
00
Program no.
First word
No. of bytes
93
Page 108
Section 6-5
CV-mode Commands for PCs Parameters
Program no. (command and response): Set to 0000. First word (command and response): The program area begins at 00000000. The first word must be an even number and will be returned as is in the response. No. of bytes (command and response): The number of bytes in an even number up to 0200 (512 decimal). Bit 15 must be ON (1) when data is written to the last word in the program area. In the response, the no. of bytes is the actual number of bytes read. Bit 15 OFF (0): Without last word data Bit 15 ON (1): With last word data Bits 0 to 14: No. of bytes written Bits 0 to 7 (second byte) Bits 8 to 15 (first byte)
Data (command): The data to be written.
6-5-7 RUN Changes the PC to MONITOR or RUN mode, enabling the PC to execute its program. Command Block 04
01
Command code
Program no.
Mode
Response Block 04
01
Command code
Parameters
Response code
Program no. (command): Set to 0000. Mode (command): As follows: 0002:
MONITOR mode
0004:
RUN mode
Note If the mode is not specified, the PC will go to MONITOR mode.
6-5-8 STOP Changes the PC to PROGRAM mode, stopping program execution. Command Block 04
02
Command code
Response Block 04
02
Command code
94
Response code
Page 109
Section 6-5
CV-mode Commands for PCs
6-5-9 CONTROLLER DATA READ Reads the following data: • PC model and version • Area data • PC status Command Block 05
01
Command code
Response Block 05
01
Command code
Parameters
Response code
20 bytes
20 bytes
16 bytes
10 bytes
65 bytes
PC model
PC version
All zeroes
Area data
All zeroes PC status
PC model and version (response): Both are read in ASCII codes (20 bytes (i.e. 20 ASCII characters) max. each). If the model or version requires less than 20 characters, the remaining bytes will be filled with spaces (ASCII code 20). For the C1000H and C2000H, the version is returned for the MPU1 first followed by the version for the MPU2. If a version does not required 20 characters, the remaining bytes will be filled with spaces (ASCII code 20) for each. All zeroes (response): These bytes contain zeroes. Area data (response): As follows: 1st byte
10th byte 00
00
00
No. of DM words Program area size
Item
EM bank number
File memory size Kind of file memory
Meaning
Unit
Program area size
The size of PC Setup and program area
K words (1K words = 1,024 words)
No. of DM words
Total words in the DM area
Words
EM bank number
Extended Data Memory (EM) Area bank number
Bank
Kind of file memory
00: No file memory 01: SPRAM 04: First half RAM, second half ROM
---
File memory size
0000: 0 (no file memory) 0001: 1000 0002: 2000
Blocks
PC status (response): The value of the byte returned indicates whether or not a Peripheral Device is connected. 00: No Peripheral Device connected. 80: Peripheral Device connected.
6-5-10 CONTROLLER STATUS READ Reads the status of the PC.
95
Page 110
Section 6-5
CV-mode Commands for PCs Command Block 06
01
Command code
Response Block 06
16 bytes
01
Command code
Response code
Fatal error data
Non-fatal error data
FAL no.
Error message
Status Mode
Parameters
Status (response): The operating status of the PC as follows: 00: Stop (program not being executed) 01: Run (program being executed) 80: CPU Unit on standby (the start switch is OFF or the CPU Unit is waiting for a Slave Rack to turn ON). Mode (response): One of the following PC modes: 00: PROGRAM 02: MONITOR 04: RUN Fatal error data (response): The information contained in the fatal error data is shown below. Refer to the PC’s Operation Manual for details on fatal errors. Bit
15
14
13
12
0
0
11
10
9
8
7
0
0
0
6
5
4
3
2
1
0
0
0
0
0
0
0
1: FALS error 1: I/O setting error 1: I/O point overflow 1: I/O bus error 1: Memory error
Non-fatal error data (response): The information contained in the non-fatal error data is shown below. Refer to the PC’s Operation Manual for details on non-fatal errors. Bit
15
14
13
12
11
10
0
0
0
0
0
9
8
7
6
0
0
5
4
3
2
0
0
1
0
1: PC Link error 1: Host Link error 1: Battery error 1: Remote I/O error 1: Special I/O Unit error 1: I/O verification error 1: FAL error
FAL no. (response): The second byte contains the FAL or FALS number of the highest priority error that has occurred in BCD. The first byte contains 00. The FAL no. range is therefore 00 to 99. If neither an FAL nor an FALS error has occurred, the FAL no. will be 0000. Error message (response): The error message of the present FAL number. The error message will be up to 16 ASCII characters. If there is no error message, the response will be shortened.
96
Page 111
Section 6-5
CV-mode Commands for PCs
6-5-11 CLOCK READ Reads the clock. This command can be used with the C200H, C200HS, C200HX, C200HG, and C200HE PCs only. Command Block 07
01
Command code
Response Block 07
01
Command code
Parameters
Response code
Year Month Date Hour Minute Second Day
Year, month, date, hour, minute, second, day (response): Each value is expressed in BCD. Year: The rightmost two digits of the year. Hour: 00 to 23. Day: As follows: Value Day
00
01
02
03
04
Sun
Mon
Tues
Wed
Thur
05 Fri
06 Sat
6-5-12 CLOCK WRITE Sets the clock. This command can be used with the C200H, C200HS, C200HX, C200HG, and C200HE PCs only. Command Block 07
02
Command Year Month Date Hour Minute Second Day code
Response Block 07
02
Command code
Parameters
Response code
Year, month, date, hour, minute, second, day (command): Each specified value is expressed in BCD. Year: The rightmost two digits of the year. Hour: Specify 00 to 23. Day: As follows: Value Day
00
01
02
03
04
Sun
Mon
Tues
Wed
Thur
05 Fri
06 Sat
97
Page 112
Section 6-5
CV-mode Commands for PCs
6-5-13 ERROR CLEAR Clears errors from the PC. Command Block 21
01
Command code
FF
FF
Error reset
Response Block 21
01
Command Response code code
Parameters
Error reset (command): The code must be FFFF.
6-5-14 FILE MEMORY INDEX READ Reads out the indices of a specified number of blocks stored in file memory. This command can be used with the C1000H and C2000H only. Command Block 22
0F
Command code
Beginning block no.
No. of blocks
Response Block
22
Index for last block
Kind of data No. of comments
Kind of data No. of comments
0F
Command Response Remaining Total no. code code no. of blocks of blocks Kind of file memory
Parameters
Index for first block
Beginning block no. (command): The first block to be read. The beginning block no. must be between 0000 and 03E7 (0 to 999 decimal) for 1000 block file memory, or 0000 and 07CF (0 to 1999 decimal) for 2000 block file memory. No. of blocks (command): The number of blocks to be read. The no. of blocks must be between 01 and 80 (0 to 128 decimal). Remaining no. of blocks (response): The number of blocks remaining after the read. The remaining no. of blocks will be between 0000 and 07CF (0 to 1999 decimal). Total no. of blocks (response): The number of blocks in the file memory. The total no. of blocks will be between 0000 (0), 03E8 (1000), or 07D0 (2000). Kind of file memory (response): The kind of file memory installed, as follows: 00: All RAM 01: First half RAM, second half ROM
98
Page 113
Section 6-5
CV-mode Commands for PCs
Kind of data (response): The kind of data in this block, as follows: Bit
7
6
5
4
3
0
0
0
2
1
0
Kind of data (see table below) 1: Protected 1: Block contains END(01) (program data only)
Kind of data Bits 0 to 2 indicate the kind of data, as shown in the following table. Bit status 2 1 0
Kind of data
0
0
0
None
0
0
1
I/O data
0
1
0
Program
0
1
1
Comments
No. of comments (response): If the block contains comments data, this byte indicates the number of comments.
6-5-15 FILE MEMORY BLOCK READ Reads the contents of the indicated block of file memory. This command can be used with the C1000H and C2000H only. Command Block 22
10
Command code
Block no.
Response Block 22
256 bytes
10
Command Response Kind of code code data No. of comments
Parameters
Block data
Block no. (command): The block number of the block to be read. The block no. must be between 0000 and 03E7 (0 to 999 decimal) for 1000 block file memory, or 0000 and 07CF (0 to 1999 decimal) for 2000 block file memory. Kind of data (response): The kind of data in the block, as follows: Bit
7
6
5
4
3
0
0
0
2
1
0
Kind of data (see table below) 1: Protected 1: Block contains END(01) (program only)
99