PCIe parallel port address

Hello,
Each time I log in to my laptop - the address of the parallel port changes (e.g. 0x7030, 0x7CE6 etc.), so I`m looking for a way to read it automatically. I`m using a PCI express card (ST-lab), and from reading the manual - I understood that Matlab doesn`t handle these cards properly.


Any advice would be much appreciated!
Ido
i tried for a while to figure out how to do this and gave up. it's infuriating since windows must know the address since it's assigned an LPT number. :( summary of what i found is at
http://psychtoolbox.org/wikka.php?wakka=FaqTTLTrigger

in short:

matlab's data acquisition toolbox uses winio (http://www.internals.com/utilities_main.htm), but can only get addresses for built-in ports. perhaps their winio code could read the address if we knew where in the protected memory it was stored...

to get the first built-in parallel port address with winio:
bresult = GetPhysLong((PBYTE)0x0408, &port);

the DOS debug command can also read protected memory (http://www.doc.ic.ac.uk/~ih/doc/par/doc/findd.html)

but I can't figure out how to use an interactive DOS program from inside matlab (for instance using the "dos," "system", or "!" commands - any ideas?)

hwinterface32 (http://logix4u.net/Legacy_Ports/Parallel_Port/How_to_read_Parallel_Serial_Port_address_from_BIOS.html) can also read the memory if we knew where it was.

i'd love to find out how to do this -- anyone have ideas?

-e

--- In psychtoolbox@yahoogroups.com, "idodavid93" <idodavid93@...> wrote:
>
> Hello,
> Each time I log in to my laptop - the address of the parallel port changes (e.g. 0x7030, 0x7CE6 etc.), so I`m looking for a way to read it automatically. I`m using a PCI express card (ST-lab), and from reading the manual - I understood that Matlab doesn`t handle these cards properly.
>
>
> Any advice would be much appreciated!
> Ido
>
The correct way would be to use WMI ("Windows management instrumentation service"):

Overview:
<http://msdn.microsoft.com/en-us/library/aa394582(v=VS.85).aspx>

Example C++ application for WMI access:
<http://msdn.microsoft.com/en-us/library/aa390418(v=VS.85).aspx>

What StackOverflow (always a good address for programming questions) has to say about enumerating LPT: ports aka parallel ports via WMI:

<http://stackoverflow.com/questions/3325560/how-to-enumerate-windows-lpt-ports-and-their-i-o-range>

None of this is fun or beautiful (it's MS-Windows after all), but should get you started.

best,
-mario

--- In psychtoolbox@yahoogroups.com, "e_flister" <e_flister@...> wrote:
>
> i tried for a while to figure out how to do this and gave up. it's infuriating since windows must know the address since it's assigned an LPT number. :( summary of what i found is at
> http://psychtoolbox.org/wikka.php?wakka=FaqTTLTrigger
>
> in short:
>
> matlab's data acquisition toolbox uses winio (http://www.internals.com/utilities_main.htm), but can only get addresses for built-in ports. perhaps their winio code could read the address if we knew where in the protected memory it was stored...
>
> to get the first built-in parallel port address with winio:
> bresult = GetPhysLong((PBYTE)0x0408, &port);
>
> the DOS debug command can also read protected memory (http://www.doc.ic.ac.uk/~ih/doc/par/doc/findd.html)
>
> but I can't figure out how to use an interactive DOS program from inside matlab (for instance using the "dos," "system", or "!" commands - any ideas?)
>
> hwinterface32 (http://logix4u.net/Legacy_Ports/Parallel_Port/How_to_read_Parallel_Serial_Port_address_from_BIOS.html) can also read the memory if we knew where it was.
>
> i'd love to find out how to do this -- anyone have ideas?
>
> -e
>
> --- In psychtoolbox@yahoogroups.com, "idodavid93" <idodavid93@> wrote:
> >
> > Hello,
> > Each time I log in to my laptop - the address of the parallel port changes (e.g. 0x7030, 0x7CE6 etc.), so I`m looking for a way to read it automatically. I`m using a PCI express card (ST-lab), and from reading the manual - I understood that Matlab doesn`t handle these cards properly.
> >
> >
> > Any advice would be much appreciated!
> > Ido
> >
>