Writing setpoints via channels

Recommended Posts

I have an application running where, probably due to Ethernet traffic levels, occasionally setpoint channel writes to a Modbus PLC are not completed on the first try.    I'm setting the channel value in the UI object where the user inputs the setpoint.

I often do user setpoint writes via a direct device call in the UI object where they make the setpoint, and in that case I might just repeat the write after a small delay.

In this case, where I'm writing to a channel, if I write to the channel again with the same value, will it do the comms again or is the channel table aware enough to only do writes on an actual change in channel value?

Also, I'm definitely open to any other ideas on diagnosing the problem or remediating it.



Link to comment
Share on other sites

DAQFactory will send the same value.  It doesn't look at the current value, because there are many cases where that is a bad idea.  Personally when I run into these issues I usually will create a buffer of output values to set, then go through the buffer in a separate sequence, usually the same one that is doing the input.  That way I can control it.  It also allows me to do automatic retry as I can then catch the failure (instead of Channel's quiet fail).  It is much easier if the hardware supports a readback of the output, then I can just read the readback and compare it what I think the value should be and do an update if necessary.

Link to comment
Share on other sites

Yeah, that's what I would actually like to do (compare to the readback, which I actually poll anyway), but the sequence is in the UI, so I don't want to lock it for too long, and a major rewrite to make it a background task is bigger than I have time for.   I'll probably just do a double write, trusting that that will catch 99% of the missed cases.  Could do it in the UI quick sequence and do a system pump each iteration I guess.

Link to comment
Share on other sites

The easiest way to do it is to change your output channels to Test D/A (or dig out), then set the Event for each channel to add to your queue.  Then create the sequence to monitor the queue.  This would eliminate having to go through every UI element and update them for the new method.

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.

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.