From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

Waveform Graph Time Issues

Fairly inexprienced with LabVIEW I have just used it for various labs and simple tasks. I am attempting to make a waveform graph to plot temperature vs time from a thermistor, but everytime I begin to run the program the temperatures will read and be written to the graph, but the time remains constant. For example if the temperature goes from 25C to 30C the entire graph moves up as a straight line rather than marking a fluxuation at a specific time. I have attached the program, any help would be greatly appreicated.

0 Kudos
Message 1 of 4
(2,896 Views)

I really dislike the DAQ Assistant and its evil twin, the Dreaded Dynamic Wire.  It is also a real challenge trying to figure out LabVIEW code where wires go all over the place as though solving an equation, but there's no real sense what the equation actually is (it certainly isn't the one in the comment label, as Vin, R1, and 273 don't appear anywhere).

 

I can see you are recording channel(s) of data at 1 KHz, getting 100 points at a time.  I see a 2D array of data -- what are they?  What is the Input Device?  How many channels are you using?  Are you trying to plot "evolving" temperature in a chart?  Do you really wish to see 1000 points/second being plotted?  Do you want to do any averaging?

 

I strongly urge you to learn how to use DAQmx.  There are a whole set of DAQmx tutorials, but I recommend you start by doing a web search for "Learn 10 Functions in NI-DAQmx ...", read that White Paper, and start using real DAQmx functions which give you real LabVIEW variables such as Waveforms, 1D Arrays (of Dbl), etc.

 

There's no rule (except "Don't Do It This Way") that says all of your code needs to be in a single large VI with wires running everywhere.  Learn to encapsulate processing in sub-VIs (for example, the code to change Volts into Temperature could be a VI called "Volts to Temp", a sub-VI that you give an Icon with the words "Volts to Temp" written inside a 32 x 32 Pixel box so you'll recognize it on the Block Diagram.  All of your sub-VIs should have a 4-2-2-4 Connector Pattern (the LabVIEW Default), with Error In in the lower left corner, Error Out in the lower right, and all the Error Lines wired to enforce Data Flow (and provide a clue where the Error is occurring).

 

Do you know the difference between a Graph (which is an X-Y plot, and is "static") and a Chart (which is a Y vs. time, and is "dynamic")?  Which do you want?  [You specified a Graph, but I'm so "allergic" to the DAQ Assistant and Dynamic Wires that I can't "see" the "time" channel ...].

 

I'm guessing this is a Homework Assignment (or a "learn how to do this in LabVIEW").  While I don't know the details, I'd assume that if I wanted a plot of temperature, I'd want a Chart showing temperature as an (evolving) function of time.  I'd think about the time resolution of interest -- while I may be sampling at 1KHz, I don't expect to be interested in temperature change on that time scale, but rather maybe on a scale of seconds.  What I might do is take an array of temperatures and average it to produce a less "noisy" measurement, then plot that single point on a Chart, and repeat, letting the Chart "evolve" (rather like watching a plot on a strip chart recorder, an "old-fashioned" instrument where a moving pen writes on a steadily-moving strip of paper ...).  Your Assignment Might Differ ...

 

Bob Schor 

0 Kudos
Message 2 of 4
(2,881 Views)

I know for a fact that all the wires and the output of the temperature are correct. The 273 is in order to convert the output temperaure of kelvin to celcuis. I understand the difference between chart and graph on there as well, I want a stationary set of data that will evolve rather than seeing the fluxuations in real time. I am doing this to easily monitor temperatures inside an electromagnetic coil, but as I said before I don't have much experience with labview. I know for a fact that the output of everything is correct I just need help establishing the waveform graph. I assumed that just having the output Y values going into the graph and setting the x axis to relative time that this would work, but this is not the case.

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

So it sounds like you are sampling a single channel, temperature, at 1KHz, getting 100 samples at a time, and you want to plot a graph (changing 10 times/second) of these 100 samples so you can see how temperature varies over 0.1 seconds, right?  [I'm getting the timing parameters from the numbers associated with the DAQ Assistant].

 

If you used DAQmx functions instead of the DAQ Assistant, and got your output as a single Waveform, you could just wire that to the Graph and you'd be done.  Of course, you might need to do some fancy transforms of the waveform such as you are showing (and which I still recommend "hiding" inside a sub-VI so you can see the Forest for the Trees, namely "Sample, Transform, Plot" as three "boxes" on the Block Diagram).

 

Bob Schor

 

Bob Schor

0 Kudos
Message 4 of 4
(2,834 Views)