LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous voltage measurement/logging...Need help

I own LV version 8 and currently learning how to use the program to perform continuous (for 2-3 weeks) monitoring and logging voltage of a test point in a PCB in a device under test. The voltage is cyclic. It stays 0 for some period of time (let say 1.5 hours) and goes above 0 for another period of time (let say 10 minutes).  This cycle continues for 2-3 weeks. My requirement is to:

1. Continuously monitor the varying voltage for 2 -3 weeks uninterrupted.

2. For saving the voltage to an Excel file, sample the voltage, only when it is above 0, every 1 second and save/write the voltage data array into a column in an excel file.

3. Each cycle in which voltage is above 0, append the existing excel file and add new voltage data array to the next column.

I down loaded the sample vi "Cont Acq&Graph Voltage-Int Clk.vi" from NI Example but have a tough time to modify it to my requirement. I am not still up-to-speed to modify the vi. Can anyone help to modify the vi? If you can, since my LV 8 may not be able to open your modified vi, can you send a gif or jpg file of the Front Panel and Block Diagram to help me to modify the vi in my program.

Thanks in advance.

 

0 Kudos
Message 1 of 10
(6,131 Views)

Hi David T. 

The first requirement of your code doesn't sound like it will be a problem as long as the computer is stable.  For two, you should be able to use either the report generation toolkit found here:

http://sine.ni.com/nips/cds/view/p/lang/en/nid/209050

Or simply use the "write to measurement"  This vi will save in a format that can be opened in excel.

 

The third part will mostly likely include some programming using shift registers and boolean functions to compare previous states of the program.  

The forums can be a great place to learn how to program in LabVIEW.  Here is a series created by one of the members which can walk through some basic functionality. 

http://decibel.ni.com/content/docs/DOC-11597

National Instruments
FlexRIO & R-Series Product Support Engineer
0 Kudos
Message 2 of 10
(6,110 Views)

Simple data-logging task you say?    This looks like a job for...  SignalExpress!

 

I usually don't condone the use of Express VIs but even the free LE version will do what you want in about 1 minute of setup time.  Plus, you probably already have it, look in the National Instrument programs for it.  If you have the LabVIEW Full or Pro version you can even convert the SignalExpress code into a VI and learn from it and expand it with more features. 

 

And sorry to say it Dave, but unless NI has made REALLY substantial improvements to the Report Generation toolkit, it causes far more problems than it's worth.  My company has been trying to update 8.2 code for years because all the M$-ActiveX-LVOOP based stuff in there keeps breaking everything.  We've just given up and are writing our own report generators to create HTML.

 

BTW, I understand you specified that the data should only be stored when above zero but, obviously you will have to collect data continuously to know when that happens.  You can modify the SE code if you have LabVIEW Full+ but for now, I would just collect your data at a reasonable resolution and keep it all.  Hard disk space is cheap!  You can ignore/edit the parts where it's zero later when you look at the data. 

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 3 of 10
(6,102 Views)

Dave:

Thanks for the tips.

I designed a very simple VI (attached) which accomplishes 2 of my 3 requirements. Meaning, it samples input voltage signal at 1 sample per second and it writes voltage array to different files. My original requirement was to append the existing file, but "Use next available file name" option in "Write to Measurement File" VI can also satisfy my requirement.

I still have problem meeting my 3rd requirement which is writing voltage array to different file each period of time (cycle) the voltage is above zero. I used "Larger than Zero" Boolean control at the Enable input of "Write to Measurement File" but did not work. Unless you can recommend an easier way, the only way to perform write the voltage array to different file is to automatically trigger the "Run" button when voltage is above zero and automatically trigger the "Stop" button when voltage goes to zero. I would appreciate if you help me out to modify my VI accordingly.

I look forward to you response.

Thanks in advance.

 

David T.

 

 

0 Kudos
Message 4 of 10
(6,039 Views)

Hi David, 

I'm not following what you mean by "cycle".  

Do you want to record all data that is above a threshold?  Or is there a specific quantity of data you want to store while it's above a threshold?  

 

I'll need some clarification on that in order to help point you in the right direction. 

One thing I do want to note is that the using DAQ assistant, the way you have it configured is you're getting 1 sample per second.  This is quite inefficient, but if it satisfies your requirements then it should be fine. 

Here is a document that discusses these settings.  

http://digital.ni.com/public.nsf/allkb/3E3D74E26B8A5B83862575CA0053E4B5?OpenDocument

 

Dave T.

National Instruments
FlexRIO & R-Series Product Support Engineer
0 Kudos
Message 5 of 10
(6,011 Views)

Dave:

 

