beginners-question parallel port

mrtj maartjevroling at gmail.com
Fri Nov 4 16:20:29 UTC 2011


Thanks Paul, and thanks David. Your (David's) suggestion indeed looks
more fancy :-)

I have an additional question: I want e-prime to send a trigger to
BioPac for some but not all trials within a procedure: Based on the
attribute Shock (1 or 0) in the List I want Eprime to send a signal if
Shock = 1 and no signal if Shock = 0. I tried my very best with what
little I know of E-prime, and I ended up with the following
(nonfunctioning) Inline:

if c.GetAttrib("Shock") = 1 then
   ITI.OnsetSignalEnabled = True
   ITI.OnsetSignalPort = &H378
   ITI.OnsetSignalData = &H80
else
end if

What happens with this inline is that a shock is given with the start
of every ITI, instead of when Shock=1. What am I doing wrong?
Many thanks once again!
Maartje

On Oct 22, 5:45 pm, mcfar... at msu.edu wrote:
> Maartje ,
>
> And if you want to look like a real programmer instead of a novice,
> you will replace the "magic numbers" with named constants, thus,
>
> Const  OutPort as Integer = &h0378
> Const  BioPacTrigger as Integer = &h01
>
> WritePort OutPort, 0
>
> Stimulus.OnsetSignalEnabled = True
> Stimulus.OnsetSignalPort = OutPort
> Stimulus.OnsetSignalData = BioPacTrigger
>
> Stimulus.OffsetSignalEnabled = True
> Stimulus.OffsetSignalPort = OutPort
> Stimulus.OffsetSignalData = 0
>
> -- David McFarlane, Professional Faultfinder
>
> Quoting Paul Groot:
>
>
>
>
>
>
>
> > Hi Maartje,
>
> > It is not required to open a classic LPTport. EPrime directly writes
> > to the output registers of the IO-port. However, it is a good think to
> > initialize the state of the output pins at the start of your
> > experiment with a single line of inline script:
>
> > WritePort &H378, 0
>
> > (although you could also use 3 lines of code to configure the
> > onsetsignal method on the first object using code 0 to achieve the
> > same thing)
>
> > best,
> > Paul
>
> > 2011/10/21 mrtj:
> >> I have abeginners-questionregarding my E-prime programming.
> >> I want to send event-related triggers to BioPac and after doing some
> >> research I figured that an Inline with the following should do the
> >> trick:
>
> >> Stimulus.OnsetSignalEnabled = True
> >> Stimulus.OnsetSignalPort = &H378
> >> Stimulus.OnsetSignalData = 1
>
> >> Stimulus.OffsetSignalEnabled = True
> >> Stimulus.OffsetSignalPort = &H378
> >> Stimulus.OffsetSignalData = 0
>
> >> However, it seems to me that I should define/open/set-to-zero thePort
> >> at the beginning of my experiment first. Am I correct to assume, and
> >> if do... how can I do this.
>
> >> I hope you can help me out. Many thanks!
> >> Maartje

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.



More information about the Eprime mailing list