Millisecond Forums

Ports kind of working but only after running Matlab, any ideas?

https://forums.millisecond.com/Topic35462.aspx

By AndrewPapale - 6/16/2023

Hi Inquisit Team,

We've gotten Inquisit to send parallel port commands to our EEG system using the following code.  However, we discovered during troubleshooting that the port is only 'activated' correctly after running a Matlab script that outputs to the same parallel port.  I'm thinking that Matlab has some configuration setting that we are not thinking of that is getting saved.  Any help is appreciated.  The trigger needs to be configured for a BIOsemi EEG setup with:

Data Rate: 115200
Data Bits: 8
Stop Bits: 1
Parity: none
Flow Control: off
https://www.biosemi.com/faq/USB%20Trigger%20interface%20cable.htm


Again, we got it to work with Inquisit, so it's not a problem with BioSemi or cables or anything like that, but only after running Matlab to do (presumably the exact same thing) first.

<defaults>
  combaudrates = (COM4 = 115200)
</defaults>

<port sendtrialstart>
  port = COM4
 items = (10)
 subport = data
</port>

<trial experiment>
/ stimulustimes = [ sendtrialstart, *other stimuli*]
</trial>



Also as a plug for Inquisit vs Psychtoolbox, the timing jitter for Inquisit was far superior on our setup, coming in at ~1-2ms of jitter compared to 20-40ms for PTB.

Best,
Andrew
By Dave - 6/16/2023

AndrewPapale - 6/16/2023
Hi Inquisit Team,

We've gotten Inquisit to send parallel port commands to our EEG system using the following code.  However, we discovered during troubleshooting that the port is only 'activated' correctly after running a Matlab script that outputs to the same parallel port.  I'm thinking that Matlab has some configuration setting that we are not thinking of that is getting saved.  Any help is appreciated.  The trigger needs to be configured for a BIOsemi EEG setup with:

Data Rate: 115200
Data Bits: 8
Stop Bits: 1
Parity: none
Flow Control: off
https://www.biosemi.com/faq/USB%20Trigger%20interface%20cable.htm


Again, we got it to work with Inquisit, so it's not a problem with BioSemi or cables or anything like that, but only after running Matlab to do (presumably the exact same thing) first.

<defaults>
  combaudrates = (COM4 = 115200)
</defaults>

<port sendtrialstart>
  port = COM4
 items = (10)
 subport = data
</port>

<trial experiment>
/ stimulustimes = [ sendtrialstart, *other stimuli*]
</trial>



Also as a plug for Inquisit vs Psychtoolbox, the timing jitter for Inquisit was far superior on our setup, coming in at ~1-2ms of jitter compared to 20-40ms for PTB.

Best,
Andrew

What's the exact Inquisit build you are using? See Tools -> System Information.
By AndrewPapale - 6/16/2023

Dave - 6/16/2023
AndrewPapale - 6/16/2023
Hi Inquisit Team,

We've gotten Inquisit to send parallel port commands to our EEG system using the following code.  However, we discovered during troubleshooting that the port is only 'activated' correctly after running a Matlab script that outputs to the same parallel port.  I'm thinking that Matlab has some configuration setting that we are not thinking of that is getting saved.  Any help is appreciated.  The trigger needs to be configured for a BIOsemi EEG setup with:

Data Rate: 115200
Data Bits: 8
Stop Bits: 1
Parity: none
Flow Control: off
https://www.biosemi.com/faq/USB%20Trigger%20interface%20cable.htm


Again, we got it to work with Inquisit, so it's not a problem with BioSemi or cables or anything like that, but only after running Matlab to do (presumably the exact same thing) first.

<defaults>
  combaudrates = (COM4 = 115200)
</defaults>

<port sendtrialstart>
  port = COM4
 items = (10)
 subport = data
</port>

<trial experiment>
/ stimulustimes = [ sendtrialstart, *other stimuli*]
</trial>



Also as a plug for Inquisit vs Psychtoolbox, the timing jitter for Inquisit was far superior on our setup, coming in at ~1-2ms of jitter compared to 20-40ms for PTB.

Best,
Andrew

What's the exact Inquisit build you are using? See Tools -> System Information.

Inquisit 6.6.1 64 bit build 6581 on Windows NT 10.0
By Dave - 6/16/2023

AndrewPapale - 6/16/2023
Dave - 6/16/2023
AndrewPapale - 6/16/2023
Hi Inquisit Team,

We've gotten Inquisit to send parallel port commands to our EEG system using the following code.  However, we discovered during troubleshooting that the port is only 'activated' correctly after running a Matlab script that outputs to the same parallel port.  I'm thinking that Matlab has some configuration setting that we are not thinking of that is getting saved.  Any help is appreciated.  The trigger needs to be configured for a BIOsemi EEG setup with:

Data Rate: 115200
Data Bits: 8
Stop Bits: 1
Parity: none
Flow Control: off
https://www.biosemi.com/faq/USB%20Trigger%20interface%20cable.htm


Again, we got it to work with Inquisit, so it's not a problem with BioSemi or cables or anything like that, but only after running Matlab to do (presumably the exact same thing) first.

<defaults>
  combaudrates = (COM4 = 115200)
</defaults>

<port sendtrialstart>
  port = COM4
 items = (10)
 subport = data
</port>

<trial experiment>
/ stimulustimes = [ sendtrialstart, *other stimuli*]
</trial>



Also as a plug for Inquisit vs Psychtoolbox, the timing jitter for Inquisit was far superior on our setup, coming in at ~1-2ms of jitter compared to 20-40ms for PTB.

Best,
Andrew

What's the exact Inquisit build you are using? See Tools -> System Information.

Inquisit 6.6.1 64 bit build 6581 on Windows NT 10.0

Hmm, that's weird. I recall there being an issue with some FTDI chip-based USB-to-serial devices (the BioSemi USB interface is FTDI-based) in some earlier versions / builds, along the lines of what you described (only sending when initialized by some other application prior), but not with the current build (the one you have installed).

Are you using the default Windows driver or do you have the one provided by FTDI installed (linked at the very bottom of https://www.biosemi.com/faq/USB%20Trigger%20interface%20cable.htm )? It may be worth trying the other one, but other than that I'm afraid the only immediate workaround is the one you've been using.