04-14-2009 02:20 PM
Hello All,
I'm relatively new to Labview. I'm well experienced with MATLAB and have done embedded C and assembly programming. In the little I've used Labview I feel very much disconnected from the hardware and what is happening relative to the embedded programming that I've done.
A little background on my current project, I'm performing a Linear Discriminant Analysis (not necessary for you to know/understand for my current question) on EMG (electromyography) autoregressive features that I'm obtaining from a MATLAB script in Labview. My question is how I can gurantee that any processing done on data inside a case structure for a specific case will operate on 128 datapoints at a time? My data acquistion is coming from hardware that is running at 960Hz, which works out to be 133ms. Is the solution as simple as using a "Wait" timer? Will the "Wait" vi gurantee that the period of execution be 133ms for the case or does it wait 133ms after 1 execution of the case? Is there a way to make the case execute every time that the data being fed into the case reaches a size of 128? Any help or guidance would be appreciated.
Thanks, Alan
04-14-2009 02:53 PM
04-14-2009 05:34 PM
Dennis,
The data acq came with a software dev kit using labview. So I'm using some of their templates. The data acq is controlled by a while loop that executes every 'x' number of ms, a number inserted by the user at run time. Essentially, the data acq has multiple channels of data that get dumped every 'x' number of ms. I want to collect this data and graph it as soon as possible. I want to process the same data, but I want to process windows that are 128 samples in length (aka. 133ms). I am wondering if there was an easy way to do this. I've been experimenting all day and figured that if someone had already done something similar it might save me some time. I'll keep trying. Any help is appreciated.
Thanks, Alan
04-14-2009 06:11 PM
Could you be a little more specific about this 'software dev kit'? Is it perhaps the DAQ Assistant? There are also a lot of templates provided in LabVIEW so that does not help much either. The best thing to do is to attach your program so that someone can look at it.
If you are using the DAQ Assistant or the the lower level DAQmx functions, I already told you the easy way to acquire and process 128 samples. If you are acquiring a single sample from each channel in a while loop and accumlating them in an array, it's also simple to limit the analysis to 128 samples. It just a basic array subset function.
04-14-2009 06:30 PM
Hi Dennis,
I'm using the BioRadio150 from Clevemed and using the labview software kit from Clevemed. I'm attaching my file so you can have a look. Thanks for the help. Please let me know if I need to clear anything else up. Not to bombard you with too much, but the "read from excel" vi's don't seem to be importing 2D data. Did I implement the "read from excel" vi's correctly? The top 3 are reading 1x8 files, while the bottom 3 are reading 8x8 files. The files were saved in excel as tab delimited text files.
Thanks, Alan
04-14-2009 06:33 PM
04-14-2009 06:38 PM
04-14-2009 07:28 PM
I'm not sure at all why you are doing all of that conversion to matrix and then back again but that's beside the point, probably.
Without the instrument or the driver you are using, then I can only speculate but it seems that the idea of using an array subset function would work though I cannot tell how many samples each call to the BioRadio_Read returns each time. If each read returns less tham 128 samples you can use a shift register and the Build Array array function. An Array Size function would be used to determine when to start processing.
You don't have a single Read From Excel function in your program. You have multiple Read From Spreadsheet and there is a difference. and the Read From Spreadsheet is perfectly capable of returning a 2D array. You would need to attach a data file but your use of the max characters per row seems very incorrect. If you have data in 8 rows and 8 columns, setting the number to 8 is far too fe. Why do you even need this?