Jump to content

How can I convert DI/DO read as 16-bit words to coil status with Modbus 485?


Recommended Posts

Hello,

a customer is trying to read inputs and outputs on a Samba PLC using Modbus RS485. 
They are using a Siemens Simantic S7 ET200 PLC to do so. But it can only read coils in range 0-9999.
The Samba digital outputs start from 16384 (4000h) and the digital inputs from 24576 (6000h).

image.png.a340e42f044e1c7f2b5b88172b932e8a.png

The only thing they can read in the range above 9999 is 16 bit words with Modbus function 04.

The question is, how can they get the coil status information they need from the 16 bit word? Does anyone have a clue how to solve this? Comment from the customer below.

"That means we have to split the word with 16 bits into its individual bits and speculate if these individual bits contain the desired information that we need. 

Where is the start address? Let's start with the address as you specified at 24576 and read in a data length of 10, With the normal approach, this would be the addresses 24576-24585 as bit operands, i.e. 10 individual bits. 

Let's read it in as input words  and start at 24576 with a length of 10, this would also be the addresses 24576-24585 as words with 10x16 single bits.

 The problem for us now is where exactly is the information we need? Can we assume that the first 10 bits of the first word from address 24576 onwards also correspond to the bits you specify or every first bit of each word is the bit that contains the information?"

Any help would be appreciated.

Best regards Peter

Link to comment
Share on other sites

  • PeterFukt changed the title to How can I convert DI/DO read as 16-bit words to coil status with Modbus 485?
  • MVP 2023
5 hours ago, PeterFukt said:

But it can only read coils in range 0-9999.

As i see in siemens pdf - coil address is W#16  register - then it can be from 0000 to FFFF in hex.

Maybe issue is with correct numbering in modbus - 0 in unitronics +1 in standard modbus?

Please check this.

Link to comment
Share on other sites

  • MVP 2023

I've never used Siemens and don't know this PLC.  I don't know how they're trying at present, but it would appear they would have to be using a dedicated comms module.....ET 200SP, CM PTP.  If they're doing it somehow else which is perhaps native on the main cpu itself, then perhaps they could put in one of these modules.

Here's a scrnshot of what I see as very relevant from the module manual.  It looks like it should work RTU immediately.

cheers, Aus.

RTU.jpg.731797156a978825adfb8e6cb8a0468e.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...