LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Putting setpoint data in a waveform graph

Solved!
Go to solution

Hi,

 

In a measurement graph, which is created from a waveform, I would like to add setpoint data as well. How do I add this setpoint data to the graph?

 

In a control loop system, the output is monitored by a labview program. I would like to see the setpoint of this system as well in the graph, but these setpoints are changed on random times so I don't know how to create a waveform of this data. Should I create a waveform of the setpoints, or is there another option to show the setpoint value in the graph?

 

Cheers,

 

Rolf

0 Kudos
Message 1 of 13
(5,010 Views)

Adding the data is by far the easiest to do. There is really no reason not to do it like that. it works well even if you have 100 tags and 100set points. I usually use a normal graph or chart, not a wafeform, but that should not make much difference.

 

You might think it's a waste of memory,to add the exact same value, because the set point does not change. The best next solution is to use an XY graph. But now you need to add a timestamp to each sample of the first set of data, and the st pont samles. You end up using even more memory. This is only uefull if you'd have one data set, and severl sets taht change less often.

 

Another radical solution is to use the plots front image. You can draw anything in it, including setpoint lines. It's usfull for advanced anotations and custom data visualisation, but in this case there really is no point. See this presentation.

 

Regard,

 

Wiebe.

0 Kudos
Message 2 of 13
(4,979 Views)
You could also add a cursor.
0 Kudos
Message 3 of 13
(4,971 Views)

Dennis,

Usually you'd want to see the setpoint history in the graph. So when you move it up and down you see a pulse.

If you want to see a horizontal line indicating the current setpoint, a cursor is by far the easiest way. You can even let the user change the setpoint by moving the cursor.

0 Kudos
Message 4 of 13
(4,954 Views)

Thanks for the input. The cursor is also a good idea, but the data needs to be stored (in a TDMS file) as well. So I think the waveform is the best solution in this case. My problem is now, how dow I create a waveform of the setpoint data?

 

Setpoints are modified at random times by an event case. A waveform needs data with a constant interval. Can you help me out on this?

 

Regards,

 

Rolf

0 Kudos
Message 5 of 13
(4,923 Views)

Although the set point changes at random times, you should be able to get it's value at anytime. So, when you add the process value (PV), also add the SP in the exact same fashion. It's hard to give specifics without knowing anything about your program's structure.

 

Now I do not use waveforms, but simple graphs and charts. I think you can make a multiplot waveform by building an array. Someone else has to help on that point. (I feel the "simplicity" waveforms datatypes provide to be very confusing, compared to simple 1D and 2D data of the old school graphs and charts. There are benifits, but I avoid them if I can.)

0 Kudos
Message 6 of 13
(4,917 Views)

Thanks for the quick response Wiebe.

The difficulty is the fact that I get a piece of waveform with something like 1000 samples every time I read my DAQ card. This piece of waveform is added to the total waveform of this signal.

 

When I now read this piece of waveform, I will have to construct a new piece of waveform with the setpoint data which might have been modified somewhere during these 1000 samples. This is possible, but it is not so easy. I hoped someone had experience how to do this with a small piece of code.

 

 

0 Kudos
Message 7 of 13
(4,908 Views)
Solution
Accepted by topic author RBoelens

That can make it a lot more difficult.

 

At some point an array of 1000 points need to be assembled (obviously). How to do this depends greatly on your structure. Time synchronisation of the two signals can be very difficult. It would be easy if the setpoint only changed once per 1000 point cycle.

 

You could consider to read back the SP as an analog input, so you get 2 AI samples from the hardware. That way the two will always be synchronised. But I am alleady making assumption, like that the signal is an analog input (and the set point an analog output). What hardware do you use?

 

I think you would always require a loop to get the data, and a loop to set the SP. Both loops will most likelly run parallel, and unsynchronised. The trick is to synchronise them, or to get deterministic timestamps in both loops. If you can make that happen, you're 80% there. You could make the loops timed loops (using the same clock). Then you get the timestamps in both loops. The SP loop has to queue the changes, pushing the value and time. Then the data loop can use the values and times to create the 1000 sp samples.

0 Kudos
Message 8 of 13
(4,899 Views)

Yes, I already figured out the synchronisation is the most difficult part.

The SP and the signal input are both analog, I'm using an USB-6009.

 

I wasn't aware it is possible to read from an analog output, but on the internet I found documentation about this:

http://digital.ni.com/public.nsf/allkb/CB86B3B174763C3E86256FFD007A2511

 

I think this will be the most easy way to solve my issue.

 

 

0 Kudos
Message 9 of 13
(4,893 Views)

Thank you for the link. Didn't know you could do that either. I though, just hardwire the AO to another AI. But if this works, it's much more elegant.

0 Kudos
Message 10 of 13
(4,888 Views)