Differences between revisions 1 and 6 (spanning 5 versions)
Revision 1 as of 2018-02-01 16:19:02
Size: 591
Editor: YoichiAso
Comment:
Revision 6 as of 2018-02-01 16:35:19
Size: 1585
Editor: YoichiAso
Comment:
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
For example, if you want to read registers in M1300 - M1363, you need to add the following entry to "kagraMpsArray.proto". For example, if you want to read registers in M1300 - M1363, you need to add the following entry to `kagraMpsArray.proto`.
Line 10: Line 10:
M1000-M1063{ M1300-M1363{
Line 15: Line 15:

The `out` directive specifies what message to be sent to PLC. The `in` directive specifies how to interpret the response from PLC.

Details of the message format is explained in the MELSEC communication protocol reference manual, which you can find in Doc/MELSEC/ of PLC directory.

=== Important points for `out` ===

Treat "500000FF03FF000018001004010001M*00" as a prefix for M registers. For D registers, use "500000FF03FF000018001004010000D*00" instead.

Following "13000040" can be divided into 4 digit groups. "1300" specifies the start address of the register range to be read. "0040" is the number of registers to be read in hexadecimal. So 0040 corresponds to 64 channels.

=== Important points for `in` ===
Again, "D00000FF03FF00" is a prefix. The following "0044" is the hexadecimal representation of the number of bits for the returned data + 4. For 64 bit data, hex(64+4)=0044 should be used. After that, use "0000%1X" for M registers and "0000%04X" for D registers.

How to access arbitrary PLC registers from the EPICS translator ?

To read PLC register values, kagraMpsArray.db is used to define array records to hold the register values. For writing into PLC registers, kagraMpsOut.db is used.

In order to add entries in those db files, you need to edit proto files in base-3.14.12.2/protocols/ directory.

For example, if you want to read registers in M1300 - M1363, you need to add the following entry to kagraMpsArray.proto.

M1300-M1363{
out "500000FF03FF000018001004010001M*0013000040";
in "D00000FF03FF0000440000%1X";
}

The out directive specifies what message to be sent to PLC. The in directive specifies how to interpret the response from PLC.

Details of the message format is explained in the MELSEC communication protocol reference manual, which you can find in Doc/MELSEC/ of PLC directory.

Important points for `out`

Treat "500000FF03FF000018001004010001M*00" as a prefix for M registers. For D registers, use "500000FF03FF000018001004010000D*00" instead.

Following "13000040" can be divided into 4 digit groups. "1300" specifies the start address of the register range to be read. "0040" is the number of registers to be read in hexadecimal. So 0040 corresponds to 64 channels.

Important points for `in`

Again, "D00000FF03FF00" is a prefix. The following "0044" is the hexadecimal representation of the number of bits for the returned data + 4. For 64 bit data, hex(64+4)=0044 should be used. After that, use "0000%1X" for M registers and "0000%04X" for D registers.

KAGRA/Subgroups/MIF/PLC/EPICS/RegisterAccess (last edited 2018-02-01 16:35:19 by YoichiAso)