From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

EMG acquisition program using measurement computing 1208fs

Solved!
Go to solution

Hello,

 

My lab is currently in the process of switching from DASYLab to LabVIEW for our data acquisition. We collect EMG as well as force and accelerometer data, and we use the measurement computing 1208fs DAQ to do so.

 

So far, I have been able to successfully read in an EMG signal from a single electrode using the examples provided by measurement computing, and I am able to control which electrode is being read in. However, as soon as I try to read multiple electrodes in at the same time, I no longer get a live feed of the EMG data, my program freezes, and I eventually get a 1003 error. I am not sure whether or not this has to do with how my program is formatted, as I have never written an acquisition program before (only processing programs), so I am wondering if anyone has any advice on how to write this acquisition program using measurement computing's VIs in a way that will allow me to acquire live data from multiple electodes (8+) at the same time without major lag. I'd like to sample at 2000 Hz.

 

In addition, if anyone has already transitioned from DASYLab to LabVIEW for data acquisition and is willing to share their code, that would be much appreciated!

 

I've attached my code for help (I apologize in advance for any simple mistakes I've made).

 

Thank you!

Ben

0 Kudos
Message 1 of 6
(3,117 Views)

For a start, you are creating and closing the references on each iteration. You would only want the ULx Read vis to be inside the loop. Create - Timing - Start should be before the loop and Close after the loop.

Message 2 of 6
(3,082 Views)
Solution
Accepted by topic author bcconner

Most AI DAQ devices are set up for N Chan N Sample operation (especially if they are driven by the same clock).  In your Configure Channels, you specify (for example) Channels TA, LG, MG, SOL, BF, and VL, there is a single Configure Channel, a single Sample Clock, a single Start Task, a single Analog Read (N Chan, N Samp), and you get out an Array of Waveforms that, if you want, you can split up into TA, LG, etc.  Makes your DAQ loop much simpler (only a single Error Line).

 

Bob Schor

Message 3 of 6
(3,079 Views)

Per Hult,

 

Thank you for the reply! I had tried only having the ULx Read VI in the while loop, but for some reason when I do this there is no signal. I have to have all of the VIs in the while loop in order to acquire a signal- any idea why this might be happening? I've attached a sample code. After utilizing Bob's advice about using an NChan NSamp configuration, there is little to no lag, but I would still like to improve the efficiency. 

 

Thanks again for the help!

-Ben

 

0 Kudos
Message 4 of 6
(3,065 Views)

Hi Bob,

 

This solution worked extremely well! There is little-to-no lag now with my acquisition. I've attached the new code to make sure that I am following your advice exactly. Let me know.

 

Thanks again!

Ben

0 Kudos
Message 5 of 6
(3,064 Views)

Good norning from Italy. Thanks a lot for the previous codes. I was wondering if it was possible to receive also the list of components and devices and procedures I must follow. I admit that the only programming language that I know is related to the Logo! (It was supposed to be a Siemens device, wasn't it?). I am begging all of you as I would like to give my Phd thesis doing a multichannel EMG prediction of cycling in order to see whether or not is needed a physiotherapy. Sorry in advance for the waste of time and my non-polite english language. Hope to listen you again and thanks a lot. Ps If it is better, I leave my phone for direct communication: (+39)3292342438

 

 

 

 

0 Kudos
Message 6 of 6
(1,525 Views)