modbus comm errors


kkoen

Recommended Posts

Hi there,

Thanks for the support i received in the past, I have a few years of positive experience with azeotech.

In my current project i deal with a modbus device.

Reading the registers works ok, I have a channel for each register I want to read and have them all set at 0.1s interval.

Now, I also need to set some registers and I made a small sequence for that.

the button ' zero displacement' invokes this sequence.

the registers I want to set all have their own channel as well.

This works but only sometimes...

with reading every 0.1s I get lots of ' port locked' errors.

I quess that i need to pauze the reading for a moment to make room on the bus for setting the appropriate registers.

Could you give me a hint on how to solve these issues?

Thanks,

Koen

for legacy reasons, I run this file in DAQfactory 5.87c

 

DirksonWTB_22kN_v1.ctl

Link to comment
Share on other sites

Yes, at 0.1 seconds there may not be any space between the queries to allow for an output.  One way to resolve this is, as you said, to pause the reading.  You can do this by moving the timing of the reads into script.  To do this, put all the input channels into their own channel group, say "Input", and set the Timing of them to 0.  Then create a sequence.  The script would simply be:

while(1)
   channel.readGroup("Input")
   delay(0.1)
endwhile

When the sequence is running, it will query the inputs.  When you stop it, it will stop querying the inputs.  Use beginseq() and endseq() from script to do this.

Link to comment
Share on other sites

Yes, that works! Only thing is that since the channels are in two different groups now, I can no longer open the channel to see the graph or table view. I can only open the list of channels with all their properties. This is only necesary for debugging, and maybe it has to do with the older DAQ version?

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.