LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Deploying thinkgear.lvlib in NI-myRIO-1900-030c1981

Solved!
Go to solution

Hmmm, I've found that ->

 

"The ThinkGear Connector (TGC) is an executable that provides a daemon-like service that manages communications with ThinkGear devices, such as the MindWave and MindWave Mobile, that are connected to the computer. The TGC runs continuously in the background and keeps an open socket on the local user's computer, allowing applications to connect to it and receive information from the connected ThinkGear devices. This means that any application in any language that can open and read from sockets (such as Flash's ActionScript3 and other scripting languages) can connect and receive data from NeuroSky headsets."

 

Now it begs the question... how the heck should we call the data in MYRIO (in LabVIEW under windows is working spot on). But as soon as I try to deploy anything in myRIO... **bleep** starts to happen... errors etc... >,<

0 Kudos
Message 11 of 19
(1,474 Views)

Hi Quantum,

 

how the heck should we call the data in MYRIO

I see two options:

- find an executable/driver compatible for LINUX (or source code you can compile into a LINUX executable)

- connect that hardware to a PC and have ThinkGear run on the PC. Write a LabVIEW tool to acquire data from your hard and have that tool run on your PC. Communication between this tool and your myRIO using any kind of LAN protocol…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 12 of 19
(1,472 Views)

I think Gerd is correct and you will need to either find or create alternative drivers for your device, or keep the device connected to a Windows PC and transmit the data where you need it. 

 

Just searching "ThinkGear" and "Linux" turns up several avenues. 

 

http://developer.neurosky.com/docs/doku.php?id=thinkgear_connector_tgc

https://github.com/cristhoper/thinkgear-linux

https://pypi.python.org/pypi/thinkgear/0.2

http://www.ni.com/white-paper/53059/en/

 

The last is a link to Python resources for LabVIEW.

 

You might be able to compile the driver you need. 

 

But if not, there's always the option of relaying the data from small Windows PC.

 

---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 13 of 19
(1,444 Views)

Okay, pallen, thanks for the suggestions. I've looked into it and it doesn't really work for me. I think I'm gonna try to follow this advice:

 

"- connect that hardware to a PC and have ThinkGear run on the PC. Write a LabVIEW tool to acquire data from your hard and have that tool run on your PC. Communication between this tool and your myRIO using any kind of LAN protocol…"

 

Could I please ask what exactly do you mean? I mean I get the main idea, it's just I'm learning labview at the moment and I have the sense that you are suggesting a tool which I don't know about.

By the way I've tried to "listen" to the virtual COM port, but myRIO doesn't wanna "hear" anything but it's physical "A" and "B" ports. So... how can the RIO "listen" to my program, which is running on LabVIEW "windows mode"?

Basic TCP/IP as described here? -> http://www.ni.com/white-paper/2710/en/ 

Pfhhh... I hope it makes sense... >,<

0 Kudos
Message 14 of 19
(1,416 Views)

Hi Quantum,

 

LabVIEW comes with a lot of example VIs and projects!

In the example projects you will find recommendation on how to communicate between a Windows host and a Realtime target: see File menu -> "New…"

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 15 of 19
(1,410 Views)

Basic TCP is a good place to start. 

 

http://forums.ni.com/t5/Example-Program-Drafts/Simple-TCP-IP-Protocol-Example/ta-p/3523412

 

http://www.ni.com/tutorial/11197/en/

 

If you're new to LabVIEW, there's going to be some reading and testing involved.  But the community is established enough that a good Google search usually sends you in the right direction.

---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 16 of 19
(1,411 Views)

❤️ "...see File menu -> "New…""

Just... ❤️

BUT... there's always a but... 🙂

So I go to setup Project -> Project from Wizard -> Real-Time Project. I set it up it's easy as....

Then I run the VI and it runs perfectly fine on "My Computer" VI and does not run on the MyRIO. It runs, but it doesn't transfer the data maybe? I mean.. I'm looking at a live graph values (raw eeg data) on the "My Computer" VI and it's spot on... but the same VI doesn't do anything on the "MyRIO" VI. It runs, but it doesn't give me any values. Suggestions? 🙂 I've tried to add small delay so it delays the data coming in, and while the graph value acquisition slows down, it doesn't affect the MyRIO VI (ie the graph doesn't show anything again). My reasoning behind this was -> RAM, Processing Speed or Data Transfer (from the PC to the RIO) although all of those should be sufficient for live raw eeg data but hey... you never know. 🙂

P.S. So on the picture below, the VI on the left is "My Computer" and the one on the right is the "MyRIO". It shows empty/black graph up until I change something (like the timer) and upgrade both VIs (otherwise wouldn't let you run them) then it changes to the current state of the My Computer graph and doesn't change anymore at all.

0 Kudos
Message 17 of 19
(1,404 Views)

Hi Quantum,

 

as I work with "usual" cRIO targets instead of the myRIO I don't have the "special" myRIO stuff installed.

But when opening this "New…" dialog I have the option to create a new "Realtime Project". When using this option I get a ready-to-use project for a realtime target with ready-to-start communication between RT target and PC host. It uses shared variables, but once you understand how to communicate between PC and RT you can replace those variables with any other kind of network protocol you like to use!

 

I'm looking at a live graph values (raw eeg data) on the "My Computer" VI and it's spot on... but the same VI doesn't do anything on the "MyRIO" VI.

Why do you run the "same" VI on the RT target, when it is meant to be run on the PC host???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 18 of 19
(1,393 Views)
Solution
Accepted by topic author jitendra63

"Why do you run the "same" VI on the RT target, when it is meant to be run on the PC host???"

 

Gotcha! 🙂 Solved it... sort of... 🙂

Used a global variable. Now the My PC reads the headset data, saves the data to the global variable and then I call the globvar to MyRIO with simple while loop. I mentioned "sort of" and this is what I mean... when the data comes, the data is not exactly as the main VI... I mean... the graph on the main VI looks very different from the graph I've created for the MyRIO VI. When I scale the graph the same as the original (50k) it doesn't show anything, but if I scale it down to 1 it shows fast fluctuating line across the graph. I'll play with it a bit more to see if I can sort that out... but I think it will be enough to write a program which controls two DC motors according to the data coming in.... 😉

God dang it Gerd... you have a pint on me! 🙂

0 Kudos
Message 19 of 19
(1,384 Views)