Parallel Port Trigger problem

251 views
Skip to first unread message

Harold Mouras

unread,
Jan 12, 2023, 7:58:23 AM1/12/23
to E-Prime
Dear Eprime group members,

I wish you w happy new year 2023 !

For an experiment, we wanted to use an old eprime 2 script in which we incorporated in InLine command to send a trigger to the Parallel Port. This script was runing well on old PC with a classical parallel port. We installed a parallel port on the new PC without changing anything and when runing the scipt, we get the attached error message from Eprime. Maybe this is a problem of Parallel Port adress or something....but we did not succeed in finding in the Windows 10 system the address of the Parallel Port.

Maybe there is a solution (we just want to send a trigger via the port to run an expetran device) or instruction to incoporate for which this is not mandatory to mention the port address ?

Thank you very much in advance,
Best regards,
Harold Mouras
ErrorMessage.png
1EprimePassationActEcran.es2

McFarlane, David

unread,
Jan 12, 2023, 5:04:02 PM1/12/23
to e-p...@googlegroups.com
Harold,

Yes, the error message means exactly what it says, your experiment program uses the wrong LPT port address for this machine & LPT adapter. As our computing platforms evolve, it gets harder to deal with LPT port addresses. Sometimes you can use Windows Device Manager to find this -- open Device Manager, look for "Ports (COM & LPT)", expand that branch and find your LPT adapter; open its properties page, go to the "Resources" tab, and look there. Then edit your program to use that address. Note that you might have to edit your experiment whenever you move or copy it to another machine, which gets tedious and wreaks havoc with experiment auditing! (With some cleverness you could use .startupInfo files to supply a custom LPT address to each machine without needing to use a custom generated .ebs file on each one, but better to just update your program a bit ...)

You could avoid all this by updating your program to use the ParallelPort device instead of using WritePort, etc. With the ParallelPort device you no longer need to know the port address, you need only know which LPT number (LPT1, LPT2, etc.) to use and E-Prime finds it. Then you can easily move/copy the experiment to other machines as long you you assign the same LPT number on each one (and you can easily do that from the Device Manager).

Even better if you further update to use the ParallelPort device in conjunction with Task Events!

-- David McFarlane

Harold Mouras

unread,
Jan 20, 2023, 6:01:37 PM1/20/23
to e-p...@googlegroups.com
Dear David, 
Thank you very much for your mail. This is true that we are not able to locate the address of the new parallel port but we know that it is called LTP3.
We just want to send a til signal to an external device to begin aquisition. How would you implement that in our Eprime script through the use of the ParallelPort device ?
Sorry if my question is silly, 
Thank you very much in advance, Best regards, 
Harold

-- 
You received this message because you are subscribed to a topic in the Google Groups "E-Prime" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/e-prime/gmV5HDVIsM4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to e-prime+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/14cf2615-e05e-c34d-6dce-8b6651aff169%40msu.edu.

McFarlane, David

unread,
Jan 23, 2023, 12:50:57 PM1/23/23
to e-p...@googlegroups.com

Harold,

First, add a ParallelPort device to your experiment -- open the Experiment Object Properties pages, go to the Devices tab, click "Add...", and add a ParallelPort device.  Then open the ParallelPort device and set LPT to 3 (or better, use Windows Device Manager to reassign your parallel port to LPT1 so that your program would be more likely to work on generic PCs, that's what I would do).

With that done, you could simply replace any WritePort commands with ParallelPort.WriteByte.  E.g.,

    WritePort &h3E80, 123

becomes

    ParallelPort.WriteByte 123

(This assumes that you did not change the name of your ParallelPort device, otherwise use the name that you assigned it.)

And if your program uses the "OnsetSignal" mechanism, then you have to replace that with Task Events, which introduces another topic.

-- David McFarlane

Reply all
Reply to author
Forward
0 new messages