From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display units from a waveform on a chart

I acquire data continuously using DAQmx, which allows me to use a custom scale for the acquisition (including physical units). I retrieve the data as a waveform and wire that to a waveform chart. Unfortunately, the waveform chart apparently does not permit displaying the y-axis units unless the data wired to the chart is an array of doubles with units.

 

Is there a way to display data units on a waveform chart with waveform data as input? The data units are part of the attributes of the waveform (NI_UnitDescription), set by the DAQmx task and DAQmx scale.

 

Tangentially, how do I change the input data type of a waveform chart which is typedef'd? I.e. if I create a chart and make a typedef from it, it seems that I cannot change the input data type (waveform to 1d double, for example) without creating a new waveform chart, wire the data type to it, then copy it to the typedef and delete the original chart in the typedef. This is particularly egregious if I have made aesthetic changes to the chart which have to be reapplied to the replacing chart.

0 Kudos
Message 1 of 4
(3,375 Views)

Open on my desk is a Triaxial Accelerometer wired to a USB-6009.  My LabVIEW code uses a Calibration Procedure and Custom Scales so that the voltage I get out from the three analog channels (0 to 5 v) is expressed in units of "g"s.  I just wire this waveform to a Chart and get a very nice display.

 

I wonder how my code differs from yours -- too bad I can't compare what we've done and suggest changes you might consider.  Don't bother to submit a picture of some part of your Block Diagram -- as this involves setting up the DAQmx Task, acquiring the data, and plotting it, it would be best to take the folder containing the LabVIEW Project, compress it, and post the resulting .ZIP file.  I should note, however, that I have yet to successfully install LabVIEW 2017 (with my required Modules), so please save for LabVIEW 2016 or earlier.

 

Bob Schor

0 Kudos
Message 2 of 4
(3,332 Views)

Bob_Shor,

Thanks for responding. I've attached a minimum working example that illustrates the issue.

I am actually using a USB-6002, so it should be similar to the 6009, but maybe there are relevant differences.

I've setup a custom scale as part of the DAQmx task. For the example, I am using a simulated USB-6002 that I setup in MAX. I didn't do anything special there.

 

As seen in the screen shot, the context menu for the waveform chart does not permit viewing the units label. Using a property node to set and make visible the units label doesn't work either.

 

I welcome any suggestions or work-arounds

 

Screen Shot 2017-10-31 at 10.43.08 AM.png

Download All
0 Kudos
Message 3 of 4
(3,320 Views)

Just use a property node for the Y-axis text to set the units there.

0 Kudos
Message 4 of 4
(3,315 Views)