Thread Subject: Parallel port getvalue

Subject: Parallel port getvalue

From: Jimmy

Date: 9 Feb, 2010 11:33:04

Message: 1 of 2

Hello all,

coming back again with something wrong (?) with my parallel port. There is a device with buttons, so the volts in that electric circuit are supposed to change when someone presses a button. We have checked that the buttons are working with a voltmeter.

However, when I generate a simple (but perhaps built not in the right way) code the only value I read from the parallel port is '1'. This value is present either the device with the buttons is plugged in or not, and either I press a button or not. No change at all.

The device is connected to LPT1, which works fine as I see in the Device Manager. I try to read data from Port 0, pins 2 to 4.

I register the digital object and execute a code as:

dio = digitalio('parallel', 'LPT1');
inlines = addline(dio, 0:4, 'in')

for i = 1:1000 %Get the value 1000 times
start(dio)
value_1(i) = getvalue(dio.Line(1));
value_2(i) = getvalue(dio.Line(2));
value_3(i) = getvalue(dio.Line(3));
value_4(i) = getvalue(dio.Line(4));
pause(2)
stop(dio)
end

delete(dio)

BUT the value I get it always 1, no matter the condition, no matter pressing the buttons, no matter if the device is plugged in or not...

Any ideas?

Subject: Parallel port getvalue

From: Felix

Date: 10 Mar, 2010 11:09:04

Message: 2 of 2

Hi Jimmy,

We are having exaclty the same problem as you. Could you finally solve it?

We'll really apreciate your help :)

"Jimmy " <dvoudour@phed.auth.gr> wrote in message <hkrh5g$agv$1@fred.mathworks.com>...
> Hello all,
>
> coming back again with something wrong (?) with my parallel port. There is a device with buttons, so the volts in that electric circuit are supposed to change when someone presses a button. We have checked that the buttons are working with a voltmeter.
>
> However, when I generate a simple (but perhaps built not in the right way) code the only value I read from the parallel port is '1'. This value is present either the device with the buttons is plugged in or not, and either I press a button or not. No change at all.
>
> The device is connected to LPT1, which works fine as I see in the Device Manager. I try to read data from Port 0, pins 2 to 4.
>
> I register the digital object and execute a code as:
>
> dio = digitalio('parallel', 'LPT1');
> inlines = addline(dio, 0:4, 'in')
>
> for i = 1:1000 %Get the value 1000 times
> start(dio)
> value_1(i) = getvalue(dio.Line(1));
> value_2(i) = getvalue(dio.Line(2));
> value_3(i) = getvalue(dio.Line(3));
> value_4(i) = getvalue(dio.Line(4));
> pause(2)
> stop(dio)
> end
>
> delete(dio)
>
> BUT the value I get it always 1, no matter the condition, no matter pressing the buttons, no matter if the device is plugged in or not...
>
> Any ideas?

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com