LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create a VI to read in a voltage signal...

I would like some help in creating a VI in labview as I have never used the program before. I want to create a VI to read in a voltage signal from an SCXI 1000 chassis at a sampling rate of 1024Hz. I need the signal to be shown on a waveform graph. The values on this graph need to be recorded and written to a text or excel file.

 

Any help greatly appreciated,

MRyan

 

0 Kudos
Message 1 of 7
(3,622 Views)

Start by checking out the examples that ship with LabVIEW. There are examples that do all the things that you want. After trying them out, come back with specific questions.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 7
(3,598 Views)

Thanks for your help Mike, the examples were extremely helpful.

 

I have two VI's partially set up now but I am still encountering problems.

I will attach a Raw.vi and a RMS.vi.

 

In the raw VI I want it to log all the data that the channels output at the moment it is only logging one value from each channel. for example if the task is 30seconds long it should log 30000 values as the rate is 1000hz, continuously.

 

In the RMS VI I need it to read the raw spreadsheet file created, then get the rms values for these and write them to another spreadsheet file (only write data once every second; as per the example above, to obtain 30 rms values). At the moment it is returning a value of zero per channel.

 

Once again any help or direction to examples is appreciated.

 

MRyan

Download All
0 Kudos
Message 3 of 7
(3,534 Views)

Your program for writing is wrong because you are only passing a single value out of the while loop. Nothing gets passed out until the while loop stops and what you are passing is the very last result. If you are only running the while loop for a short while, click the exit tunnel and select 'Enable Indexing'. Then you will pass an array of all iterations. Or, put your file write inside the while loop. Get rid of the local variables as well. That's bad programming. I don't understand the conversion to a 2 DBL and then to dynamic data and then to a scalar. If you only want a single value, why are you acquiring 1000 with each scan.

 

The program that reads a file is strange as well. You've got a scalar coming out of the RMS function and then you think you can split that into two different values. That does not make any sense at all. If you have problems, with this, you should really attach the text file you are trying to read. You may be completely wrong about getting the 1D output. That depends on how your file is structured.

0 Kudos
Message 4 of 7
(3,518 Views)
Thanks for the help. I will try to rectify the VI's with this information and hopefully my programming will improve!
Message Edited by MRyan on 03-08-2009 01:01 PM
0 Kudos
Message 5 of 7
(3,498 Views)

I went back to the drawing board with my program - The problem I have now is that I would like to only get the RMS data for one second of the channel data rather than all the RMS values.

 

An example again is if I'm reading at 1000Hz then I am acquiring 1000 values per second so if the program is run for 10seconds I would have 10000 raw data values and I would like to get one RMS value per second of this data leaving me with 10 RMS values.

 

Any tips on how to put in a timing wait function would be great.

Message Edited by MRyan on 03-09-2009 03:51 PM
0 Kudos
Message 6 of 7
(3,465 Views)
The code below will create a 2D waveform data array with all results for all iterations. There will also be a 1D array created for the rms values of all iterations. I removed your indicators because I could not understand what they were really supposed to show and your use of locals was very wrong. I don't think you need any wait function. The DAQ Assistant is set for 1000 S/sec and to return 1000 samples. Each loop will take 1 second to run. If you want to limit the number of iterations based on time, a function you can use is Elapsed Time.
0 Kudos
Message 7 of 7
(3,462 Views)