Graphing Asynchronous Data


Recommended Posts


We are montioring an OPC server and getting data back to DF using asynchronous read.

When displaying trend graphs this gets kind of ugly / difficult to read because if the data hasn't changed for a particular channel being trended, then the graph is "stuck in time" at the last change.

Is there any way to force the graph to move in time with the constant value so all trends are displayed with the same time base?

Thanks for any help...

Link to comment
Share on other sites

The only way to do it is to use a sequence to convert your async data to sync data (or just read the server in sync). To do this, create another channel, lets say its called GraphChannel, with a Device Type Test, I/O Type A to D and a unique Channel Number, and then create a sequence that does something like this:

   GraphChannel = OPCChannel[0]

This will cause graphchannel to get the latest value of OPCchannel every second. If you have a syncronous channel of some sort, you could do the same thing in its event leaving out the while() and delay().

Link to comment
Share on other sites

  • 3 years later...

Hi again,

I have 2 channels that are "Depth". One is Depth when a Rate of PEnetration(ROP) is created, and another Depth, when a " Lag Depth" is created. So they are definitly asynchronous.

I have an idea for a 3rd Depth, that will have Lithology associated with it, and can exist, asynchronously from the other two "Depths". As long as the 3rd depth is less than or equal to the first(ROP) Depth.

To put these 3 different Channels of "Depth" in sync, can I just turn the alignment Threshold to negative? on my 3 graphs??

I need to graph X vs Y where , the Y axis will be Depth(ROP), and X will be ROP.

and another Graph Y axis is (Lag Depth) vs Gas on the X axis.

and the 3rd graph, Depth on the Y axis vs multiple channels of Lithology on the X axis.

In other words,

If I had these 3 graphs on the same page, would the "Depths" on the Y axes of the three axes all line up coherently? If the Alignment Threshold is set to negative? Would say, for example, a Depth of 1000 feet line up horizontally on all 3 graphs, which is what I'm wanting to accomplish.

Thanks again.

Link to comment
Share on other sites

I'm a little confused, but I'll try and answer. If you are talking about lining up so, say, a depth of 500' is exactly 1.25" from the top of the page on all three graphs, etc., then you can do this simply by making sure the graphs are physically the same size, and they have the exact same Y axis scaling. This has nothing to do with the data itself.

The align threshold is used to take two arrays (channel history for example) that are taken at different rates, and have the data line up based on time. If you put a negative align threshold, then no alignment will occur. In this case, the XY plot will be done by index, meaning the first data point [0] for the X expression is plotted with the first data point [0] of the Y, and the second [1] with the second [1] etc.

The built in alignment works well when you are talking about data at different rates, but might not do what you want. What I recommend is creating two test channels (one for X and one for Y) for each of your graphs and manually filling them in, where you fill both test channels at the same time. So, for example, every time you get ROP measurement, you stick that in one of the channels, and you stick the current depth reading in the other, even if that reading is minutes old. This will result in two arrays that are exactly the same size. Then you can set the align threshold negative and just have it X/Y by index since you already did the alignment by yourself by filling these two channels.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.