I'm new to Stackoverflow.
I'm asking for any suggestion about using Zedgraph along with AdvancedHMI.
Currently I had developed a c# application that gathers "real-time" data from a PLC via Ethernet. I'm using a timer to colect data every 10ms, and hold these data into a list. After a test ends, I pass the data to MySQL db.
But sometimes the test is to fast so I'm not able to gather enough points.
So I'm asking for suggestions. Which solution is better for "real-time" graphing, a thread or a timer?
The main problem is because each test have different parameters that must be updated on the fly. Those parameters are coming form the PLC. So the steps I'm doing are the following:
- Init the Zedgraph object
- Init the timer
- Inside the timer I ask the PLC for "Labels, X-Axis (Time[ms] or Distance), etc)
- The PLC send a "validData" flag in order to plot or skip the point
- Read X and Y points
- Update the chart
I'm pretty sure that my method is awful and very inefficient, but I do not have at this time a better solution.
Thanks in advance