LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Making use of an Arduino Library using LV

Hi everyone,

I am working on a neurofeedback project and I am using an EEG module which picks up data from the scalp and sends it as data packets to represent the values picked up from the brain.

I have found an Arduino Library which helps greatly to parse these packets to meaningful data. Unfortunately, I am not able to add an Arduino board to my project. So I was wondering if there is any way to take advantage of that Arduino library within the LV without actually adding any new hardware.

I will be very grateful if anyone out there has a solution for this problem.

All best,

Maysam

PS: Here's the library I mentioned, if studying it actually helps:

https://github.com/kitschpatrol/Brain

0 Kudos
Message 1 of 5
(4,538 Views)

Since it appears that the sensor communicates via serial, you'll only need a USB to serial converter for it to work with LabVIEW.

You have two options:  port the code to LabVIEW (using NI-VISA) or somehow build a DLL in C/C++ using  a modified version of Brain.h/.cpp (removing any Arduino stuff and adding DLL necessities) and use that DLL in LabVIEW.

Both options require a decent amount of code writing and if your project is in LabVIEW and won't likely change, I'd go with porting it to LabVIEW (of course, I'm a LabVIEW guy so my opinion is probably biased ).  It might even be easier to write the LabVIEW based on the original documenation of the device (assuming it's decently well documented).

0 Kudos
Message 2 of 5
(4,122 Views)

First of all, I must thank you for your response, I really do appreciate your help

Yeah, that's correct, the sensor communicates via serial protocol and currently I am using both a Serial-to-USB converter and a BT module to communicate with the module.

About the options you mentioned, both of them look legit. I too prefer to go with the LV solution, but then the next problem I will face would be how to "port" the code to LV? Does NI-VISA have a solution prepared for this situation or do I have to go through complicated stuff? (Honestly, I am fairly new to this whole programming and developing with LV, so...yeah!)

0 Kudos
Message 3 of 5
(4,122 Views)

The porting process is actually simple, the actual doing it might not feel

simple. It's just a matter of understanding what the code does and

replicating that in LabVIEW using the tools provided by LabVIEW instead of

the tools provided by Arduino. However, since the languages are different,

doing a word for word port might not be best.

Ultimately, I would study the code to determine what they are actually

doing (a high level perspective) and then write new LabVIEW code based on

that knowledge.

0 Kudos
Message 4 of 5
(4,122 Views)

That seems like a great idea!

Thanks a lot for your time...much appreciated!

0 Kudos
Message 5 of 5
(4,122 Views)