TIA V14 - S7-1212C Modbus RTU Master Issue

Hal9000

Member
Join Date
Jun 2010
Location
London
Posts
140
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 CM1241 communication module.

I have a partially working system. I have appear to have an issue with reading data more than 1x register from my Modbus slave device.

If I read say:

DATA_ADDR: 40013
DATA_LEN: 1

It works fine (I get a value back from the slave) but if I increase my DATA_LEN to > 1, then I get Rx/Tx flashing normally but no data back and I get the following error code:

818D

This doesn't appear in any help file!

I'm using the following set-up:

TIA-Portal V14
S7-1212C fw: 4.2
CM1241 (RS485)

I've configured my modbus_comm_load (V3.0) and my modbus_master (V2.4) as per the application example.

I also observed that if I increase my DATA_LEN to say 32, the TX/RX LEDs stay on for a greater length of time, which implies that the slave is actually responding to the request and maybe the PLC code isn't managing the data correctly. Are there any special DB settings I need to be aware of? The application example states "Optimized block access" is disabled (which I have done).

Also, if I run Modbus Poll I can read the required data without any issues. My Modbus poll scan rate is set to 1000ms. I don't seem to have an equivalent scan rate setting in TIA-Portal that I can adjust.

Any help or advice would be greatly appreciated.

Regards,

Justin
 
From 1500 modbus manual, page 108
https://www.google.fi/url?sa=t&rct=j...LH9X6g&cad=rja

16#818D
The area addressed by DATA_PTR is longer than the
DB, or the area addressed is too small for the number
of data bytes to be read or written.
Check the DATA_PTR pointer

So it look like you have only one variable for data buffering on DB-block
Have you SF error led lighted?

Data pointer also need to be correct lenght parameter (P##DB0.DBX0.0 BYTE 10 (= 5 Words)
 
Last edited:
Hi Lare,

Ok, it's working now. I had got my self confused with using a P# pointer.

DATA_ADDR: 40001
DATA_LEN: 32
DATA_PTR: P#DB3.DBX56.0 INT 32

This successfully reads 32 registers from 40001 and places them into DB3

Thanks again you have saved me a lot of pain.
 

Similar Topics

Had a project a few years back done in v14 of TIA. Very similar job has come up for the same company with different PLC and HMI hardware. I...
Replies
1
Views
239
Hello PLC Friends, I'm starting my final year project with a given rig and I'm thinking about incorporating a remote access feature where I can...
Replies
2
Views
371
Hi everyone. Please help me to upload program from S7-1200 with TIA v14. I created new project, go to Online tab, select Upload devices as new...
Replies
0
Views
1,087
I am beatin gmy head against the wall trying to get my modbus comms working. I have a s7-1200 running tia v14, a cm-1241 comm card. I have...
Replies
22
Views
7,408
I am trying to commission a compressor that is using a s7-1200 to communicate rs485/modbus to a the compressor interface. My rs485 module is a...
Replies
2
Views
1,704
Back
Top Bottom