LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Relative humidity vs time VI

Hello everyone I am having some trouble trying to make a VI for relative humidity. I've already correctly scaled the unit within NI MAX and its displaying the correct output in RH% already as opposed to mA.

 

I ultimately want to have the VI show/do:

 

  • Current RH% gauge (working)
  • Current time as X-axis but is scrollable (not sure if scrolling works)
  • Current RH as Y-axis (not working)
  • Export information to excel document with column for time and rh% (not even coded...)

 

I was able to change the "absolute time" to show correctly as opposed to the default which was some strange 1904 year. I got this to populate on the X-axis for the wave form chart but I cannot get the Y axis to work for humidity. I'd also like to be able to scroll right to left to see previous time values for RH on that chart but I haven't really gotten that far either.

 

Lastly I'd like to export this data to an excel file with headers/columns for time and RH. Since it doesn't necessarily have to be real-time, I'd also like to make the "data intervals" to be every 10 minutes if possible.

 

I've never really used labVIEW before so I'm a bit confused as to what to do and I would greatly appreciate any help. Please forgive the very noobish VI setup....The VI and screenshot of blockdiagram is attached 

 

THANK YOU!

Download All
0 Kudos
Message 1 of 13
(3,776 Views)

You don't have a waveform chart, you have a waveform graph.  A chart maintains a history of the past data.  A graph only shows what you sent to it at that instant in time, which is a single value that will be just a point on the waveform graph.

 

Your Stop Program button won't work, because you have two infinite While Loops inside you outer loop.  This VI will run forever until you abort it.

Message 2 of 13
(3,761 Views)

Your outer loop currently has not useful function because the inner loops can never complete.

Use a chart instead of a graph and you only need to set the offset and multiplier once (not over and over...).

Message 3 of 13
(3,760 Views)

Thanks for the quick replies, I'll fix the loops and try using a chart instead and see how it goes from there

0 Kudos
Message 4 of 13
(3,755 Views)

And as far as the filing goes... Try the "Export to Excel" Method on that chart.  Make life easy for yourself.


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 13
(3,737 Views)

Hello, 

 

So I've changed the loops and added a user-editable timer to determine how often the VI adds to the chart. I believe it checks out now, so please let me know.

 

 

I believe the date/time is being run only once now, however the problem I am facing now is that if I set the interval to anything other than 1 second, the X-axis display get's out of sync. IE: If I select 0, it runs at hyper speed and the X-axis blazes by 24 hours in a short period. The reverse is true if I increase the time.

 

@ 

Is this the excel function you were talking about? (above the stop button)

 

Thanks again

0 Kudos
Message 6 of 13
(3,729 Views)

Nope

!1.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 13
(3,713 Views)

@Eport wrote:

Hello, 

 

, however the problem I am facing now is that if I set the interval to anything other than 1 second, the X-axis display get's out of sync. IE: If I select 0, it runs at hyper speed and the X-axis blazes by 24 hours in a short period. The reverse is true if I increase the time.

 

 


You have a chart multiplier set to the reciprocal of the constant 1.  Thus 1, thus 1 second.

 

Take your value for the wait function, divide by 1000 to get seconds instead of milliseconds, then feed that into the multiplier.

0 Kudos
Message 8 of 13
(3,706 Views)

@

I think I found that same one via:

 

Right click chart > Create > incoke node > export data to excel

 

But I can't figure out how you got the WFchart refnum. How would you have it append to the excel file or even predetermine a filepath location to save it to? As it stands, when I run the VI, a temp excel file opens up each time the loop runs. I'm very bad with this, sorry......

 

 @

I think I'm slow because when I tried connecting the "wait until next ms multiple" thing to the (1/x), it still goes out of sync. I just want the time to be constistently going 1s at a time, but when a data point for RH% gets plotted to the chart, so does the corresponding time.

I'm so confused.......

This is my very first VI so I'm incredibly bad at this

 

Thank you for the guidance.

 

0 Kudos
Message 9 of 13
(3,659 Views)

That WFchart refnum is a flaw of the snippet tool that is built into LabVIEW.

 

It was an implicit invoke node tied directly to the waveform chart.  The snippet tool breaks them and turns them into a disconnected Invoke Node where you explicitly tell the node what reference to act on.

 

The Code Capture Tool available on the VIPM network is much better.

0 Kudos
Message 10 of 13
(3,654 Views)