FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I plot elapsed time vs multiple Fieldpoint channels

I've had an open support case on this subject for few months now. NI can't seem to solve the problem.

I have multiple FieldPoint channels that I would like to monitor and plot versus elapsed time. I've created an elapsed time counter and would like to plot the elapsed time on the x-axis of a graph (or chart, I haven't been able to determine the correct one) versus the other 8 or so channels on the y-axis.

I've been back and forth with email and phone support, but no one seems to know how to do this. I'm sure I can't be the only one trying to do this.

I've attached a zip file that contains what I would like the graph to look like and a vi with where I'm at so far. The sub-vis simply scale the values coming from the FP channels.

Thanx for the help.
0 Kudos
Message 1 of 8
(4,609 Views)
I don't see the zip file. Could you re-attach?
-Alan A.
0 Kudos
Message 2 of 8
(4,595 Views)
I attached the file before, hopefully it comes through this time.
0 Kudos
Message 3 of 8
(4,590 Views)
Scubadude,

I put together a simple example vi for you to take a look at. I don't have any fieldpoint hardware, so I used the simulate signal express vi to mimic acquired data. What I used is a chart (rather than a graph) with the x-axis set to relative time. If you take a look at the properties of the of the chart, you should be able to set yours up similarly and get the same plot. Of course, that depends on your scaling from your subvis being correct (I didn't use them in mine, obviously). I hope this helps you out!

Tyler S
0 Kudos
Message 4 of 8
(4,567 Views)
TylerS,

That seems to work well when you're not mixing Dynamic Data with simple scalars. After about 10 emails back and forth to NI, they supplied me with this fix. It works, but I needed to add an elapsed time based on tick counts in addition to their elapsed time based on 'time'. This was so I could more easily store the data in an Excel file.

One of the primary thing I've figured out (from your post and their's) is that you seem to have to have some unit of "TIME" on the x-axis for it to look correct. Is this true? I simply wanted to plot a scalar on the x-axis, but the chart or graph would not do this.

Here is what they sent me. It seems like an awful lot to go through to get the correct looking graph though.
0 Kudos
Message 5 of 8
(4,559 Views)
Scubadude,

I guess I don't completely understand what you want the x-axis to look like, but if you are concerned about plotting numeric data with some sort of timing, then you have to actually add the timing into the numeric signal to make a waveform. Put another way, a simple numeric, such as the random number generator, has no timing associated with it. In order to plot this on a chart or graph with some meaningful time associated with it, you need to combine the numeric data with some sort of time signal to create a waveform, which can them be plotted.

If you want to create your own x-axis, maybe the XY Graph would be useful for you. This basically plots one array against another array, and you have complete freedom to specify the contents of those arrays.

I'm attaching an example program from our website that shows another way to apply relative time to the x-axis of a chart. Here is the documentation that came with the example:

"This simple example demonstrates the use of the relative time axis, synchronized with the system clock. In this example, the Timed Loop structure is used to determine the loop timing as well as the delta X for the points on the strip-chart.

The use of the Timed Loop, along with the correct setting of two of its properties, ensures the accuracy of the time values displayed on the bottom of the chart. By double-clicking on the Input Node for the Timed Loop, you will see "Discard Missed Periods" is unchecked and "Maintain Original Phase" is checked. If timing is controlled using a "Wait until next ms multiple" function (as demonstrated in the example program entitled "Real-Time Chart"), jitter can cause delays in the execution of the while loop. Over time, these delays will compile and the time values displayed at the bottom of the chart will drift from the actual system clock. By using the Timed Loop, unexpected delays are compensated for in subsequent iterations of the loop. This ensures the time values displayed on the bottom of the chart stay synchronized with the system clock.

This example can be used as a prototype for applications that acquire data at a constant, known rate. The maximum rate is determined by the timer resolution and speed of your machine. Note: The Period of Loop control is set to allow a minimum of 50 ms. This is to prevent the user from attempting to set the period to less than the actual time needed to execute the iteration. You can change this minimum value by changing the properties of the Period of Loop control.

Note the use of Unbundle by Name to extract the current time information, as well as the use of the Chart property node to set the X axis as desired. The current example displays 10 seconds of data regardless of the sample rate determined by Delay."

I hope this clears things up some. Have a good one!

Tyler S
0 Kudos
Message 6 of 8
(4,543 Views)
Tyler,
Thanx for the post. I'll try to explain what exactly is happening and what I need/want.

I have a test that runs for about 4 hours. We only need to collect data at the rate of once every 15 seconds. I've created a case machine that calculates the elapsed time based on the initial tick count, converted to minutes. Then every 15 seconds, I record all the pertinent FP channels and the calculated "elapsed time" in a spreadsheet file. When the test is done we plot the elapsed time in minutes on the x-axis and all the FP channels in the y-axis. What I would like is a chart that displays this graph as the test is being run. This gives my operators the feedback they need to know how the test is proceeding.

The problem seems to be that the calculated elapsed time is not a "time" value, but rather a simple number. This seems to be why the chart will not plot it. I don't really need the chart to be "timed" or really have a time unit anywhere, I just need it to plot the data I've collected so far. My case machine takes care of the timing, and even then it doesn't have to be that accurate.

The attached file shows what this plot looks like in its final form.

T
0 Kudos
Message 7 of 8
(4,531 Views)
Scubadude,

What you're doing sounds really straightforward and should be exactly what a LabVIEW chart would do for you. I guess the problem is in combining the dynamic data type with the numeric data type in the merge signals function. Maybe your original vi would work if you used the From DDT.vi to convert the dynamic data to numeric data. It also seems like it would work to simply not include the numeric time signal (so that you only have dynamic data) and set the x-axis of your chart to relative time format.

Tyler S
0 Kudos
Message 8 of 8
(4,517 Views)