1/5/2023 9:48 AM | |
Joined: 9/16/2016 Last visit: 6/11/2024 Posts: 10 Rating: (0) |
Hi there I am currently trying to communicate with a RS232 slave, using a CM PtP (6ES7137-6AA01-0BA0) and a 414-3 PN/DP CPU, programming in Simatic manager V5.6 + SP2 + HF5. I have downloaded PtP_Comm_V1_3 from Siemens website, and am using FB613 Send_P2P and FB614 Receive_P2P. Using "FB614 Receive_P2P" in the code below, I am able to receive date from my RS232 slave: CALL #RECEIVE_P2P PORT :=W#16#4B0 //(Input 1200) BUFFER :=P#DB1604.DBX0.0 BYTE 40 NDR :=#SERIAL_COMM.NDR ERROR :=#SERIAL_COMM.ERROR STATUS :=#SERIAL_COMM.STATUS LENGTH :=#SERIAL_COMM.LENGHT COM_RST:=#SERIAL_COMM.FIRST_SCAN The problem I am struggling with, is when i try to use "FB613 Send_P2P" I get an error and the status becomes 8281 (Negative acknowledgment when writing module) for a scan. Furthermore I have noticed an error in the Diagnostic buffer: "Area length error when reading", P area, double-word access, Access address: 16560. This error seams to come every scan cycle. Below you can see the code where I am using "FB613 Send_P2P": CALL #SEND_P2P REQ :=M20.2 PORT :=W#16#40B0 //(Input 1200) BUFFER :=P#DB1604.DBX50.0 BYTE 10 LENGTH :=W#16#A DONE :=#SERIAL_COMM.DONE ERROR :=#SERIAL_COMM.ERROR STATUS :=#SERIAL_COMM.STATUS COM_RST:=#SERIAL_COMM.FIRST_SCAN Is the buffer input parameterized correctly or do I have an error in my HW config or with my wiring? I have struggled with this for a few days now, so any help is very much appreciated. Thank you! |
Last edited by: Jen_Moderator at: 01/05/2023 11:05:06Link optimized. |
|
1/5/2023 11:25 AM | |
Joined: 9/16/2016 Last visit: 6/11/2024 Posts: 10 Rating: (0) |
I have attached a picture of datablock 1604 with an array of bytes [0..80]. |
Follow us on