MarioGS Posted October 23, 2019 Report Share Posted October 23, 2019 (edited) Hi I have invested a lot of time without succes to comunicate a US7-B10-RA28(+ module UAC-CX-01RS4) with a ultrasonic device( modbus RS485 ). I want to read holding registers (40001 to 40016). The manufacturer of device recommend to read the holding register (03) ( 40001 to 40016), I did this with unilogic software but without succes¡ In Global Tags show: Modbus Slave Status: 3 Could help me ? I do not Know What is the error? Edited October 23, 2019 by MarioGS Add Config Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted October 24, 2019 MVP 2023 Report Share Posted October 24, 2019 Change the address to 0. Here's why- Modbus holding register addresses are designated as 4xxxx. When you enter the address in UniStream as above, the "4" is implied. In the original Modbus specification, the register count starts at 40001, which is the first holding register. Unitronics reads the actual memory of the device, which starts at 0. Different manufacturers use different conventions for Modbus, either 1 or 0 based. It looks like yours is using 1, so you have to subtract 1 from each address. As I've said before, this is all confusing to a new user. Verify your port parameters - 8N2 is rather unusual. It's usually 8N1. Did you define your tag "Status Generator" as a 16 element array? Joe T. 1 Link to comment Share on other sites More sharing options...
MarioGS Posted October 24, 2019 Author Report Share Posted October 24, 2019 Hi Joe Thanks for your kind answer ¡ I made a test as you recommend but not succesfull. Please see pics. a. Recommendations Manufacturer of device to use Modbus to read Holding Register b. Results of Test: Status of remote slave c. I change Status Generator UINT16 by an Array 16 (UINT16) Thanks again MGS Link to comment Share on other sites More sharing options...
MVP 2023 Ausman Posted October 24, 2019 MVP 2023 Report Share Posted October 24, 2019 Mario, before you go any further I suggest you get something like Modbus Poll and run it on your PC, with the PC connected directly to the device. This way you can easily throw all sorts of Modbus requests and variations at the device and eventually find the correct numbers and addresses for what you want. Once you have this info, found in this far easier and quicker way, you then know exactly what you have to incorporate into your program. As Joe has pointed out, modbus can be terribly confusing, especially in handling a new device that may possibly not match what you expect. Finding all your relevant parameters before your plc work is very beneficial, and in essence is a must-do. Edit: not being rude to anyone, but equipment coming from China often has serious translation errors in information sheets. I often find totally different things achieve the required result. Doing it via the PC lets you throw all sorts of things at the device to see what comes back. This can be a little tedious, but is far easier than trying via the plc. The saying above for stop being 2 bit I would treat very dubiously, and actually try 1. It might be true, but might not. Again, this is very easily changed on the PC during your trials! cheers, Aus Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted October 25, 2019 MVP 2023 Report Share Posted October 25, 2019 Your ID address reads as value 0. That should be something you set on your device, and it usually defaults to 1. This can be a problem, as 1 is usually reserved for the master and I start numbering slaves at 2. There is a conflict in the supplied information on your sheet - it says 40001 to 40016 and the address zone is 0x01 to 0x0F. 0x0F hex is actually decimal 15, so this is clearly an error. Try putting a 2 in the ID Address (which is the Master), reading address 1, and changing Status Generator back to a single dimension tag. Let's just try to read one thing to establish communication. Also post your program so we can look at the whole picture. Often there are things deeper in the configuration that beginners miss. You've only posted a couple of pictures of what you're doing, not everything that could cause a problem. Joe T. Link to comment Share on other sites More sharing options...
MarioGS Posted October 25, 2019 Author Report Share Posted October 25, 2019 Hi Thanks for you kind answers ¡ I have tried with Modbus Poll but there is not communication¡ Timeout error. At the beggining of my application I test with a Tag Status generator UINT16 and Slave ID "1" but without communication. The manufacturer of device said that ID by default is 1¡ That ID is in a Holding Register, 40009. The master of application is the unistream, as I said before, but I think is not necesary to config an ID for it? or YES? Do I need to config the master with a ID? I want to stablish a basic communication reading a Only Holding register, 40001, and after the others. I show some pics of my config as attach I have appreciated all comments, thanks again. Link to comment Share on other sites More sharing options...
MVP 2023 Ausman Posted October 25, 2019 MVP 2023 Report Share Posted October 25, 2019 Be aware that if you try to access multiple registers in Modbus Poll and the device doesn't use the entire range specified, it will do a timeout. You need to try different single registers in all the different Function types to try and get some sort of response from the device in the first place. Once you have achieved that, you can start building on the knowledge by then trying multiple register reads etc. Eventually you will get the full picture by relating what you are getting back to what is specified in the manual. In those specs, I see that the comms address 40009 is listed as only 1-15. So I'd start with trying on slave ID 1. I have also had chinese based thingamyjigs that I can never talk with in the first place, no matter what I do, as they default to ID 0. They have a special program that sets the com address, and even this has been a nightmare to navigate at times. But once you have changed it away from 0, access is easy. Ensure that this device does not need that. To me you still need to be using the PC initially as an easy way to get the basics. cheers, Aus Link to comment Share on other sites More sharing options...
MarioGS Posted November 5, 2019 Author Report Share Posted November 5, 2019 Hi Thanks Joe and Ausman for all your comments¡ I made test with your recommendations but there is no communication: The manufacturer sent to me an HMI, made by Weinview- WeinTek, configured to read the Holding Register and It works¡ My project is to use Unistream to read Holding Register as I said before. Then I made a reverse engineering downloading the configuration of that HMI and found that Addresses of Holding register are 6x, where x are 0 to 15. Check image of this. I am using modbus poll to try understand the problem. How can I read addresses like 6x? The Chinese manufacturer of HMI call to this config Modbus RT adjustable. Unitronics read Holding Registers 4x, modbus poll too. Comments, suggestions are welcome Thanks and Regards Link to comment Share on other sites More sharing options...
AsaGong Posted March 2, 2021 Report Share Posted March 2, 2021 Hi...If you want to do error handling on the comms you should probably switch from using Channels and Timing to using a little script. You can still use Channels to store your data, but you would use a little script to collect the data. pcb assembly quote Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now