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: 

eeg trigger through usb ttl module

Solved!
Go to solution

I need to send a trigger during eeg data acquisition. The eeg PC is connected to a laptop where LabView is installed. The laptop does not have a parallel port, therefore I am using a USB TTL Module to connect the two PCs.

I am wondering whether there is a way of sending a trigger from LabView through the USB module, as I do not have any DAQ devices...I have also tried using the VISA VI but it does not work (or maybe I am not writing correctly the buffer). Is there anybody able to help?

thanks in advance!

 

Flavia 

0 Kudos
Message 1 of 11
(4,776 Views)

It's probably possible. Can you clarify some things?

  1. The EEG PC is a full PC? And you're connecting to it because you can't install LabVIEW there? How do you trigger the EEG from that PC (ignoring LabVIEW)?
  2. This USB TTL module connects the two PCs. Are you wanting to use it for some form of data communication, or just to send a trigger? How is the EEG data recovered? Using the same TTL pulses?
  3. Have you tested any working communication yet or is it still not operating in any form?

GCentral
0 Kudos
Message 2 of 11
(4,744 Views)
  1. The EEG PC is a full PC? YES, IT IS A FULL PC
  2. And you're connecting to it because you can't install LabVIEW there? NO, I CONNECT THE LAPTOP TO THE EEG BECUASE WITH THE LAPTOP I AM CONTROLLING A DEVICE AND I WANT TO SEND A TRIGGER TO THE EEG EVERY TIME THE DEVICE IS ON
  3. How do you trigger the EEG from that PC (ignoring LabVIEW)? I HAVE NEVER USED MY LAPTOP TO TRIGGER THE EEG, BUT I HAVE PREVIOUSLY USED E-PRIME TO TRIGGER THE EEG FROM ANOTHER PC (THROUGH PARALLEL PORT). AS IN MY LAPTOP I DO NOT HAVE PARALLEL PORT, I HAVE CONNECTED THE TWO COMPUTERS VIA USB TTL MODULE AND USING ITS SOFTWARE I AM ABLE TO TRIGGER THE EEG (THEREFORE THE USB TTL MODULE WORKS FINE TO TRIGGER THE EEG).
  4. This USB TTL module connects the two PCs. Are you wanting to use it for some form of data communication, or just to send a trigger? JUST TO SEND A TRIGGER
  5. How is the EEG data recovered? Using the same TTL pulses? NO, THE EEG DATA IS RECORDED USING BRAIN VISION RECORDER
  6. Have you tested any working communication yet or is it still not operating in any form? USING THE SOFTWARE OF THE USB TTL MODULE I AM ABLE TO TRIGGER THE EEG
0 Kudos
Message 3 of 11
(4,725 Views)

Great - thank you for the full answers. The question is now much clearer to me.

It now becomes a question of "How do I use LabVIEW to instruct a USB-TTL device to send a digital pulse?" - is that correct?

 

Can you supply some information about the TTL device? You say it already has its own software through which you have successfully triggered the EEG. If this software is all you need to replace it should probably be quite doable. A model number (for the TTL device) would be helpful, a manual or link to a manual would be even better.


GCentral
0 Kudos
Message 4 of 11
(4,721 Views)

It now becomes a question of "How do I use LabVIEW to instruct a USB-TTL device to send a digital pulse?" - is that correct? EXACTLY!

 

Can you supply some information about the TTL device? You say it already has its own software through which you have successfully triggered the EEG. If this software is all you need to replace it should probably be quite doable. A model number (for the TTL device) would be helpful, a manual or link to a manual would be even better.

 

THIS IS THE LINK TO THE USB MODULE.

http://www.blackboxtoolkit.com/usbttl.html

 

THANKS A LOT FOR YOUR HELP!

0 Kudos
Message 5 of 11
(4,719 Views)

I'm uploading a VI I wrote that might work for you - it creates a connection using the VISA Serial nodes included with NI-VISA (but it won't tell you if you haven't installed that - so check!) and should have appropriate parameters for your device.

 

I'm also posting a snippet below - this is because the Code Capture Tool allows me to backsave a snippet, and it's easier than actually backsaving the VI. I do this because I'm not sure if you have LabVIEW 2017 installed (and if not, you won't be able to open the attachment). You can drag and drop the snippet onto a block diagram.

 

The code is written with the idea of you being able to make it into a subVI quite easily - you'd need to remove the loop and event structure and perhaps use a case structure to check the inputs and then use the same code that is currently in the Value Change event to make the operation, if the "Send Button" was true - this could be connected in a calling VI using a loop or event structure.

 

SerialOutputExample_BD.png

 

p.s. You should set the value of VISA Port before you press run.


GCentral
0 Kudos
Message 6 of 11
(4,716 Views)

thanks!

I have tried to drag and drop it onto a block diagram but it does not allow me to do that. would you be able to save it in a previous version? (I have labview 2013, therefore I am not able to open your attachment).

 

 

0 Kudos
Message 7 of 11
(4,691 Views)

Did it give an error message or dialog? The snippet was saved for 2013 so that should work (even though the attachment won't). Apparently some browsers cause trouble, so if it isn't working for you try saving the image to your computer and dragging from explorer.

 

The attachment below should be 2013 compatible.


GCentral
0 Kudos
Message 8 of 11
(4,685 Views)

Thank you so much!

I have just slightly changed your script and now it works perfectly well!!

 

thanks again!!

 

Flavia

0 Kudos
Message 9 of 11
(4,673 Views)
Solution
Accepted by topic author fla1980

@fla1980 wrote:

Thank you so much!

I have just slightly changed your script and now it works perfectly well!!

 

thanks again!!

 

Flavia


Fantastic. Please use the Mark as Solution tool to show this thread is solved if you've managed to get the problem working. This will allow future readers to quickly jump to the post which solved the problem, and also visually marks the thread as solved in the parent (LabVIEW) board.

 

Some people would also suggest kudos are a good way to give thanks, but me saying that here would really be quite self-serving 😉


GCentral
Message 10 of 11
(4,663 Views)