Jhav Posted April 17 Report Share Posted April 17 All, I have one multiscale indicator that has 2 scales that i am trying to read through one Modbus connection by switching the command number to witch scale i need. the problem is i connect, write, and read the command for scale one, then i close the connection to the socket and let it cool for .4 seconds ive even tried up to 1 sec. then i connect and do the same for scale 2. they both are reading and writing to separate vectors and addresses but i get a bleed over reading from scale one onto the scale two and vice versa. i do not know how to resolve the issue. ive set is to where the read and write command are disconnected when the opposite scale is writing and reading. I've put program below, any advice would be appreciated. scale switching.vlp Quote Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted April 17 MVP 2023 Report Share Posted April 17 Why are you trying to communicate with two different devices through the same socket? Use two different sockets, one for each scale - then you don't have to waste time connecting and disconnecting. Quote Link to comment Share on other sites More sharing options...
Jhav Posted April 18 Author Report Share Posted April 18 Flex727, thank you that is the obvious solution. for some reason since they share the same IP address i had it in my head that i had to use the same socket, and i would just send 2 different commands. i will write it with 2 sockets. Quote Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted April 18 MVP 2023 Report Share Posted April 18 35 minutes ago, Jhav said: they share the same IP address That's your problem - you can't have two devices on the same network with the same IP address. Quote Link to comment Share on other sites More sharing options...
Jhav Posted April 18 Author Report Share Posted April 18 Flex, I was looking at it as one device. A Multi scale indicator talking through one modbus card using the the same ip just switching over write commands to choose which scale to talk to, but im just going to use another Modbus connection which requires purchasing another modbus card. Quote Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted April 18 MVP 2023 Report Share Posted April 18 This makes no sense to me. If you were communicating as though it was one device, then why was it necessary to close the connection between MODBUS commands? Quote Link to comment Share on other sites More sharing options...
Jhav Posted April 18 Author Report Share Posted April 18 Quote Link to comment Share on other sites More sharing options...
Jhav Posted April 18 Author Report Share Posted April 18 im sending 2 different commands one command for each scale indicator. i though i would have to close the socket when and give it time to rest between switching commands ? Quote Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted April 18 MVP 2023 Report Share Posted April 18 This looks to me like a single device and you choose which scale reading via MODBUS command. I see no reason to close the connection, once established, nor any reason to use two sockets. I'm not familiar with these scales so I may be misinterpreting something. You can choose the timing between commands without closing the socket. Quote Link to comment Share on other sites More sharing options...
Jhav Posted April 18 Author Report Share Posted April 18 Flex, thank you that does clear up a lot. this is a new scale we are using. One Indicator with multiple scales so it had me kind of mixed up. we normally use one scale head per device and everything gets it own set up. thank you for taking the time to work me through that. Quote Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted April 18 MVP 2023 Report Share Posted April 18 Good luck! 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.