Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ of Myo Gesture recognition armband with LabView

Hello All,

 

I'm having tough time working with my Myo armband from labview.

I started with importing the myo's source dll functions, however it was too difficult to work with labview.

Next I decided to create a C++ dll project in Visual studio and to call the function from LV.

the functions by themselfs work fine as a win32 applicatiion console and the labview linker dll works for simple function and operations.

However, when starting to work with the myo libraries in the dll, the VI gets stucked and doesn't allows to stop the function in labview.

I attach part of the function that I tried to run when the myo::Hub doesn't executes in LV and casues the problem.

 

#include "extcode.h"

#include <array>

#include <iostream>

#include <sstream>

#include <stdexcept>

#include <string>

#include <myo/myo.hpp>

 

extern "C" {_declspec(dllexport) void testDAQ(int32_t state, int32_t *data)

{

if(state == 1)

{

*data = 1;

}

else

{

*data = 0;

}

std::cout << "performed test" << std::endl;

 

myo::Hub hub("com.example.emg-data-sample");

 

myo::Myo* myo = hub.waitForMyo(10000);

}}

 

 

Again, these lines worked well in a win32 console app, does someone had a similar problem working with other instruments?

By the way, I am far from being a  C++ expert so any comments on the programming methods are welcome.

 

Thanks

Noam

 

0 Kudos
Message 1 of 4
(6,258 Views)

What kind of troubles were you having with setting up the Myo DLL in LabVIEW? In any case, the issues you're having could be related to either your C++ code or your LabVIEW code, but I suspect your best bet would be to use the Myo DLL so if you can provide more details about the issues you had with using it in LabVIEW that would be great.

0 Kudos
Message 2 of 4
(6,221 Views)

Hi,

 

Thanks for the reply.

the error in My Codeis 

 

Error 1097 occurred at Call Library Function Node in LabMyo Controller.vi

Possible reason(s):

LabVIEW: An exception occurred within the external code called by a Call Library Function Node. The exception might have corrupted the LabVIEW memory. Save any work to a new location and restart LabVIEW.

 

In the Myo Dll I had the problem of defining some of the inputs to the baisc C API function. For example the handler input in libmyo_run was empty cluster from type *void. this gave me the following error:

 

Block Diagram Error:

subVI 'myo32.lvib:libmyo run.vi': SubVi is not executableis not executable

 

By the way I though about moving to work with the bluetooth module however the device is not recognized by labview as bluetooth. It is registered as ,Bluegiga Bluetooth Low Energy (COM4), in the device manager, should I maybe use a different protocol (VISA? GPIB?)

the libmyo SDK  - https://developer.thalmic.com/docs/api_reference/platform/index.html

 

Thanks

Noam

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

I found several previous forum posts that contain information about resolving Error 1097, but in all honesty since I'm not familiar with the library/product you're using I can't really offer much more assistance. I'd strongly recommend you get in touch with Thalmic Labs (perhaps they have a forum) to get more specific advice on these other issues you're having. The links to the posts about Error 1097 that were resolved are below, but there are several other threads related to this error as well.

 

Getting error 1097 when try to call DLL from Labview

http://forums.ni.com/t5/LabVIEW/Getting-error-1097-when-try-to-call-DLL-from-Labview/td-p/2352734

 

Error 1097 calling dll

http://forums.ni.com/t5/LabVIEW/Error-1097-calling-dll/td-p/1662080

 

Best of luck.

0 Kudos
Message 4 of 4
(6,183 Views)