AC800m RS-232 communication receive problem
Hallo,
i'm having problems receiving data via RS-232. I have connected my AC800M to my PC using RS-232 through COM 3 (there's an RS232 sniffer in between). I can write data on my PLC and the PC will receive it perfectly.
I can't receive data on my PLC from my PC (using Termite to send data), although my RS232 sniffer sees the data (so the data was send).
I'm using the standard SerialCommLib (2.3-1). 9600 baudrate, no parity, 8 bits, 1 stopbit, no flow control. Code i'm using:
i'm having problems receiving data via RS-232. I have connected my AC800M to my PC using RS-232 through COM 3 (there's an RS232 sniffer in between). I can write data on my PLC and the PC will receive it perfectly.
I can't receive data on my PLC from my PC (using Termite to send data), although my RS232 sniffer sees the data (so the data was send).
I'm using the standard SerialCommLib (2.3-1). 9600 baudrate, no parity, 8 bits, 1 stopbit, no flow control. Code i'm using:
(* Connect communication *)
IF NOT RS_232_Connect.Valid THEN
RS_232_Connect( En_C := En_C,
Channel := Channel,
Valid => Valid,
Error => Error,
Status => Status,
Id := COM3_Ch_Id );
END_IF;
(* Setup communication *)
RS_232_Setup( Id := COM3_Ch_Id,
Req := Valid,
ChSumType := 0,
ChSumLength := 0,
ChSumStart := 0,
ChSumStop := 0,
EnLineEditor := false,
EnEchoChar := false,
Done => Done,
Error => Error,
Status => Status,
ParError => ParError );
(* Write communication *)
RS_232_Write( Id := COM3_Ch_Id,
Req := bSendMsg,
EndChar := 13,
Done => Done,
Error => Error,
Status => Status,
Sd := RS232_MSG,
ParError => ParError );
(* Read communication *)
RS_232_Read( Id := COM3_Ch_Id,
Enable := bListenRS232,
MsgLength := 0,
EndChar := 13,
NoOfTrailChar := 0,
Error => Error,
Status => Status,
Rd => IncomingMessage,
Ndr => Ndr,
ParError => ParError );
Answers
When you are supposed to receive data to PLC is your PLC in Slave mode or is it in Master mode? To send Modbus RTU data to your PLC with PC then your PLC needs to be in Slave mode. Using Read (MBRead) and Write (MBWrite) function block indicates that your system is in Master mode.
Read function block requests data from the slave. This request you can see with the sniffer, then slave should respond to this request and the data is received.
Read function block requests data from the slave. This request you can see with the sniffer, then slave should respond to this request and the data is received.
by Reda Rank: 103 on 9/29/2020 5:17:59 AM | Like (0) | Report
Hi
For any communication it is clear
Communicate or not communicate
It doesn't matter in write or read
So first you should confirm that your communication is achieved if it is ok then check your logic , register , mapping and so on
by epelt Rank: 1907 on 9/29/2020 5:24:23 AM | Like (0) | Report
I thought so too. Writing works, so there is communication. I'm guessing there is something wrong with my code or I'm missing a parameter, but I can't figure out what it is.
by Reda Rank: 103 on 9/29/2020 5:39:07 AM | Like (0) | Report
Ok great
You should write the value of the channel and the Id according to your system configuration
Please share a screenshot of your hardware in CBM
by epelt Rank: 1907 on 9/29/2020 5:47:49 AM | Like (0) | Report
How can I insert image?
channel and ID should be fine, right? It's the same on my writing functionblock.
Add new comment