LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need helps on Waveform Graph with DAQmx Read

Hi guys,

Based on the Cont-Acq-and-Graph-Voltage-Int-Clk.vi, I am implementing a chart recorder system with a 1kHz sampling rate that is to run continuously for at least 2-4 hours. And I am having difficulties with the DAQmx-Read (analog wfm 1Chan Nsamp) and Waveform Graph area; have searched over the forum for answers but still not able to 100% troubleshoot:

1) Turned on scrollbar for Waveform Graph, but nothing is scrolling when it's running.  How can I make that happen?  I know waveform chart can give me that option nicely, but I need to have cursors that's why I am using waveform graph now.

2) Attempt to change the x-axis to reflect real time data, able to manual change the axis to agree with what's on the 'scope but if i change the multiplier the axis change, graph does not. I need a more versatile way.  Say 1kHz sampling rate should give me a time interval of 1ms.  I tried using array and XY Graph and worked, but I am stuck on how to incorporate that with Wfm datatype in DAQmx Read since the program is sampling on the same time while I'm building my array using t0 and delta t.

3) Is it possible, and how, to put in an annotation by just one button? (e.g. to mark a point on the graph at this time while vi running) I know annotation list property is an array of property, and want to clarify, so if I want to access one of the element, I have to index-array myself to that element and change it there? since annotation does not have a drop-down list, like in cursor where you could have a property node with all the element listed in front of you.

I have just updated from LabVIEW 7.1 to 8 and am very new to all these.  So any help would be greatly appreciated!!

Thanks!
Perry
0 Kudos
Message 1 of 5
(2,919 Views)

A couple of things about your questions.

1. Doing this with a waveform graph is definitely not the best solution, because it has no history. That is why you are able to scroll on a chart and not a graph at run-time. If you do need the graph you can consistently have the waveform data be added to previous data, via a shift register, and then automatically change the start position time scale of the graph to keep up with where the data currently is. This solution is very very memory intensive and will dramatically slow down over time.

2. I am not sure what you are trying to multiply. If you are multiplying the entire waveform by some multiplier you need to make sure and scale the data points as well as the dt. I'm not sure if this is what you are wanting to do, but if it isn't please clarify more.

3. Again I'm not sure what you want to do here. Are you trying to mark a certain point in the graph at run-time? More clarification on this one please.

Let me know the clarifications and also if you have any questions about my explanation. Thanks

Tyler H

NI

0 Kudos
Message 2 of 5
(2,877 Views)
Hi Tyler,

Thanks for your help! 

Just to clarify and add onto my previous questions...

1) I understand that Graph has no history whereas Chart has so I am using Shift register and Array with wfm graph now.  Only thing is the scrollbar kept flickering when I scroll it back and forth during the program run.  Users need to be able to scroll back and forth to observe the change in the past, but I tried and the flickering didnt seem to stop.  Is there a way around this? or this might be something minor that i have overlooked?

2) I would like to have the x-axis of the wfm-graph to display useful time.  So rather than having incrementation (0,1,2...) then do the conversion later after the experiment (say.. multiply by 0.001ms/div). Is it possible to have the axis displaying 0.0001, 0.0002, etc (i.e. the real rate) as the program runs? I know it is doable to set the x-axis of my data using dt, to from the wfm data for analysis, but is it possible to have it displayed immediately while program runs? I have searched over the forum and seems that the x-axis is not changable? Rationale behind is.. users should be able to go back to say.. 15 mins ago.. look at the time and observe the change between then and now... (similar to 1)

3) Let's look at cursor first... if you want to get the position of a cursor etc.. you can go to Property Node of a graph.. and get the X and Y position from there (such that the property node has a list of features for cursor).. Now I found the annotation list only has Property Node -> Annlist, so to access elements within the Annotation property list.. does that mean i have to go through the whole annotation array?  Reason for this is.. I have to implement a tag feature.. such that a "Tag" button on the front panel... and while the program is running, user can press it to mark a point on the graph like what the annotation does.. and this "tag" will give coordinates or some information for users to refer to when taking observation.. (i.e. Tag 1: Increased voltage to 10V). 

Whew~ that was a long message.. Thanks for taking the time to read it!  Really appreciate your help!

Perry
0 Kudos
Message 3 of 5
(2,867 Views)
1. The flickering on the screen is probably due to the update rate of the graph. If you are giving it new info 10 times a second it needs to be re-drawn 10 times in a second, and by default the position of the graph will be to the far right. This is assuming that you are changing the visible area programattically to keep up with the acquisition. I don't know how you can work around this and don't think it is going to be possilbe if you need to keep appending dat to the graph input.
 
2. Again, if you are giving the waveform data each time, you can re-write the dt and To to get the timing you want. If you want is in millisecond you need to figure at what that you would be per sample, based up on the sampling rate. Then you can write a To of 0 and something like .001 for the dt. This will get the values you want.
 
3. The tag implementation of creating it from a button is going to be very complicated. First you will have to write to an element of the array with all the data of the clust correct so that even shows up in the current visible area of the graph. It is actually better for them to right-click on the graph during operation and add one manually like they are intended. If you want to do it the other way, it is going to be a headache, but it can be done.
 
Let me know if you have any more questions.
 
Tyler H.
National Instruments
0 Kudos
Message 4 of 5
(2,850 Views)
Thanks Tyler!  I'll keep working on it to see if I can figure it out!
0 Kudos
Message 5 of 5
(2,837 Views)