Siemens RS485 MODBUS

DLMUK

Member
Join Date
Jun 2013
Location
Southampton
Posts
311
Hi,

I am trying to connect an S7-1200 using a CM1241 module to a Red Lion PAXP configured as MODBUS.

So far I have...

DB9 on connector going onto CM1241. Pin 8 as A. Pin 3 as B.
PAXP meter with PAXCDC40 configured with terminal 12 as B and terminal 13 as A.

Both set as 9600/8/N/1. I'm trying to access holding register 40001.

I cannot get a response from the PAXP device. The screenshot of TIA can be found here
https://www.dropbox.com/s/o2gk4vb44db7od4/485.jpg?dl=0

The error coming up on MB_MASTER is 8180 which the manual shows as "Invalid Port ID Value or error with MB_COMM_LOAD instruction."

My LOAD block doesn't present an error but i'm not sure what the PORT_ID value is.

Can anyone help?

thanks,
 
Port id is IW-address of card, check from hardware configuration which iw-area card have/uses. it is usually even number...
 
Port id is IW-address of card, check from hardware configuration which iw-area card have/uses. it is usually even number...

Where would that be? I have looked around and cannot see it.

I thought the input data is stored in the area specified in DATA_PTR variable of the MB_MASTER block.
 
Before you can use MB_master block, you have to init your card with MB comm load block.

Part of comm load setting are gived from instance data block of MB_com_load block (DB1 on your project?)

With MB_com_load you have to give these parameters.

First give values for these parameters:


- DB1.ICHAR_GAP = 0 (inter character delay)
- DB1.RETRIES = 1 (nmb of retries of timeout)
- DB1.MODE = 4= RS485, 2wire
- DB1.line_pre = 0
- port number = From hardware configuration
- Baud = 9600
- Parity = 2 (even?)
- DB1.Flow_Ctrl = 0 (No flow)
- DB1.Rts_on_dly = 0 (No delay)
- DB1.Rts_off_dly = = (No delay)
- DB1.Resp_to = response timeout ms (1000)

- MB_DB = DB2.MB_DB (You have only gived full block name now, it should have value MB_MASTER_DB.MB_DB!)



After this you need to reguest MB_comm load (On PLC restart, or at error)

If you get Done from MB comm load -> port is initialized with parameters and you can start your master communication

If you get error from block -> port not initialized and you need check parameters and try request again.


Siemens have example project for modbus master communication. Modbus is not easy with siemens, so you need read modbus manual retty much ;)

And if you need read, write from several slaves, then you need to give execution order for every mb_master block at different time, you can have only one mb_block called at same time.

The example project have this allready all sorted, it is coded with STL.
 

Similar Topics

Hi all, I've hit a bit of a brick wall and need some help. I'm currently trying to get a Siemens S7-1200 PLC to talk to an Eaton DE1 Drive I'm...
Replies
8
Views
3,638
I have a siemens tp170a hmi and tried just for fun, to use modicon modbus driver settings and communicate with a regin roomcontroler. I use the...
Replies
2
Views
2,082
HI All, does anyone know if you have to change a cp 341 rs232 and use a cp341 rs485, what changes have to be made to get it to...
Replies
0
Views
1,328
I currently have a RS485 full-duplex bus system with slaves running at 230k4 baud. I'm looking to connect my Siemens S7-315 2PN/DP with this bus...
Replies
9
Views
3,104
Hi, I had RS485 ASCII string going into a CP340 @ 9600baud rate. This was working fine. I had to change my baud rate to 19200 so I got ripped...
Replies
4
Views
2,480
Back
Top Bottom