Contatto
MCP 4 – User's manual
DUEMMEGI
9- FXP-XT COMMUNICATION PROTOCOL
9.1- Messages format ad meaning
The proprietary protocol implemented into MCP 4 is named
FXP-XT
protocol; this protocol, has been
specifically developed to interface MCP 4 to external world (PC, PLC, etc.) and it is
NRZ with 1 start bit, 8
data bit, no parity, 1 stop bit
. The baud rate can be selected as follows: 2400, 4800, 9600, 19200, 38400,
57600, 115200 baud.
MCP acts as a slave unit
, then it only answers to the requests of a HOST device.
In the following, the numerical data represented with the
0x
notation are intended to be in the hexadecimal
format.
The messages between MCP 4 and HOST have the following format:
Address
Code
#Byte
Data 1
.......
Data N
ChkSum H
ChkSum L
Where:
Address
: 1 byte, node address of MCP 4; the address 0x00 is valid for any node address
Code
:
1 byte, it specifies the function of the message
# Byte
:
1 byte, number of bytes in the following data field
Data 1
N
N data bytes
ChkSum
: 2 bytes (high, low) of checksum, equal to the complemented sum of the message
bytes, including the address, the code and the number of bytes.
The available messages are:
HOST to MCP requests
Code
# Byte
Data Bytes
Description
0x7F
4
Add_U, Add_H, Add_L, N
Reading from RAM memory of N bytes
(1
255), starting from address specified by
the first 3 data bytes. N=0 means reading
of 256 bytes.
0x7E
5
256
Add_U, Add_H, Add_L, N, Data1…
DataN
Writing to RAM memory of N bytes (1
252)
starting from address specified by the first 3
data bytes. (Note 1)
0x7D
4
Add_U, Add_H, Add_L, N
Reading from microcontroller memory of N
bytes (1
255) starting from address
specified by the first 3 data bytes. N=0
means reading of 256 bytes. (Note 2)
0x7C
5
256
Add_U, Add_H, Add_L, N, Data1…
DataN
Writing to microcontroller memory of N
bytes (1
252) starting from address
specified by the first 3 data bytes. (Note 2)
0x7B
2
Mod_Add, N
Reading of N (1
32) output modules
starting from module address Mod_Addr.
0x7A
2
Mod_Add, N
Reading of N (1
32) input modules starting
from module address Mod_Addr.
0x79
6
Mod_Addr, Ch, Status_H, Status_L,
Mask_H, Mask_L
Writing of a channel (Ch = 1
4) of an
output module (Mod_Addr=1
127). The
mask (bit set to 1) identifies which output
points have to be modified.
0x78
3
V_H, V_L, Status
Virtual point writing. V_H-V_L is the point
number (1
2032), Status can be 0x00 (for
Vx=0) or 0x01 (for Vx=1).
0x70
2
‘ID’
ID request. The data field contains the
ASCII code of the two characters ‘I’ and ‘D’
(therefore 0x49 and 0x44).
Note 1:
If a writing operation modifies an output, a virtual point, a register, a counter, etc., then the command will be executed when the
less significant byte of the Word is written, while no command is executed when writing the most significant byte of the Word.
Note 2:
To read/write the EEPROM memory of MCP4, the messages 0x7D/0x7C with address starting from 0x7FF000 have to be
used.
Page 54 of 87
Rel.: 1.2 October 2018
DUEMMEGI
s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/55213686 –
www.duemmegi.it