PeterFukt Posted May 3, 2021 Report Share Posted May 3, 2021 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). 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 Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted May 3, 2021 MVP 2022 Report Share Posted May 3, 2021 You should be able to use a Vector Struct function block for this. Quote Link to comment Share on other sites More sharing options...
PeterFukt Posted May 3, 2021 Author Report Share Posted May 3, 2021 Thank you for the reply. What I meant was how they can read the inputs and outputs. The customer nor I wish to make a change in the program so we are hoping they can somehow get the coil status from the 16 bit work somehow. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted May 3, 2021 MVP 2022 Report Share Posted May 3, 2021 Use VisiLogic to go online with the PLC and inspect the values of the registers. Quote Link to comment Share on other sites More sharing options...
sgull Posted May 3, 2021 Report Share Posted May 3, 2021 Under the Vector tab you can use the bit to numeric or numeric to bit. For the source of the function you can select inputs or outputs. Quote Link to comment Share on other sites More sharing options...
MVP 2022 kratmel Posted May 3, 2021 MVP 2022 Report Share Posted May 3, 2021 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. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Ausman Posted May 3, 2021 MVP 2022 Report Share Posted May 3, 2021 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.