Millisecond Forums

Inquist sending TTL signals to Acqknowledge

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

By sazevedo91 - 1/14/2014

Hi,

I'm conducting a psychophys experiment using Acqknowledge and Biopac to record EMG whilst viewing stimuli presented in Inquisit 4.
Basically I would like Inquisit to send biomarkers to Acqknowledge every time a new stimulus is presented. I'm having trouble doing so.


Below is my script for the TTL parallel signal. I have 16 stimuli presentations where I would like Inquisit to send biomarkers to acqknowledge. 

*************************************************************
TTL Parallel Signal
*************************************************************

<port targetsignalA>
/ port = lpt1
/ subport = data
/ items = ("00000001")
</port>

<port targetsignalB>
/ port = lpt1
/ subport = data
/ items = ("00000101")
</port>

<port targetsignalC>
/ port = lpt1
/ subport = data
/ items = ("00010101")
</port>

<port targetsignalD>
/ port = lpt1
/ subport = data
/ items = ("01010101")
</port>

<port targetsignalE>
/ port = lpt1
/ subport = data
/ items = ("11010101")
</port>

<port targetsignalF>
/ port = lpt1
/ subport = data
/ items = ("11111010")
</port>

<port targetsignalG>
/ port = lpt1
/ subport = data
/ items = ("11111101")
</port>

<port targetsignalH>
/ port = lpt1
/ subport = data
/ items = ("10101010")
</port>

<port targetsignalI>
/ port = lpt1
/ subport = data
/ items = ("10010010")
</port>

<port targetsignalJ>
/ port = lpt1
/ subport = data
/ items = ("10010011")
</port>

<port targetsignalK>
/ port = lpt1
/ subport = data
/ items = ("10010110")
</port>

<port targetsignalL>
/ port = lpt1
/ subport = data
/ items = ("11001100")
</port>

<port targetsignalM>
/ port = lpt1
/ subport = data
/ items = ("01001001")
</port>

<port targetsignalN>
/ port = lpt1
/ subport = data
/ items = ("00011000")
</port>

<port targetsignalO>
/ port = lpt1
/ subport = data
/ items = ("00001111")
</port>

<port targetsignalP>
/ port = lpt1
/ subport = data
/ items = ("11110000")
</port>

***************************************************************************
Trials
***************************************************************************

<trial trial1>
/ stimulusframes = [1 = targetWhite]
/ trialduration = 6000
</trial> 

<trial trial2>
/ stimulusframes = [1 = targetA, targetsignalA] 
/ trialduration = 10000
</trial>

<trial trial3>
/ stimulusframes = [1 = targetB, targetsignalB]
/ trialduration = 10000
</trial> 

<trial trial4>
/ stimulusframes = [1 = targetC, targetsignalC] 
/ trialduration = 10000
</trial>

<trial trial5>
/ stimulusframes = [1 = targetD, targetsignalD]
/ trialduration = 10000
</trial> 

<trial trial6>
/ stimulusframes = [1 = targetE, targetsignalE] 
/ trialduration = 10000
</trial>

<trial trial7>
/ stimulusframes = [1 = targetF, targetsignalF]
/ trialduration = 10000
</trial> 

<trial trial8>
/ stimulusframes = [1 = targetG, targetsignalG] 
/ trialduration = 10000
</trial>

<trial trial9>
/ stimulusframes = [1 = targetH, targetsignalH]
/ trialduration = 10000
</trial> 

<trial trial10>
/ stimulusframes = [1 = targetI, targetsignalI] 
/ trialduration = 10000
</trial>

<trial trial11>
/ stimulusframes = [1 = targetJ, targetsignalJ]
/ trialduration = 10000
</trial> 

<trial trial12>
/ stimulusframes = [1 = targetK, targetsignalK] 
/ trialduration = 10000
</trial>

<trial trial13>
/ stimulusframes = [1 = targetL, targetsignalL]
/ trialduration = 10000
</trial> 

<trial trial14>
/ stimulusframes = [1 = targetM, targetsignalM] 
/ trialduration = 10000
</trial>

<trial trial15>
/ stimulusframes = [1 = targetN, targetsignalN]
/ trialduration = 10000
</trial> 

<trial trial16>
/ stimulusframes = [1 = targetO, targetsignalO] 
/ trialduration = 10000
</trial>

<trial trial17>
/ stimulusframes = [1 = targetP, targetsignalP]
/ trialduration = 10000
</trial> 

<trial trial18>
/ stimulusframes = [1 = targetWhite]
/ trialduration = 3000
</trial> 



I'm just not sure how to set up from Inquisit's end to have the two systems communicate.

I'm unsure of how to use the Parallel Port Monitor and which pins to tick, presumably in the 'data register'.
I've checked the forum for help and consulted the help function in inquisit (particularly on how to present signals through the parallel port), as well as had a look at the sample scripts.

Please help!

Thanks,
Suzanna
By Dave - 1/14/2014

The parallel port monitor is for testing communications only. It does not affect how your script works.

To reproduce the signal specified in

<port targetsignalB>
/ port = lpt1
/ subport = data
/ items = ("00000101")
</port>


