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: 

Data acquisition from 7am to 9pm

Hi guys,

 

I'm recent to the LabView world so I've encountered some problems during my fairly new work with it.

 

I developed a monitoring and data acquisition program for the writing of voltage, current and power values obtained from 4 separated PVs. As you can see from the image attached, I have 2 time conditions with which the user can choose when to begin (7am) and to finish (9pm) the writing to the measurement file. 

 

The thing is: the writing does not begin at 7am as pretended nor does it stop as 9pm, as it continues to record data in a different file after that.

 

Hope you can help me

 

Thanks,

Francisco Nunes

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

Hi Francisco,

 

The thing is: the writing does not begin at 7am as pretended nor does it stop as 9pm, as it continues to record data in a different file after that. Hope you can help me

The first you should do when such problems occur is called "debugging"!

Did you debug (using probes) what happens when you compare current time with your string inputs? Do you get the expected results? Is "Regisdo ligado" showing the expected value?

Does ElapsedTime provide the expected value? Do you get the expected value after the final AND operation?

 

On the rest of (visible part of) the block diagram I can only say: learn to get rid of ExpressVIs and DDT wires. And learn to use arrays and (autoindexing) loops…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,147 Views)

I completely agree with GerdW.  I'd add that before writing any LabVIEW code, spend several hours (or, better, a few days) with as many LabVIEW Tutorials (or, better, an instructor-led class or two).  Learn the central LabVIEW concept of Data Flow, which largely makes Frame Sequences completely unnecessary once you also learn to almost always use the Error In and Error Out terminals to connect sequential functions together.

 

There are also some excellent NI Tutorials on DAQmx (the series of functions and concepts behind Data Acquisition and Control) here.  One of the excellent White Papers in the Basic DAQmx series with the title "Learn 10 Functions in NI-DAQmx and Handle 80% of your Data Acquisition Applications" will show you how to eliminate the Dreaded DAQ Assistant and its Evil Twin, the Dynamic Data Wire.

 

Bob Schor

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

Do you know that when you compare string values for greater than or less than, you are comparing how their alphabetical order, not that a number is greater or less than the other?

 

And what about AM and PM?  6 am vs 6 pm are completely different times of the day.  You need to have the "numerical" value of the hour based on a 24-hour clock for a comparison.

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