Modbus RTU in TIA Portal

Puddle

Member
Join Date
Mar 2022
Location
UK - The Norf
Posts
332
I'm trying to communicate with a heating controller over Modbus RTU (RS485) but I'm running into the common issue of having no Rx light.


S7-1200 CPU, CM1241. Heating controller is an Ascon K85, coms manual here:
https://arxivar.ascontecnologic.com/Default.aspx?doctype=MAN.INSTALLA&Testo179_1=P_K-Series_E_--


I'm just using the MB_COMM_LOAD and MB_MASTER blocks, with the master in a cyclic interupt OB because the TIA helper said it should be.


Wiring connection is Pin 8 to terminal A, Pin 3 to terminal B and Pin 1 to GND. 120ohm resistor in place between A and B.



In the coms manual for the heating controller it says to use function code 3 to get to what I need, which is the first holding registers on page 13, so I've used mode 0 and started my address at 40001.
I've tried reversing the cable connections and got two flashing amber lights.
I've tried several different addresses such as 1, 10001, 40513 etc.



Tx is flashing, Rx is not. I can see my comm load is done but my master block is busy, so I'm either sending it to the wrong address or I've connected it wrong?
 
Couple of things.


On the Siemens end, TxA and TA should be jumped, same for TxB and TB.
Inside the DB, make sure your mode is correctly set. I believe you need 4 indicating two wire.
Also double check baud rate etc.
Just for giggles, reverse the wires. It is like USB, you will always have to change it at least once, most often twice.
Try to read first, only one register.



The Siemens examples are fairly good. So are their error codes.
 
Couple of things.


On the Siemens end, TxA and TA should be jumped, same for TxB and TB.
Inside the DB, make sure your mode is correctly set. I believe you need 4 indicating two wire.
Also double check baud rate etc.
Just for giggles, reverse the wires.


This is a CM, so DB9 connector. I'm just using a normal serial cable that I've spliced into and checked for continuity to track each pin to a core. I've tried connecting up pins 2/3 and 8/9 together but no difference.


I've just checked the mode and when I first started I used the Modbus blocks, from the MODBUS (RTU) communication menu. This allows you to set the mode to 4. I've just realised that I've changeed to the MB blocks from the MODBUS menu and the comm load block does not have a mode option. I have set it correctly in the device configuration though.


Baud rate says 38.4 on the controller, so 38400 in the program.


I have reversed the wires, I get both Tx and Rx flashing amber. While I haven't found anything in any manual to tell me what the light patterns mean, I'm going assuming this is not a good sign.
 
Mobus Slave ID Byte

The slave ID must be set to match on both ends. Typically ranges from 1 to around 247. It is sometimes ignored for Modbus TCP Ethernet but in my experience it is always used over serial.
 
The slave ID must be set to match on both ends. Typically ranges from 1 to around 247. It is sometimes ignored for Modbus TCP Ethernet but in my experience it is always used over serial.


Slave is set to be address 10 on the unit and MD_ADDR parameter is set to 10 (in decimal, I checked).
 
Do you get an errorcode on the mb-master block?


It shows busy, then eventually pops up a timeout error.



Have you initialized RS-port for modbus coms succesfull with MB_load-block?


The MB_COMM_LOAD is showing my coms module on port 269. As I'm getting at least the Tx light to flash I'm thinking that looks alright.




I've run a modbus scan using the LMRTU method and not found any slaves on the network at all, which means it's probably my wiring. I'm only using 3 cores and I've checked the configuration against the spec several times.
 
Problem solved. I used a USB to RS-485 lead and some modbus slave simulation software to prove the wiring and this worked fine.


When I've changed back to the heating controller everything has sat up. There's only two differences I can see:


-Wiring is now going through a connector block with no resistor
-Address number 1 is 40002, not 40001. I swear I checked this but maybe I had a different error in my program when I did.
 

Similar Topics

Hi! I communicate with an onboard communications board modbus RTU. I communicate with 5 VFDs (Parker AC10) and each has 4 calls of MB_Master. So...
Replies
19
Views
8,095
I have siemenns S7-1200 cpu and TIA V13 i have to create a apparatus which will be used to monitor pressure inside some test enclosures it...
Replies
7
Views
3,053
Hi there, I'm using an S7-1200 system and I have followed a Siemens application example to read/write data to 1x slave using Modbus RTU and a...
Replies
2
Views
4,188
Hi All. Could you please help me with this Modbus I've been trying to set up for the last 10 weeks!!! I have an VIPA CPU314SC and trying to...
Replies
1
Views
2,058
Dear All, i am trying to connect Danfoss inverter with s7 200 cpu 226.but microwin shows following error at DATA Ptr.i assigned different VB...
Replies
1
Views
50
Back
Top Bottom