via the parallel port monitor, set port number to 1, check if the port address is correct (you can find the port's address via the OS's device manager), tick Pin 2 and Pin 4 in the Data Register field (you will see the number 5 in the port field below it -- binary 00000101 is 5 in decimal) and hit Send.

Things you need to ascertain for communication to work out:

- Are port number and address correctly specified? I.e. is the port on the system in fact LPT1? Or is it LPT2, etc.?

- Is it a "real" parallel port? USB to parallel adapters are usually insufficient.

- Are your cables wired and connected correctly? You'll probably want to use a "LapLink" cable.

- Is the receiving Acqknowledge device set up and configured correctly? (I can't help with that.)

Finally, please try to be as specific as possible about any problems. I.e., is the Acqknowledge not receiving  any data? Do the wrong pins appear to be raised? etc.
By sazevedo91 - 1/14/2014

Hi,

Thank you for your swift reply!

Does this mean that I only need one <port> script for the test but would still need the 16 '<port signals>' to send a unique biomarker for each different stimulus presentation (total of 16 picture presentations)?

How do I check that the port system is LPT1 or LPT2? Is this something I do on the computer with Inquisit or Acqknowledge?
It is a real parallel port as the Acqknowledge and Inquisit are connected via a ribbon "LapLink" cable.

Apologies for not being specific. These are the issues I am facing:

1. Acqknowledge is not receiving any data from Inquisit. The channels are set-up correctly on Acqknowledge.
2. I am unsure whether this is an issue with my script or the set-up of the port through the parallel port monitor.
3. I do not understand how to have a biomarker present in acqknowledge for each photo stimulus I present in inquisit 

I'm not sure about the "wrong pins appear to be raised" example. Could you please explain this in a bit more detail? I am a novice with psychophys and am at a loss for what to do!

Thank you,
Suzanna
By Dave - 1/14/2014

> Does this mean that I only need one <port> script for the test but would still need the 16 '<port signals>' to send a unique
> biomarker for each different stimulus presentation (total of 16 picture presentations)?

You could do either.

> How do I check that the port system is LPT1 or LPT2?

Check via your operating system's device manager.

> Is this something I do on the computer with Inquisit or Acqknowledge?

The machine running Inquisit.

> It is a real parallel port as the Acqknowledge and Inquisit are connected via a ribbon "LapLink" cable.

I don't understand that question.

> 2. I am unsure whether this is an issue with my script or the set-up of the port through the parallel port monitor.

The first thing to do is check all the things I've mentioned (port number, etc.).

> 3. I do not understand how to have a biomarker present in acqknowledge for each photo stimulus I present in inquisit 

I don't understand that question either. Are you asking about an issue w/ Acqknowledge? If so, you would have to take that up with their support. As for your Inquisit script, it *will* send the signals you specified in your various <port> elements out along with the various different <picture>s. And it will try to do so using the data register of LPT1, as you have specified.

I would suggest you connect the Acqknowledge to your machine, set it to receive and then toy around with different settings in the parallel port monitor and see if you can get any signal across.
By Dave - 1/14/2014

To add, BIOPAC provides relatively detailed information / setup instructions for the STP100C-C (https://www.biopac.com/isolated-digital-interface-printer-port) at https://www.biopac.com/FAQPage.ASP?id=107&Src=Research

That should help in checking the setup on the Acqknowledge-side.
By sazevedo91 - 1/16/2014

Hi,

Thank you for your help so far. I've managed to get Inquisit talking to Acqknowledge via the parallel port test. 

My only issue now is that none of my stimuli are actually sending biomarkers to Acknowledge. I've tried looking for script templates to see if it's something wrong with my script, but I've only been able to find the one on the Inquisit manual. 
Could it just be a matter of the specific binary numbers I am using? I've tried several different ones and the issue is still not being resolved.

Could you please take a look at my script to see if there are any mistakes that I'm not seeing?

*************************************************************
TTL Parallel Signal
*************************************************************
<port targetsignalwhite>
/ port = lpt1
/ subport = data
/ items = ("00000000")
/select = current (targetwhite)
</port>

<port targetsignalA>
/ port = lpt1
/ subport = data
/ items = ("00000001")
/select = current (targeta)
</port>

<port targetsignalB>
/ port = lpt1
/ subport = data
/ items = ("00000010")
/select = current (targetb)
</port>

<port targetsignalC>
/ port = lpt1
/ subport = data
/ items = ("00000100")
/select = current (targetc) 
</port>

<port targetsignalD>
/ port = lpt1
/ subport = data
/ items = ("00001000")
/select = current (targetd)
</port>

<port targetsignalE>
/ port = lpt1
/ subport = data
/ items = ("00010000")
/select = current (targete)
</port>

<port targetsignalF>
/ port = lpt1
/ subport = data
/ items = ("00100000")
/select = current (targetf)
</port>

<port targetsignalG>
/ port = lpt1
/ subport = data
/ items = ("01000000")
/select = current (targetg)
</port>

<port targetsignalH>
/ port = lpt1
/ subport = data
/ items = ("10000001")
/select = current (targeth)
</port>

<port targetsignalI>
/ port = lpt1
/ subport = data
/ items = ("10000000")
/select = current (targeti)
</port>

<port targetsignalJ>
/ port = lpt1
/ subport = data
/ items = ("10000010")
/select = current (targetj)
</port>

<port targetsignalK>
/ port = lpt1
/ subport = data
/ items = ("10000011")
/select = current (targetk)
</port>

<port targetsignalL>
/ port = lpt1
/ subport = data
/ items = ("10000100")
/select = current (targetl)
</port>

<port targetsignalM>
/ port = lpt1
/ subport = data
/ items = ("10001000")
/select = current (targetm)
</port>

<port targetsignalN>
/ port = lpt1
/ subport = data
/ items = ("10010000")
/select = current (targetn)
</port>

<port targetsignalO>
/ port = lpt1
/ subport = data
/ items = ("10100000")
/select = current (targeto)
</port>

<port targetsignalP>
/ port = lpt1
/ subport = data
/ items = ("11000000")
/select = current (targetp)
</port>

***************************************************************************
Trials
***************************************************************************

<trial trial1>
/ stimulusframes = [1 = targetWhite]
/ trialduration = 6000
</trial> 

<trial trial2>
/ stimulusframes = [1 = targetA, targetsignalA] 
/ trialduration = 10000
</trial>

<trial trial3>
/ stimulusframes = [1 = targetB, targetsignalB]
/ trialduration = 10000
</trial> 

<trial trial4>
/ stimulusframes = [1 = targetC, targetsignalC] 
/ trialduration = 10000
</trial>

<trial trial5>
/ stimulusframes = [1 = targetD, targetsignalD]
/ trialduration = 10000
</trial> 

<trial trial6>
/ stimulusframes = [1 = targetE, targetsignalE] 
/ trialduration = 10000
</trial>

<trial trial7>
/ stimulusframes = [1 = targetF, targetsignalF]
/ trialduration = 10000
</trial> 

<trial trial8>
/ stimulusframes = [1 = targetG, targetsignalG] 
/ trialduration = 10000
</trial>

<trial trial9>
/ stimulusframes = [1 = targetH, targetsignalH]
/ trialduration = 10000
</trial> 

<trial trial10>
/ stimulusframes = [1 = targetI, targetsignalI] 
/ trialduration = 10000
</trial>

<trial trial11>
/ stimulusframes = [1 = targetJ, targetsignalJ]
/ trialduration = 10000
</trial> 

<trial trial12>
/ stimulusframes = [1 = targetK, targetsignalK] 
/ trialduration = 10000
</trial>

<trial trial13>
/ stimulusframes = [1 = targetL, targetsignalL]
/ trialduration = 10000
</trial> 

<trial trial14>
/ stimulusframes = [1 = targetM, targetsignalM] 
/ trialduration = 10000
</trial>

<trial trial15>
/ stimulusframes = [1 = targetN, targetsignalN]
/ trialduration = 10000
</trial> 

<trial trial16>
/ stimulusframes = [1 = targetO, targetsignalO] 
/ trialduration = 10000
</trial>

<trial trial17>
/ stimulusframes = [1 = targetP, targetsignalP]
/ trialduration = 10000
</trial> 

<trial trial18>
/ stimulusframes = [1 = targetWhite]
/ trialduration = 3000
</trial> 

*****************************************************************************

I've also tried the port script like this:

<port targetsignalO>
/ port = lpt1
/ subport = data
/ items = ("10100000")
/select = picture.targeto.currentindex
</port>

But that was also unsuccessful.

Thank you,
Suzanna
By Dave - 1/16/2014

There are no obvious mistakes in the code snippets you posted. Also, defining a dependency ( via /select=current() ) is unnecessary given the way you have set your stimulus up -- one <port> element w/ a single item corresponds to exactly one <text> element w/ a single item.

The interesting question is: Which settings did you use in the Parallel Port Monitor to get the devices to "talk to each other"? Do the /port, /subport etc. settings in your <port> elements properly reflect those settings? You must make sure they do, otherwise it won't work.

Finally, as an alternative to sending 8-bit binary strings, sending integers should also work in current Inquisit 4 versions.
By sazevedo91 - 1/16/2014

Hello,

The /port and /subport settings in the parallel port monitor are definitely set to the right settings (LPT1; Data register).

I will try the integers. If they don't work, would you have any other suggestions?

Thanks again!
By Dave - 1/16/2014

Offhand, no, I don't have any further suggestions. If you can't get it to work, attach your entire script to this thread. BTW, if you are looking for an example script re. TTL signals, see the Auditory Oddball Task available from the Task Library at the millisecond.com site.
By sazevedo91 - 1/16/2014

I've attached the entire script.

Thank you so much for all of your help and time!

By Dave - 1/16/2014

Hmm, nothing normatively wrong w/ the script as far as I can see, BUT it sure can be greatly simplified. I've done that in the attached file -- perhaps it makes a difference. Other than that -- no clue. Can you take a screenshot of the Parallel Port Monitor settings that are confirmed to work and attach?
By sazevedo91 - 1/16/2014

You are amazing! The new script with all of the simplification works perfectly. It definitely made a difference.

Thank you so very much!