Justas Grinaveckis Posted April 17, 2017 Report Share Posted April 17, 2017 Hello, These days I'm having a problem using modbus to reading pressure data from TROX terminal unit. It is kinda simple idea - 7 slaves (TROX units) and V700 is master and gets all the data. But as I'm conneting modbus though all of them I get error that there is no connection between TROX units. Slaves ID are set properly, cable polarity have been checked too. Maybe there are some other problems that I don't know? Thank you kindly for answers. Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted April 17, 2017 MVP 2023 Report Share Posted April 17, 2017 There probably are other problems. Modbus works a lot better if you put a delay between requests. Post your code so we can see what you are doing. Joe T. Link to comment Share on other sites More sharing options...
Justas Grinaveckis Posted April 17, 2017 Author Report Share Posted April 17, 2017 http://www38.zippyshare.com/v/5LFX7gXx/file.html Since I can't put any files here (size is too big), I am putting link where you can download it. Delay between requests is 1 sec, is it too little? Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted April 18, 2017 MVP 2023 Report Share Posted April 18, 2017 Thank you for posting. We appreciate it! The problem is you are calling the all the Modbus reads with the same trigger and you're not checking to see if the Modbus task is busy. When you call a Modbus read block it actually spins off a separate process that takes a while to complete. It also really helps to put a little breathing room via timer between reads. I've modified your code to make a state machine cycle through the reads in order and slow it down to let the read function reset. I know the examples show chaining read blocks one after another, but my experience has been this doesn't work. You're probably going to have to update your version of Visilogic to open my file. You can fiddle with the delay times to make it go faster. You'll find that when you set them too low the blocks will hang up. Let us know how it works. Joe T. Thermofisher JT.vlp 2 Link to comment Share on other sites More sharing options...
Justas Grinaveckis Posted April 18, 2017 Author Report Share Posted April 18, 2017 It kinda works kinda not. Now I'm having problem with modbus busy MB. It holds 0 really short time and timer doesnt come off. What could possibly be wrong? Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted April 18, 2017 MVP 2023 Report Share Posted April 18, 2017 It's your turn to beat on it. This is a learning opportunity. If you're still having problems tomorrow I'll load it into a control on my end. Joe T. Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted April 19, 2017 MVP 2023 Report Share Posted April 19, 2017 If you're still having trouble here's a tip - take out 1 second pulse (SB 13) as the sequence starter and put your own start bit in for testing. Don't forget to reset it at the end of the sequence. Joe T. 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