Hi,
Can someone point me to examples of doing IO to Serial Ports in a Windows XP environment?
Thanks,
Firmo
Can someone point me to examples of doing IO to Serial Ports in a Windows XP environment?
Thanks,
Firmo
From the FAQ: http://www.asmcommunity.net/board/index.php?topic=3927 :-)
Hi FOdder,
I did read that FAQ and went to Thomas website. However he has a lib for an old version of WinIo that does not work for WinXP.
I sent him an e-mail and am hopping he will reply> I dont know f his e-mail address is istill valid.
But thanks for the reply.
Best,
Firmo
I did read that FAQ and went to Thomas website. However he has a lib for an old version of WinIo that does not work for WinXP.
I sent him an e-mail and am hopping he will reply> I dont know f his e-mail address is istill valid.
But thanks for the reply.
Best,
Firmo
Hi,
Try Porttalk v2.0 from beyondlogics
Try Porttalk v2.0 from beyondlogics
Here's the XP-compatible WinIO files which I have used and can confirm there is no problem..
Thanks KSA and EvilHomer2k,
Will look at both.
Best,
Firmo
Will look at both.
Best,
Firmo
Hi EvilHomer2k,
Could you inform the version of WinIo that the file you sent me are from?
Best,
Firmo
Could you inform the version of WinIo that the file you sent me are from?
Best,
Firmo
According to the DLL information, it's 2.0
Hi EvilHomer2k,
Thanks again.
However I have another question regarding the PROTOS you sent me for the WinIo routines.
The PROTOS define all the parameters as DWORD and looking at the defined parameters in WinIo documentation some of them are not.
For example:
bool _stdcall GetPortVal(
WORD wPortAddr,
PDWORD pdwPortVal,
BYTE bSize
);
GetPortVal PROTO STDCALL :DWORD, :DWORD, :DWORD
Forgive the beginner question but I thoght the parameter types had to match. If they dont how does the calling routine unstack them if it is expecting different size types?
Best,
Firmo
Thanks again.
However I have another question regarding the PROTOS you sent me for the WinIo routines.
The PROTOS define all the parameters as DWORD and looking at the defined parameters in WinIo documentation some of them are not.
For example:
bool _stdcall GetPortVal(
WORD wPortAddr,
PDWORD pdwPortVal,
BYTE bSize
);
GetPortVal PROTO STDCALL :DWORD, :DWORD, :DWORD
Forgive the beginner question but I thoght the parameter types had to match. If they dont how does the calling routine unstack them if it is expecting different size types?
Best,
Firmo
I only whant to add other resource, finded by other person here (@ this computer), but that need access the serial port http://www.logix4u.net/
Have a nice day or night
Have a nice day or night
Thanks hgb.
Firmo
Firmo
Of course you are correct about the Params of functions, but are you sure the documentation matches the version I provided? Attached is a working example for a machine automation application (robotics) which I wrote a while ago with the WinIO files I provided (source provided is not my final version).. you can mess with the pins on the printer port in realtime and see the bits changing in one part of the application (press escape and find Expert Mode)
Don't expect too much from the source I provided, I just wanted to prove beyond doubt that the WinIO files provided are ok, and that the params specified for this version are correct.
Don't expect too much from the source I provided, I just wanted to prove beyond doubt that the WinIO files provided are ok, and that the params specified for this version are correct.
Hi EvilHomer2k,
Thanks for the files. I will study them with care.
Thomas Bleeker <Thomas@MadWizard.org> provided me with a very nice explanation on how the PROTOS are the way they are. I reproduce his explanation below since it will benifit a lot of us:
"In high level languages like C++ parameters always have to have the right types because the compiler enforces the use of the right type with type checks. However, in assembly there are almost no types, only the processor's types (DWORD, WORD, BYTE, etc). A pointer is just a DWORD, and so is an integer.
Then there's something else that confuses things, namely that in windows, all function paramters are passed as DWORDs or multiples of that. You will never see a 16-bit register or something pushed onto the stack as a parameter to an API call or C function. This is because the stack needs to be aligned to 4 byte boundaries and because it's far more efficient to use DWORDs.
In this paricular case it means that WORD, PDWORD and BYTE are all passed as DWORDs in the end anyway. If the size of the type is smaller (like WORD and BYTE) it is stored in the lowest bits of DWORD and only part of it is used (for example only the lowest 16-bits in the case of a WORD). Sometimes it is also assumed the unused bits are zero but this might be a wrong assumption in some cases.
Some people define typedef's for other types (like PDWORD typedef DWORD), but since most prototypes are generated automatically usually just DWORD is used.
Thomas"
Thanks for the files. I will study them with care.
Thomas Bleeker <Thomas@MadWizard.org> provided me with a very nice explanation on how the PROTOS are the way they are. I reproduce his explanation below since it will benifit a lot of us:
"In high level languages like C++ parameters always have to have the right types because the compiler enforces the use of the right type with type checks. However, in assembly there are almost no types, only the processor's types (DWORD, WORD, BYTE, etc). A pointer is just a DWORD, and so is an integer.
Then there's something else that confuses things, namely that in windows, all function paramters are passed as DWORDs or multiples of that. You will never see a 16-bit register or something pushed onto the stack as a parameter to an API call or C function. This is because the stack needs to be aligned to 4 byte boundaries and because it's far more efficient to use DWORDs.
In this paricular case it means that WORD, PDWORD and BYTE are all passed as DWORDs in the end anyway. If the size of the type is smaller (like WORD and BYTE) it is stored in the lowest bits of DWORD and only part of it is used (for example only the lowest 16-bits in the case of a WORD). Sometimes it is also assumed the unused bits are zero but this might be a wrong assumption in some cases.
Some people define typedef's for other types (like PDWORD typedef DWORD), but since most prototypes are generated automatically usually just DWORD is used.
Thomas"