From: Acer on
I connect two computers (A and B) with the parallel port.
I utilize Data Acquisition Toolbox to send information from A to B.
When I put value (putvalue) on the lines by entering commands at A computer,
I can detect the potential changes of lines with electric meter.
But the other computer cannot detect the potential change by getvalue function.

Without connecting with the parallel port between A and B,
the B computer still can set values to its parallel port. Like:
(at B computer)
putvalue(ParaObj, 1)
And the value of the data lines will be [1 0 0 0 0 0 0 0]
I can also get values from the port of B:
getvalue(ParaObj)
and it returns -> [1 0 0 0 0 0 0 0]
But the weird thing is when I connect A and B with parallel port,
even the values (potential) of the lines is set by A,
(With electric meter, I can also be sure the values of lines at B endpoint is set by A )
B still can't get value from the lines but get value value which is set previously by B.

In sum, I don't know how to get value from A.
From: Frank W. on
"Acer " <hyster11(a)gmail.com> wrote in message <huklts$e9e$1(a)fred.mathworks.com>...
> I connect two computers (A and B) with the parallel port.
> I utilize Data Acquisition Toolbox to send information from A to B.
> When I put value (putvalue) on the lines by entering commands at A computer,
> I can detect the potential changes of lines with electric meter.
> But the other computer cannot detect the potential change by getvalue function.
>
> Without connecting with the parallel port between A and B,
> the B computer still can set values to its parallel port. Like:
> (at B computer)
> putvalue(ParaObj, 1)
> And the value of the data lines will be [1 0 0 0 0 0 0 0]
> I can also get values from the port of B:
> getvalue(ParaObj)
> and it returns -> [1 0 0 0 0 0 0 0]
> But the weird thing is when I connect A and B with parallel port,
> even the values (potential) of the lines is set by A,
> (With electric meter, I can also be sure the values of lines at B endpoint is set by A )
> B still can't get value from the lines but get value value which is set previously by B.
>
> In sum, I don't know how to get value from A.

Hi,
I assume that you have a 1:1 cable connection between the two ports i.e. Data1 pin of A is connected to Data1 pin of B's port and so on. To read values from the port you need to make sure that:
- the ports support bi-directional data exchange (if it's an older computer). This means that in the BIOS of the computers at least the Standard/Normal Mode (SPP) must be enabled.
- then you need to access the control register of the port which shall receive data and set the right bit in the control register in order to reverse the port direction.
I am not familiar with the data acquisition toolbox so I do not know how to access the port's control register and if this is possible in the DAT.
Please note that not all port Pins are bi-directional. Thus connecting an output pin of port A with its equivalent port B pin might damage the port.
hth
Frank
From: Acer on
Hello,

I think your point about the control register is right.
In my last article, I have have already opened the bi-direction mode of parallel port with SPP, EPP or ECP (I have tried all the three methods), but I still can't get the value.
Yesterday, I downloaded a simple software for parallel port controlling/monitoring.
I found if I open the control register bit 5 (bi-direction control), then my matlab could work!!
So I think the problem is related to control register.
But, as I know, when we set the direction of data port as "in", matlab can automatically change the value of control register bit 5.
In my script, I wrote down < addline(ParaObj,0:7,0,'in') >, it seems that matlab didn't change the value of control register but I had to do that by myself.
Do you have any idea that we can set the control register with any matlab function?

> Hi,
> I assume that you have a 1:1 cable connection between the two ports i.e. Data1 pin of A is connected to Data1 pin of B's port and so on. To read values from the port you need to make sure that:
> - the ports support bi-directional data exchange (if it's an older computer). This means that in the BIOS of the computers at least the Standard/Normal Mode (SPP) must be enabled.
> - then you need to access the control register of the port which shall receive data and set the right bit in the control register in order to reverse the port direction.
> I am not familiar with the data acquisition toolbox so I do not know how to access the port's control register and if this is possible in the DAT.
> Please note that not all port Pins are bi-directional. Thus connecting an output pin of port A with its equivalent port B pin might damage the port.
> hth
> Frank
From: Frank W. on
> Do you have any idea that we can set the control register with any matlab function?
>
Sorry,
I am not using Matlab for accessing computer ports. Maybe here
http://www.mathworks.com/access/helpdesk/help/toolbox/daq/f11-8000.html#f11-22257 or
http://www.mathworks.com/matlabcentral/fileexchange/161-cport or
http://www.mathworks.com/matlabcentral/fileexchange/19452-modified-parallel-port-driver
there is the solution.
If not or nobody else responds I suggest starting another threat in the newsgroup and asking how to access the control register under Matlab.
HTH
Frank