I am using LV 8 and USB-6009 DAQ module. I am running a life cycle (continuously charge/discharge) test round the clock (24/7) for a week on a battery. I have designed a test fixture that automatically charges and discharges the battery using relays and timers. Charging and discharging sessions are approx. one hour each. My requirement is to record the voltage of the battery during only discharge sessions. I would like to have a VI that samples the discharge voltage slowly (I will be importing the stored data into Excel to graph the voltage curve, hence I have to sample voltage slowly due to the limited number of rows in Excel sheet), perhaps 10 samples per second (or less) and write the voltage samples of each discharge session into a new file using “Write To Measurement File” vi at the output of DAQmx Read (in the while loop) to store data with “Use next available file name” setting in configuration window.

Searching thru NI Discussion Forums, and unless you think of a better way, I discovered that I may be able to meet my requirements using triggering function in a cont. acquiring voltage with internal clock vi.

I have the same requirement as abdel 2 in this post:

http://forums.ni.com/t5/LabVIEW/digital-trigger-to-stop-start-analog-data-acquisition/m-p/777567

 

After further search, I came across DigitalStartandStopTrigger.vi in this link

http://digital.ni.com/public.nsf/allkb/BA775B0E445BFA79482571FE0032CCEB?OpenDocument

 

I downloaded the DigitalStartandStopTrigger.vi and tried to run it but it seems it does not work with my DAQ 6009 module since I get Error -200077 at the output of "Reference Digital" node in the block diagram. I must use PFI0 digital input of DAQ6009 for both Start (at rising edge) and Stop trigger (at falling edge) since 6009 only has one trigger input, PFI0.  

 

My questions are:

1. I will be using “Write To Measurement File”.  Does each stop trigger cause the voltage data to be written automatically into new and separate files?

2. Is there any way to modify the VI so that I can use the same PFI0 trigger input for Start (at rising edge) and Stop trigger (at falling edge)?

3. Are above requirements doable using DAQ 6009 module?

4. Do you recommend a better way to meet my requirement?

 

Sorry for the long essay....

 

Thanks in advance.

0 Kudos
Message 6 of 10
(5,995 Views)

Hey David, 

I don't have LabVIEW 8 installed, so I'm not sure all the examples that come with that.  If you install the newest daqmx drivers you should get all the newest examples that will help you get on your way.  

 

The way I would implement your program is I would have an analog input sampling all the time at 10s/sec, and a digital input.  The digital would then be watching the line that is charging the battery.  Wire that digital line up to a case structure.  That will allow you to only record when the line is low. 

 

Regarding the write to measurement file, here is an excerpt from the help documentation: 

 

If a file already exists Contains the following options:

  • Rename existing file—Renames the existing file if Reset is TRUE.
  • Use next available filename—Appends the next sequential number to the filename if Reset is TRUE. For example, if test.lvm exists, LabVIEW saves the file as test1.lvm.
  • Append to file—Appends the data to the existing file. The VI ignores the value of Reset if you select the Append to file option.
  • Overwrite file—Replaces data in an existing file if Reset is TRUE.

So you'll have to set the "Reset" input to true in order to begin writing to a new file.  This will have to be done pragmatically.  I suggest using a shift register to monitor whether you'll be needing a new file or not.  

 

What you're suggesting isn't the easiest to implement, and it may take a while to get ramped up on LabVIEW programming in general.  We do have alliance partners that will write code for you.  If you're interested, they can

be found at 

http://www.ni.com/alliance/

 

Thanks, 

Dave T. 

National Instruments
FlexRIO & R-Series Product Support Engineer
0 Kudos
Message 7 of 10
(5,976 Views)

Dave:

I have been trying to implement your solution by monitoring the digital and analog line but that may not be feasible to implement using my current hardware and software.

I have attached the vi that can accomplish almost all my requirements. The only issue left is to look at the elements in 1D array at the output of the DAQmx.vi and if it is zero, the Stop is activated thru the OR gate. I'm using a Search 1D Array for this purpose but I get broken lines indicating error. Can you recommend how I can work this out? I have attached the vi and the printout.

Thanks in advance.

0 Kudos
Message 8 of 10
(5,943 Views)

Your problem is your wiring, not the logic.  Move the OR gate and you'll see that you've connected the two inputs TOGETHER, not one to each terminal.  You have to be careful about this especially when wiring to small connector panes.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
Message 9 of 10
(5,931 Views)

NIquist:

Thanks for the tip. I fixed the wires as you pointed out but I still cannot get the ni working as per my requirement. I need to assert the Stop button when input voltage goes to zero. For this, I'm reading the 1D array for zero element and then assert the Stop thru OR gate. But it seems my way is not working. Do you have any other easier and workable way to accompolish the task? Appreciate the input.

Thanks.

0 Kudos
Message 10 of 10
(5,916 Views)