Hi and thanks for reading.I'm trying to acces the master PLC of a CAN network using the windows api.It's become a nuisance since i cant' figure this out at all.I will try to be brief since i don't have the source code at hand.
So i'm initializing a handle for the COM1 port with the CreateFile() function.I'm getting the DCB configuration since there is actually another program interfacing with this network which configures the protocol when started.

unsinged long Event;
unsigned long BytesRead;
void* ReadBuff;

WaitCommEvent(hPort,&Event,0);// this should return .. it doesn't

These should be the main steps from what i figured out by now but i can't make anythig to work.I tried the overlapped method still .. nothing.Please guide me.And thanks for the time.

Try and check if the SetCommMask is return true or false. And use GetLastError to see the error message, that's all I can think of.

This article has been dead for over six months. Start a new discussion instead.