05-16-2017 07:23 PM
I am using the Express VI's for Amplitude and Level Measurement as well as Tone Measurement. Then I am trying to use them in conjunction with a threshold detector. The measurement VI's do not generate a stream of data that the threshold detector needs. I tried building arrays, but this was not fruitful. I get error -20013 which can mean it is not getting any inputs or not enough.
Everything is in a while loop and getting data from a myDAQ sampling continuously. Could that have something to do with it?
Any Ideas?
Vi and pics are below
05-16-2017 07:10 PM
Project Objective:
A.) detect activation of small muscle group
B.) count # of activations in 3 second period
C.) display counted # after each 3 second period
The first part is where my problem lies.
System description:
1) using an analog front end to filter raw EMG signal from biopolar surface electrodes and producing one analog output. 2) That one output goes to AI 1+ on the myDAQ (analog in 1), AI 1- is connected to ground. 3) daq assistant brings data into labview. 4) two additional digital filters refine signal. 5) amplitude, level, and tone measurement express Vi's used (these Vi's produce values that change an order of magnitude in response to a muscle activation) this is where the problem sets in. 6) the rest of the code is different attempts to use threshold detection to detect when and how many times the muscle has been activated.
My Problem:
the VI's explained in step 5 above all generate a single value at time zero or something like that. Their waveforms are consistently centered at t=0. This could mean time data is not included after the measurement is performed by the VI. I get ERROR code 20013 which can be related to the number of inputs being less than the width (my width is 1 for each detector). I tried building arrays to store the data and using different types of threshold detectors, but nothing worked.
I think maybe a shift register might work, but then I would have to change my sampling setting from continuous and it would get to complicated for my level of expertise. It would also make the loop in a loop I am planning on using for part B and C from above very confusing.
Any fixes for my code or suggestions on a new method would be welcome.
05-16-2017 07:18 PM
Project Objective:
A.) detect activation of small muscle group
B.) count # of activations in 3 second period
C.) display counted # after each 3 second period
The first part is where my problem lies.
System description:
1) using an analog front end to filter raw EMG signal from biopolar surface electrodes and producing one analog output. 2) That one output goes to AI 1+ on the myDAQ (analog in 1), AI 1- is connected to ground. 3) daq assistant brings data into labview. 4) two additional digital filters refine signal. 5) amplitude, level, and tone measurement express Vi's used (these Vi's produce values that change an order of magnitude in response to a muscle activation) this is where the problem sets in. 6) the rest of the code is different attempts to use threshold detection to detect when and how many times the muscle has been activated.
My Problem:
the VI's explained in step 5 above all generate a single value at time zero or something like that. Their waveforms are consistently centered at t=0. This could mean time data is not included after the measurement is performed by the VI. I get ERROR code 20013 which can be related to the number of inputs being less than the width (my width is 1 for each detector). I tried building arrays to store the data and using different types of threshold detectors, but nothing worked.
I think maybe a shift register might work, but then I would have to change my sampling setting from continuous and it would get to complicated for my level of expertise. It would also make the loop in a loop I am planning on using for part B and C from above very confusing.
Any fixes for my code or suggestions on a new method would be welcome.
I am using LabView from 2014.
05-16-2017 10:23 PM
Why are you building an array of blue dynamic data wires? My guess the problem is there. In one case you wind up indexing that element back out. But in another you use to Double to turn it into a Double Array. How many elements does that array have? My guess is just one.
You should try to avoid the Express VI's. And if you do use them, use the From DDT express VI to convert it to meaningful data early in the process.
05-17-2017 08:25 AM
Each of the terminal branches on the right side of the code are floundering attempts at fixing my problem. I am out of my depth here.
I tried avoiding the use of the measurement VI's, but the other function (extract single tone information.vi) gives me the same error ( 20013) when I hook it up to the threshold detector. I have used the convert from dynamic data, but it hasn't helped.
05-17-2017 08:43 AM
Exactly what are you trying to do with the Threshold detectors and the Threshold Array?
I can tell you why you have an error. -20013 says the width must be between 0 and the number of samples. Your width is 1. But the problem you are turning scalar data back into 1 element arrays. Thus the number of samples equal 1 which is the same as your width.
First, clean up the block diagram. Second, convert the dynamic data to a waveform and not an array so that you don't lose timing information.
Third, describe what you are trying to do with the threshold functions you have dropped into your block diagram.
See attached VI for a cleaned up version.
05-17-2017 08:53 AM
A more comprehensive explanation of my problem and project is available on this thread:
05-17-2017 09:00 AM
I tried running your cleaned up code and modifying my own by changing my dynamic data converter to output a single waveform. The 20013 error continues to present.
05-17-2017 09:46 AM
@rossc44 wrote:
Each of the terminal branches on the right side of the code are floundering attempts at fixing my problem. I am out of my depth here.
Agreed.
Lets try to take a bit of water out from under you.
Starting at the beginning. You have a DAQmx single channel task giving you 500 samples at 1kHz from a MyDAQ Analog Input
Then you toss the 1kHz signal through a 400Hz lowpass filter --- ??? Why "Frequency (sub) Nyquist" is 500Hz just reduce the sample rate to 800Hz and achieve the same thing only better? Now that is a serious question... why the lowpass?
Then you toss the semi filtered signal through a bandstop with a 2Hz reject. expecting what? Another serious question!!
Finally, instead of using all the built in smarts of the myDAQ, you pass the missfiltered signal into some measurement express vis that generate scalar measurements from the 1kHz analog input (NOTE: those same measurements are available directly from the myDAQ DMM!) And you are putting those scalar measurements through threshold dectector vis and expecting what again? Why not just use Greater Than? Its arrays of 1 element
I think Raven's Fan had a great point asking you to elaborate on WTFWYT?
05-17-2017 10:08 AM
@rossc44 wrote:
I tried running your cleaned up code and modifying my own by changing my dynamic data converter to output a single waveform. The 20013 error continues to present.
Of course. I told you that in my message.
I have also brought your other message thread into this one since it had no replies, and that information is important to this conversation.
What is your definition of a muscle activation? Your simulated signal brings in 100 samples at 1 kHz, so 1/10th a second of data. What about that defines a muscle activation occurred? And do you expect more than 1 in that 1/10 th of a second?
Why are you extracting tone information?
Right now, you really don't have a LabVIEW question as much as a question about how you are analyzing your signal.