Urgent! Problems collecting responses from external devices
 
PST User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Urgent! Problems collecting responses from... Expand / Collapse
Author
Message
Posted 9/1/2010 8:09:05 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/28/2010 9:12:16 AM
Posts: 5, Visits: 24
Hi there,

We need to collect subjects responses from two response buttons on a parallel port. As far as I have understood, the port address is not the same as for the port to send triggers (writeport command). Do I need a "read port" command? Where do I place it? One more InLine objects? How do I find out the port address?

Our computer doesn't have the standard port address &H0378. Instead, it uses &HCCF8.

In my experiment object under devices I still find the &H0378 port. Do I have to change it in &HCCF8?

It would be great if someone could help us, the matter is urgent. Thanks in advance!

Neuron

Post #4759
Posted 9/2/2010 9:40:50 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 3/2/2011 11:22:32 AM
Posts: 14, Visits: 67
Neuron,

You need to change your port address from &H0378 to &HCCF8 since that is the address of the port on your computer. Note that usually when you are reading from a port, the normal port address will be &H0379, so if your port address does not work, try that address or one plus the address you found (&HCCF9). Change this in the Devices tab of the Experiment Properties by double clicking on the ParallelPort object. I'm assuming since you know what your port address is you do not need to know how to find it, but for reference, you can find port addresses by going to your Device Manager, shortcut (Windows button + Pause/Break button). Then you can find it in the properties of the port.

To get responses from a parallel port, have an object (such as Text Display) take input from the parallel port device. You can retrieve the input from an attirbute here. Or you can use script such as the following:

 ' Configure the port for input
 ' After this call, use x = ReadPort(PORT_ADDRESS)
 ' or use the PortDevice in the Duration/Input
 ' property page of an object. 

Dim DataPortRead As Integer

ConfigurePortForInput PORT_ADDRESS

DataPortRead = ReadPort(PORT_ADDRESS)

Note that you must configure the port for input before you can call read port.

For further information regarding Paralell Port, there is an excellent sample experiment located on the Web Support page. Note that you must register and log into web support. After logging in, navaigate to "Samples" and scroll down to find the samples called "Parallel Port Configure", you can download the file there, and even though it is an .es file, you can open it in E-Prime 2.0 as well, it will automatically update itself. This sample will give you a much larger amount of information on Parallel Ports and how to use them.

 

Sincerely,
Karyna Kerin
Software Developer
Psychology Software Tools, Inc.

Post #4762
Posted 9/3/2010 4:45:58 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/28/2010 9:12:16 AM
Posts: 5, Visits: 24
Thank you for your answer. I tried to run the "Configure Parallel Port" from the samples area but directly received the following error (Line 543; 10006: Assertion failed.).

The script says:

´Well, must be an SPP

If  IsPortSPP (nBaseAddress) Then

 

            GetPortType = PORT_TYPE_SPP

            Exit Function

 

End If

 

´Why did we get here – nothing passed!

´Is the port address not a parallel port?

Debug.Assert False

GetPortType = PORT_TYPE_UNKNOWN

What can I do?

Neuron

Post #4764
Posted 9/3/2010 8:29:53 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/28/2010 9:12:16 AM
Posts: 5, Visits: 24
When I try the commands above

Dim DataPortRead As Integer

ConfigurePortForInput &HCCF8

DataPortRead = ReadPort(&HCCF8)

I always receive the error message "Unknown command "ConfigurePortRead""

How can that be? Could it be due to the fact that we use an express card to parallel port (PCI-Express)?

Post #4765
Posted 9/7/2010 9:05:46 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/28/2010 9:12:16 AM
Posts: 5, Visits: 24
Correction: The error says "Unknown command 'ConfigurePortForInput'"
Post #4770
Posted 9/7/2010 11:30:27 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 3/2/2011 11:22:32 AM
Posts: 14, Visits: 67
Is &HCCF8 the only port address you have tried? You may want to use &HCCF9 because you are configuring for input and not output. (Default port addresses are &H378 for output and &H379 for input) And yes, the problem may be that you are using an express card. Double check your port address again and try all 4 ports I mentioned above.

I believe the error is stemming from the fact that it does not like the address you are giving it. As you can see in the comments, the assertion is thrown because E-Prime is not sure if the address is for a parallel port:

´Is the port address not a parallel port?

Second, if you are using ConfigurePortForInput in your own experiment, you should also include the User Script that is in the sample so that the command will work. If none of these solutions works, I would be inclined to say the problem is with your parallel port setup.

 

Sincerely,
Karyna Kerin
Software Developer
Psychology Software Tools, Inc.

Post #4771
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -5:00, Time now is 8:31pm

Powered By InstantForum.NET v4.1.4 © 2012
Execution: 0.078. 8 queries. Compression Disabled.
 
Privacy | Terms of Use | Terms and Conditions | Legal Trademarks | Authorized Use | Quality Policy
Copyright 2012 Psychology Software Tools, Inc. All Rights Reserved
Email: Info@pstnet.com | Telephone: 412.449.0078 | Fax: 412.449.0079