kanber Posted April 27, 2022 Share Posted April 27, 2022 Hi, I have 5 machine communication with modbus tcp. Every machine has 185 tags. when all machine is only communication is normal. but when customer close 3 or 4 machine modbus trying to get tag information and waiting for time about. because of that online machine data updating very very slow. Is there any solution for that? Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted April 27, 2022 Share Posted April 27, 2022 Do you have the 5 machines on the same Timing / Offset? With TCP you can put each machine on a different Offset which will force them onto a different thread. That should keep one machine that is down from holding up the others. The other option is to add some script to disable machines that are down. How you do that depends on how you are polling, script vs channel Timing. Quote Link to comment Share on other sites More sharing options...
kanber Posted April 28, 2022 Author Share Posted April 28, 2022 Yes, timing = 1 / offset=0 I will change it for machine 1 offset =0.01, 2=0.02, 3=0.03, 4=0.04, 5=0.05. Am I correct? I added a script when timeout I change 184 channel timing=0, only one channel timing is 1, if communation is online ı set all other timing to 1. Because I need at least one channel to understand when communication online again. Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted April 28, 2022 Share Posted April 28, 2022 Yes, that is what I am proposing. There are a couple alternatives: 1) you can put the inputs from each machine in its own channel group, then use a little script to trigger the reads using channel.readGroup(): while(1) channel.readGroup("myGroup1") delay(1) endwhile You could create a sequence for each group. Or, you could create a variable that enables/disables each group: while(1) if (myGroup1Enabled) channel.readGroup("myGroup1") endif if (myGroup2Enabled) channel.readGroup("myGroup2") endif delay(1) endwhile It'd be more efficient though to have each group in its own sequence, even if you added the ifs(). This is because you are TCP and DAQFactory can communicate with each simultaneously. If you were in multidrop serial (i.e. RS485), either locally or via TCP through a serial to ethernet converter, then this wouldn't work because the hardware would limit you. Note that you could make the myGroupEnabled variables manually controller, or automatically disable if there is no comms by looking at the timestamp on one of your channels and comparing it to systime(). You could even go so far as change the rate, for example, poll a group at 1 second interval if all is well, but if it times out, switch to 60 second interval until it comes back online. Really it is up to you, and what is best depends on your use case, which is why DAQFactory doesn't do it automatically. It just keeps retrying. Quote Link to comment Share on other sites More sharing options...
kanber Posted April 29, 2022 Author Share Posted April 29, 2022 Yes all machine has own group channel. But if I use readgroup function how I will stop reading continuously. because they are alreday on channel list. Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted April 29, 2022 Share Posted April 29, 2022 It should be in the channel list, but set the Timing to 0 on any channels you are going to use readgroup() on. Then it will only read when you tell it to. 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.