Empirisoft Support

    Welcome to Empirisoft Support
Results 1 to 14 of 14

Thread: ttl signals vs. sending receiving serial data (case 15992)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2014
    Posts
    16

    ttl signals vs. sending receiving serial data (case 15992)

    Hello,

    I am currently trying to create an experiment in which media lab sends triggers to a third party program (Testbench- a program used for Emotiv EEG headsets) that receives data from a virtual serial port (Eltima) at different instances in the experiment. I just wanted to better understand the difference between ttl signals and using the comport.txt file to send triggers. In the past, our lab here at York University has used the comport.txt method, however looking at previous files they truncated the lines such that the file looks like this:

    comPort, baudRate, parity, dataBit, stopBit
    4,19200,n,8,1
    input code (1-255), response value (1-12)
    0,0

    whereas in the manual example, there are several other numbers following the third line. Is there a simple way to explain how this works so I might edit the comport.txt file to best fit my needs? If not, can I use ttl signals instead? How does that parameter work? Your help, as always, is very much appreciated!

    Thanks
    Alex
    Last edited by jason_reed; 09-09-2014 at 06:39 PM.

  2. #2
    Join Date
    Feb 2013
    Posts
    1,093
    Alex,

    If you want to send ttl signals in MediaLab, all you need to do is use the ttl signal functionality in the parameter(s) field of the item in your .que file. You can find instructions about this here http://www.empirisoft.com/medialab/h...meters.htm#ttl.

    Use of the comport.txt file is for MediaLab receiving ttl signals. If that is something you wish, I'll be happy to help there as well.
    Jason Reed
    Empirisoft Software Support Specialist

  3. #3
    Join Date
    Sep 2014
    Posts
    16
    Quote Originally Posted by jason_reed View Post
    Alex,

    If you want to send ttl signals in MediaLab, all you need to do is use the ttl signal functionality in the parameter(s) field of the item in your .que file. You can find instructions about this here http://www.empirisoft.com/medialab/h...meters.htm#ttl.

    Use of the comport.txt file is for MediaLab receiving ttl signals. If that is something you wish, I'll be happy to help there as well.
    Hello Jason,

    Thanks again for your timely reply! I have discovered the issue. We have been sending ttl signals unknowingly. The parameter used is <value> and it properly sends a trigger to our program at the onset of the stimulus. However, oddly, despite not having placed any location or duration it seems to work just fine. Once I do enter a value and a duration for instance <1:9600:5>, Media Lab no longer sends the signal. My question is, how would I determine what serial port location I will be sending the ttl signal to? Somehow just <1> works, but when I try to enter a value for the location, which I believe is either 9600, or 19200 based on this image of our virtual serial port emulator, the ttl signal no longer sends.medialab img.gif

    Again, your responses have been incredibly helpful and I can't stress enough how much I appreciate them!

    Alex

  4. #4
    Join Date
    Feb 2013
    Posts
    1,093
    Alex,

    Could you please clarify a few points for me?

    1) Is everything actually functional with your experiment or is there an issue of something broken?
    2) Could you please elaborate on what you mean by saying that the program properly sends a trigger at the onset of the stimulus? Does that mean the COM port? Does only the value of <1> work when used in the parameters field of a MediaLab item or do other numbers by themselves work or not? Or does 1 not work when adding port address or time?

    Also, the numbers you mentioned are not port addresses, but most likely baud rates. I'm not that familiar with virtual ports, but you should be able to find the addresses like normal ports. Here's how to find it with ports actually installed on your computer:

    1) Click the Start button.
    2) Click on Control Panel.
    3) In that Control Panel window, click on Device Manager.
    4) Click on Ports to expand it and double-click on the specific port for which you want to know the address.
    5) Click the Resources tab in the new window. Look for the entry that reads I/O Range. To the right of it in the Settings column you will see a potential range of port address in hexidecimal value (e.g., 60E0 to 60E7). If you put them individually in a hex to decimal converter like this one http://www.binaryhexconverter.com/he...imal-converter you should get the decimal values. You can then try each of these decimal values in your DirectRT .csv input file to see if it sends the ttl signal value defined in your stim column to your external devices.

    See if there is something similar for your virtual ports and let me know if you have any questions.
    Last edited by jason_reed; 01-05-2015 at 11:31 AM.
    Jason Reed
    Empirisoft Software Support Specialist

  5. #5
    Join Date
    Sep 2014
    Posts
    16
    Hello Jason,

    So I have extensively looked into this, and it seems that the virtual serial port does not have an address. In the control panel and under ports, it doesn't have a resources tab- I am assuming it lacks a location because it is a virtual port!

    However it is odd that it send the TTL files anyways. The equipment all works perfectly fine, and adding a comport.txt file allows me to use the <> parameters to input a TTL signal, but only if I put a single character into it; for example <c> sends the trigger 99. I believe its an ASCII conversion. If you could give me some more information as to why the TTLs would work, that would be very helpful! As I said though, the format of <100:888:5> will not work, presumably because the port address location is incorrect. I asked the developers of the virtual serial port software and they said there is no way to determine the HEX port address of the ports.

    Just some more information about our setup, we have a program that creates virtual serial port connection, it allows two programs to communicate without a physical serial port. One of our pieces of equipment is a wireless EEG headset, it received markers from Medialab via this virtual serial port program. It creates a pair of ports called COM4 and COM5, where COM4 sends signals and COM5 receives. I believe with the comport.txt file, I have to edit the first number to 4 in order for the TTLs to send. Let me know if this all makes sense!

    Alex

    Quote Originally Posted by jason_reed View Post
    Alex,

    Could you please clarify a few points for me?

    1) Is everything actually functional with your experiment or is there an issue of something broken?
    2) Could you please elaborate on what you mean by saying that the program properly sends a trigger at the onset of the stimulus? Does that mean the COM port? Does only the value of <1> work when used in the parameters field of a MediaLab item or do other numbers by themselves work or not? Or does 1 not work when adding port address or time?

    Also, the numbers you mentioned are not port addresses, but most likely baud rates. I'm not that familiar with virtual ports, but you should be able to find the addresses like normal ports. Here's how to find it with ports actually installed on your computer:

    1) Click the Start button.
    2) Click on Control Panel.
    3) In that Control Panel window, click on Device Manager.
    4) Click on Ports to expand it and double-click on the specific port for which you want to know the address.
    5) Click the Resources tab in the new window. Look for the entry that reads I/O Range. To the right of it in the Settings column you will see a potential range of port address in hexidecimal value (e.g., 60E0 to 60E7). If you put them individually in a hex to decimal converter like this one http://www.binaryhexconverter.com/he...imal-converter you should get the decimal values. You can then try each of these decimal values in your DirectRT .csv input file to see if it sends the ttl signal value defined in your stim column to your external devices.

    See if there is something similar for your virtual ports and let me know if you have any questions.

  6. #6
    Join Date
    Feb 2013
    Posts
    1,093
    So if I understand, you seem to be able to send and receive signals using MediaLab and your equipment, even though your computers have no actual ports and communicate using only virtual reports? Is that correct?

    Furthermore, you are still trying to figure out how to use the comport.txt and/or the <value:location:duration> in the parameters field to control the receiving and sending of ttl signals. Is this the primary unresolved issue you still have?

    Please tell me the full version number (i.e., 20xx.x.xxx) of your copy of MediaLab. You can find it by opening MediaLab and selecting Help>About MediaLab from the main menu bar.
    Jason Reed
    Empirisoft Software Support Specialist

Similar Threads

  1. Sending TTL signals to ASL eyetracker (case 16133)
    By daniellecornish in forum DirectRT v2018: Troubleshooting
    Replies: 1
    Last Post: 09-16-2014, 12:17 PM
  2. Receiving TTL Signals from 2 Response Boxes (case 13508)
    By lisagerm in forum DirectRT v2018: Troubleshooting
    Replies: 8
    Last Post: 03-25-2014, 08:20 AM
  3. Sending TTL Signals (case 472)
    By jbeylev in forum DirectRT Older Versions: General Questions
    Replies: 2
    Last Post: 04-01-2012, 12:05 PM
  4. Sending ttl code to ASL eyetracker data file
    By sadler in forum DirectRT Older Versions: Troubleshooting
    Replies: 4
    Last Post: 03-10-2009, 06:27 PM
  5. Using a comma when receiving TTL signals?
    By jarvis24 in forum DirectRT Older Versions: Troubleshooting
    Replies: 1
    Last Post: 10-02-2006, 09:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •