parallel port communication: event markers

Michiel Spape Michiel.Spape at nottingham.ac.uk
Fri Jul 3 10:51:55 UTC 2009


Hi,
I agree about "David's nap" in between and setting it to 0 after that!
Still, it seems like you still don't seem to 'get' the idea about .RESP, Sofia (correct me if I'm wrong). Point is:
Before running Proposal, Proposal.RESP is nothing, just like before I click on Send here, you have received no e-mail. Thus, in the inline that comes before Proposal, Proposal.RESP is neither "a" nor "r", therefore, Proposal.OffsetSignalData will always be 30. However, it should just work (even if you delete the line), since (3) sends the response (in ascii) over the parallel port anyway.

About the error: I guess  the problem is that "" does not have an ascii code assigned. Thus, it tries to convert nothing to a number, which doesn't work. Try:
If Proposal.RESP <> "" then WritePort &H378, Asc(Proposal.Resp) else WritePort &H378, myFavouriteNumberBelow256
(in which myFavouriteNumberBelow256 is your favourite number below 256, but probably above 0, and possibly not including any of the numbers already used, so you may be out of luck if your favourite number happens to be asc(a)).

Best,
Mich
 

Michiel Spapé
Research Fellow
Perception & Action group
University of Nottingham
School of Psychology


-----Original Message-----
From: e-prime at googlegroups.com [mailto:e-prime at googlegroups.com] On Behalf Of sofia laureano
Sent: 03 July 2009 10:43
To: E-Prime
Subject: Re: parallel port communication: event markers


Dear Michiel, Dear David,

Thank you very much for your support. I followed your suggestions (I
decided to just use one slide) and what I have now is:

1. An Inline before the Proposal (lets call it EventMarker1) with the
following:

Proposal.OnsetSignalPort = &H378
If Proposal.RESP = "a" then Proposal.OffsetSignalData = 28 else if
Proposal.RESP = "r" then Proposal.OffsetSignalData = 29 else
Proposal.OffsetSignalData = 30

(as you can see I entered another condition, since it can happen that
the participants don't respond to the Proposal on time, i.e. don't
press keys "a" or "r" during the 7sec they have to make up their
minds)

2. Proposal slide

3. Inline after the Proposal (EventMarker2):

WritePort &H378, Asc(Proposal.RESP)
Sleep 20
WritePort &H378, 0

I am not sure whether you suggested to have all the info in one lnline
after the Proposal or, as I have now, divided in two.

The problem I am encoutering now is, if I don't press any key (neither
"a" or "r"), I get a Runtime Error saying Invalid Procedure Call,
Error Number 5
The line in the script is: WritePort  &H378 Asc (Proposal.Resp) . If I
press "a" or "r" the error doesn't occur.

Any ideas on why this is happening would be welcome!

thank you again,

Best,
Sofia



On Jul 2, 5:14 pm, David McFarlane <mcfar... at msu.edu> wrote:
> >Of course, you could also just use the one slide you currently have
> >and add a little inline after that:
> >WritePort &H378, Asc(Proposal1.RESP)
>
> If you go this route (which is probably how I would do it), depending
> on how the PsychLab equipment works you might also need to send a
> full "pulse" and reset the output before continuing, something like
>
> WritePort &H378, Asc(Proposal1.RESP)
> Sleep 20
> WritePort &H378, 0
>
> Oh, following my fussy habits I would also replace the "magic number"
> &H378 with a proper constant, e.g.,
>
> Const LptDataPort as Integer = &H378
> WritePort LptDataPort, Asc(Proposal1.RESP)
> Sleep 20
> WritePort LptDataPort, 0
>
> -- David McFarlane, Professional Faultfinder


This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.


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