sending trigger to a powerlab or a biopac
Hi,
I currently try to send trigger following the start of pictures with eprime on a powerlab (electrodermal response recording).
Despite all I have seen on google eprime group, this currently not function.
I have written the following inlines :
at the beginning of the experiment : inline 1 : WritePort &H378, 1
in trialproc : inline 2
photos.OnsetSignalEnabled = True
photos.OnsetSignalPort = &H378
photos.OnsetSignalData = C.getAttrib("trigger") : this refers to the nam of the stimuli.
photos.OffsetSignalEnabled = True
photos.OffsetSignalPort = &H378
photos.OffsetSignalData = 0
Is there something wrong?
thanks so much for any help.
carole
-
Hi Carole,
I suggest making sure you are using the correct port address. Is the parallel port using the base address of &h378? You can find the address in Device Manager > Ports tab > Parallel Port device Properties > Resources tab (see image).
Most PCI parallel port adapters support multiple modes (i.e. ECP/EEP/SPP/BPP) and auto-switch without configuration. Please see INFO: Recommend Parallel Port Adapters for Machines without a Parallel Port.
It is important to note that USB to Parallel cables are NOT compatible with E-Prime or any application that requires DMA access to the parallel port memory.
For a good starting point for communicating with an external device, please see these resources:
1316 - INFO: How do I send a signal to an external device?
1318 - INFO: How do I notify external equipment at the exact time that an event occurs in E-Prime?
1320 - INFO: General Parallel Port InformationEach one of these resources contains a lot of information on how to send signals to an external device using a Parallel port.
You can also look in your System Information report to locate the port address. You can find this in the System Information report by expanding ‘Hardware Resources’ and selecting ‘I/O’. Please see Description of Windows XP System Information Tool.
I hope this helps
-David
-
Hi Carole
I have been working with eprime and a Powerlab GSR amplifier for more than 1 year. Although Im not proficient on programing nor Eprime scripts I can show you how I have it connected. For the inlines I have it pretty much as you though.
you may use my personal email: anaganho@gmail.com
Best of luck
ana
-
Depending on your tower size, you most likely have space to add a parallel port to your machine.
The first and easiest recommendation would be to add a parallel port (3023 - INFO: Recommend Parallel Port Adapters for Machines without a Parallel Port).
My next recommendation would be to use Chronos (http://www.pstnet.com/hardware.cfm?ID=240). It’s real easy with the Chronos I/O Expander, everything is labeled and you would just wire it up using a Digital Out and simulate a TTL pulse (logic high – logic low). Chronos also comes with an Auxiliary I/O breakout cable if you just want to use the DIN connection on the back of the Chronos. That will give you access to 2 digital outputs.
Other alternatives are available, such as using LabJack or a National Instruments card. Note that this is beyond the scope of PST support.
If you have a USB device that has a public API and can be called by using a simple Declare statement, you can use this to communicate with an external device in E-Prime. Please see the DECLARE statement in E-Basic Help. Essentially, you can bring the library of calls into E-Prime by copying and pasting them into the User script of your experiment. In doing so, you will likely no longer use E-Prime's "WritePort" command for port communications, but will rather use the specific commands you have imported.
The last recommendation that I have would be to create your own DLL. E-Prime can call into DLL functions and use the CreateObject API to attach to some COM objects. Both of these issues are typically on the advanced front and have limited support. The best advice we can give you, if you choose to use the DLL- facilitated USB connection, is to refer to the Declare statement in E-Basic Help (accessed via the Help menu in E-Studio). Before attempting to do this, however, we must stress that even if communication can be obtained, we cannot guarantee the accuracy of the timing for what you will receive. Please see 5586 - INFO: USB device compatibility with E-Prime. Note that this is beyond the scope of PST support.
If you have any additional question, please create a support request at https://support.pstnet.com/home.
I hope this helps.
-David
-
Hi,
My question is relating to if you can send relevant events in real time based on meeting certain criteria. For example, am I able to send an event conditional upon reaction time being over and under a certain threshold?
On a related note, in a separate experiment I was hoping to send events based on performance data being collected by the object. For example, in one task the participant is presented with letters and has to recall as many as they can- the most challenging condition being 6 letters. Using the code below I compare their actual answer with the real answer and count how many they get correct. My question is, am I able to create a conditional event trigger that is sent only when "TotalNumberCorrect" is 2 or less, or 4 or more? Any help you can give me would be very much appreciated.
Many thanks,
Laura
targetcond= c.getAttrib ("TrialType")
targetletters=c.getAttrib("Response")
responseletters= LetterResponse.RESP
If targetcond= "6Targets" Then
For i = 1 To 6
answer(i)= Mid$(responseletters, i,1)
Next
For j= 1 To 6
actualletter(j)= Mid$(targetletters, j,1)
Next
For y= 1 To 6
For z= 1 To 6
If actualletter(y)= answer(z) Then answerscorrect(y)=1
Next
Next
totalscore=0
totalscore= answerscorrect(1) + answerscorrect(2) + answerscorrect(3) + answerscorrect(4) + answerscorrect(5) + answerscorrect(6)
c.SetAttrib "TotalNumberCorrect", ""
c.SetAttrib "TotalNumberCorrect", totalscore
Please sign in to leave a comment.
Comments
6 comments