serial comm in w2k (please help!!!)
-
i posted this already once, but it seems like nobody noticed it... this is really important and urgent... i need help with my timeouts. i can get my program to read/write single bytes, but the problem is a function related with the hardware i'm using. you send the command and the hardware will enter a loop sending you each 3ms 7 bytes. i can't set the timeouts properly in order to receive all those bytes (the most important thing is that i don't loose any bytes!)... can anybody please help me?? thank you in advance... Я люблю русский языкь!
-
i posted this already once, but it seems like nobody noticed it... this is really important and urgent... i need help with my timeouts. i can get my program to read/write single bytes, but the problem is a function related with the hardware i'm using. you send the command and the hardware will enter a loop sending you each 3ms 7 bytes. i can't set the timeouts properly in order to receive all those bytes (the most important thing is that i don't loose any bytes!)... can anybody please help me?? thank you in advance... Я люблю русский языкь!
-
i posted this already once, but it seems like nobody noticed it... this is really important and urgent... i need help with my timeouts. i can get my program to read/write single bytes, but the problem is a function related with the hardware i'm using. you send the command and the hardware will enter a loop sending you each 3ms 7 bytes. i can't set the timeouts properly in order to receive all those bytes (the most important thing is that i don't loose any bytes!)... can anybody please help me?? thank you in advance... Я люблю русский языкь!
-
i use CreateFile(), ReadFile(), WriteFile() && CloseHandle(). i set the timeout values with setcommtimeouts Я люблю русский языкь!
...if I understand properly, you want the synchronization based on your external hardware event, which signs the beegining of transfer and you want starting timeout than. If this scenario is corect you should try with DCB and COMSTAT structure and settings of fCtsHold, fDsrHold etc. to inform your PC about e3xternal events. SetCommState() and GetCommState() are useful functions, too. But this approach needs mutithreading and synchronization, but it is worth of effort........ pozdrav
-
...if I understand properly, you want the synchronization based on your external hardware event, which signs the beegining of transfer and you want starting timeout than. If this scenario is corect you should try with DCB and COMSTAT structure and settings of fCtsHold, fDsrHold etc. to inform your PC about e3xternal events. SetCommState() and GetCommState() are useful functions, too. But this approach needs mutithreading and synchronization, but it is worth of effort........ pozdrav
no, no... these are the 7 bytes i get ach 3ms: byte1 byte2 byte3 ... ID data1 data2 ... each frame begins with 0x37 - thats the id that tells me where i may begin with the synchronization. but the problem lies somewhere else: i can't set the reading timeouts (SetCommTimeout()) properly to keep up with those 7 bytes each 3ms... i'm able to keep up for about 10 seconds; each 10 seconds i loose some frames. one of the reason is this very slow computer i'm using... (my program's got to work event on 133MHz machines!) Я люблю русский языкь!
-
no, no... these are the 7 bytes i get ach 3ms: byte1 byte2 byte3 ... ID data1 data2 ... each frame begins with 0x37 - thats the id that tells me where i may begin with the synchronization. but the problem lies somewhere else: i can't set the reading timeouts (SetCommTimeout()) properly to keep up with those 7 bytes each 3ms... i'm able to keep up for about 10 seconds; each 10 seconds i loose some frames. one of the reason is this very slow computer i'm using... (my program's got to work event on 133MHz machines!) Я люблю русский языкь!
-
no, no... these are the 7 bytes i get ach 3ms: byte1 byte2 byte3 ... ID data1 data2 ... each frame begins with 0x37 - thats the id that tells me where i may begin with the synchronization. but the problem lies somewhere else: i can't set the reading timeouts (SetCommTimeout()) properly to keep up with those 7 bytes each 3ms... i'm able to keep up for about 10 seconds; each 10 seconds i loose some frames. one of the reason is this very slow computer i'm using... (my program's got to work event on 133MHz machines!) Я люблю русский языкь!
-
no, no... these are the 7 bytes i get ach 3ms: byte1 byte2 byte3 ... ID data1 data2 ... each frame begins with 0x37 - thats the id that tells me where i may begin with the synchronization. but the problem lies somewhere else: i can't set the reading timeouts (SetCommTimeout()) properly to keep up with those 7 bytes each 3ms... i'm able to keep up for about 10 seconds; each 10 seconds i loose some frames. one of the reason is this very slow computer i'm using... (my program's got to work event on 133MHz machines!) Я люблю русский языкь!
фил wrote: each 10 seconds i loose some frames. one of the reason is this very slow computer i'm using... You may need to resort to a device-driver if you really need to work on very slow computers. If you are working on a
real OS
, that is something NT-based, you could try a service with a higher priority, if needed. I think the problem is not so much the speed of your PC. That sould be sufficient for a task like this. I suspect the Windows introduced lack of reproducability of the reaction time.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation." -- Caius Petronius, Roman Consul, 66 A.D.
-
фил wrote: each 10 seconds i loose some frames. one of the reason is this very slow computer i'm using... You may need to resort to a device-driver if you really need to work on very slow computers. If you are working on a
real OS
, that is something NT-based, you could try a service with a higher priority, if needed. I think the problem is not so much the speed of your PC. That sould be sufficient for a task like this. I suspect the Windows introduced lack of reproducability of the reaction time.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation." -- Caius Petronius, Roman Consul, 66 A.D.
it thought of writing myself a device driver, too; but then i thought of some cheap programs that used to work for win95 and they managed to do well without any ddk. and besides that, you got software and hardware fifos you can setup to whatever size you need so even when you're synchronizing with the frames on a very slow machine it should be enough picking up some KBs each 10, 20, ...60 secs to keep up... i think one must be able to fix this by altering the timeouts... maybe you got some other ideas... thanks Я люблю русский языкь!