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
    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.

  2. #2
    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

  3. #3
    Join Date
    Sep 2014
    Posts
    16
    Hi Jason,

    Yes that is correct. The signals are being sent from Medialab to our EEG recording program through our virtual port program and I am not sure how or why it is working. The <> parameter sends the signals, but not the values that I input- for example I placed the parameter <7> into one of my que files, and it is received in my program as 55.

    I just wanted to know how the comport.txt file works, I have read through this guide:

    http://www.empirisoft.com/medialab/h...htm#serialdata

    But it seems to only be a basic overview of the file and discusses more of receiving data then sending it. Also just to note, changing the comPort parameter in the line:

    comPort, baudRate, parity, dataBit, stopBit
    1,19200,n,8,1

    Seems to be important. That is, the virtual port program creates a virtual connection for, say, COM2 and COM4. I would setup my EEG recording program to COM4 so that it receives all data coming from COM2. Then I would go into the comport.txt file and change the first value in line 2 to the number 2, so that Medialab sends signals to COM2. Any other value would not work properly.

    Finally, the version number is 2012.4.119

    Hope that is enough information! Let me know if you need anything else.

    Alex

    Quote Originally Posted by jason_reed View Post
    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.

  4. #4
    Join Date
    Sep 2014
    Posts
    16
    I forgot to add... The main reason why I am asking this is because I would like to run a DirectRT script within Medialab that will also send TTLs. I was hoping that the <value:location:duration> method would somehow work, so that I can simply use the location for the DirectRT script. However it seems that there isn't a location associated with the comport (maybe because it is virtual?) and so I want to figure out how/why the comport.txt method is working, and if I can somehow use that knowledge to send TTLs via DirectRT as well!

    Alex


    Quote Originally Posted by atran View Post
    Hi Jason,

    Yes that is correct. The signals are being sent from Medialab to our EEG recording program through our virtual port program and I am not sure how or why it is working. The <> parameter sends the signals, but not the values that I input- for example I placed the parameter <7> into one of my que files, and it is received in my program as 55.

    I just wanted to know how the comport.txt file works, I have read through this guide:

    http://www.empirisoft.com/medialab/h...htm#serialdata

    But it seems to only be a basic overview of the file and discusses more of receiving data then sending it. Also just to note, changing the comPort parameter in the line:

    comPort, baudRate, parity, dataBit, stopBit
    1,19200,n,8,1

    Seems to be important. That is, the virtual port program creates a virtual connection for, say, COM2 and COM4. I would setup my EEG recording program to COM4 so that it receives all data coming from COM2. Then I would go into the comport.txt file and change the first value in line 2 to the number 2, so that Medialab sends signals to COM2. Any other value would not work properly.

    Finally, the version number is 2012.4.119

    Hope that is enough information! Let me know if you need anything else.

    Alex

  5. #5
    Join Date
    Feb 2013
    Posts
    1,093
    If you want to send a ttl signal with a virtual port, you might be able to by using DirectRT 2014. It has the feature of using a comport.txt function like that of MediaLab that might be compatible with virtual ports.

    If you can use DirectRT 2014, I would be happy to give you more information about the details of the process.
    Jason Reed
    Empirisoft Software Support Specialist

  6. #6
    Join Date
    Sep 2014
    Posts
    16
    Hi Jason,

    Thanks for your reply! If that is possible that would be great. I am guessing we would have to purchase a license for the 2014 version?

    Quote Originally Posted by jason_reed View Post
    If you want to send a ttl signal with a virtual port, you might be able to by using DirectRT 2014. It has the feature of using a comport.txt function like that of MediaLab that might be compatible with virtual ports.

    If you can use DirectRT 2014, I would be happy to give you more information about the details of the process.

  7. #7
    Join Date
    Feb 2013
    Posts
    1,093
    You could download and install a trial copy of DirectRT 2014 first to see if this works. Just download a copy from the Empirisoft download page here: http://empirisoft.com/Download.aspx?index=4. Send the 14-character D-code to me at support@empirisoft.com and I can get you a free 21-day trial code.

    Using DirectRT 2014, you can set up a DirectRT .csv input file to send ttl signals as normal (see http://www.empirisoft.com/directrt/h...tl_signals.htm). It doesn't matter what you type for the port address in the loc cell or the number in the time cell after the stim cell with ttl: in it.

    This is because you will include a .txt file named comport.txt in the same folder as the .csv input file you create. DirectRT 2014 will ignore the values in the loc and time cells as long as the comport.txt file is in the same file folder as the .csv input file that wants to send ttl signals.

    When you create your comport.txt file, you will need to define the the proper number to reflect the comport you want the computer to use to send the ttl signal. This is based off of the same functionality in MediaLab used for sending and receiving data over serial ports (for an explanation and example of the comport.txt file see http://www.empirisoft.com/medialab/h...s_features.htm).
    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
  •