TimothyMoulder
Member
This should be a good one.
Within my plc (unitronics V280), I am collecting data, and every 60 seconds, I cache this data to a buffer (11 integers total).
I want to poll this cached data every 60 seconds via OPC (matrikon modbus plant-based) and stash it in a database.
I'm trying to do this asynchronously, meaning no timing exchanges between the controller and the PC running OPC software. Hence the cache buffer, so data remains stable until picked up by OPC.
Here's the catch (catche?) : If my OPC is reading the data from the controller at the same time the controller updates the buffer, I get half of one record and half the next. At least in theory.
Now, I've rolled this around in my brain for quite a while. Thought about synchronizing clocks, but too unreliable. Thought about setting a "flag" bit in the PLC telling OPC to "come and get it", but that's not true to the spirit of asynch was trying to achieve. Also thought about some additional buffering scheme, but since everything depends on 60-second time frames that just moves the problem to the last entry in the buffer.
Ye cats, I'm confuzzled. And I know I can't be the first person to run into this sort of bufferring issue. So what sorts of magic have you PLC wizards used in the past to overcome this obstacle?
Thanks!
TM
Within my plc (unitronics V280), I am collecting data, and every 60 seconds, I cache this data to a buffer (11 integers total).
I want to poll this cached data every 60 seconds via OPC (matrikon modbus plant-based) and stash it in a database.
I'm trying to do this asynchronously, meaning no timing exchanges between the controller and the PC running OPC software. Hence the cache buffer, so data remains stable until picked up by OPC.
Here's the catch (catche?) : If my OPC is reading the data from the controller at the same time the controller updates the buffer, I get half of one record and half the next. At least in theory.
Now, I've rolled this around in my brain for quite a while. Thought about synchronizing clocks, but too unreliable. Thought about setting a "flag" bit in the PLC telling OPC to "come and get it", but that's not true to the spirit of asynch was trying to achieve. Also thought about some additional buffering scheme, but since everything depends on 60-second time frames that just moves the problem to the last entry in the buffer.
Ye cats, I'm confuzzled. And I know I can't be the first person to run into this sort of bufferring issue. So what sorts of magic have you PLC wizards used in the past to overcome this obstacle?
Thanks!
TM