02-03-2009 02:20 PM
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
02-03-2009 10:05 PM
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...
03-07-2009 06:30 AM
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
03-07-2009 01:40 PM
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.
03-08-2009 12:55 PM - edited 03-08-2009 01:01 PM
03-09-2009 03:49 PM - edited 03-09-2009 03:51 PM
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.
03-09-2009 04:33 PM