0

I’m a relative rs232 newbie. I have an elapsed time reader chip:

http://www2.l-3com.com/edi/dyna-digital.htm

that has been configured to spew out data on the CTS line of an RS232 com port every other 250ms with each data set lasting 62.5ms.

The data format is BCD; Binary coded decimal.

I understand there is ::GetCommModemStatus which will tells me if the CTS line is on or off but I need to monitor this quickly.

Is there any way to read the CTS line over a period of time in c++ with the level of granularity needed, maybe an api?

Will a user-mode application be sufficient enough to read at the required speed or will I have to write a kernel mode driver?

Many Thanks

  • Each data set is 62.5ms? But how frequently do you need to read the CTS line? Substantially faster I presume? – JCx May 07 '15 at 11:39
  • Hi JCx. Yes, the message is 32 bits long and lasts 62.5ms. So at a rate of ~1.9 ms –  May 07 '15 at 11:43
  • That sounds very dodgy to attempt as a user mode thing. I'm not sure whether you could guarantee that performance in the kernel either if any other processes are running. You'd want some kind of hardware buffer...or interrupt. I take it you are looking for a solution for Windows from that function call name. – JCx May 07 '15 at 11:47
  • Yes. Doesn't have to be that function name. Back in 2000 a driver was needed to get the speeds. I'm hoping that as tech has evolved, this is no longer the case. –  May 07 '15 at 12:11
  • But essentially you are looking to read bits transmitted on the CTS line at 500Hz or so ... doesn't sound pretty :) – JCx May 07 '15 at 13:20
  • I think Windows cannot guarantee much about when your API requests are served, to have 100% safety you should use a real-time extension. But probably it would be overkill for just 1 signal and relatively low frequency... – Alberto M May 07 '15 at 14:50
  • Thanks Alberto, could you suggest a real-time extension. i don't have to read the data all the time. It’s only a time indicator so once I’ve the 62.5ms message, that should be fine. I’ve been trying the ::GetCommModemStatus and ::WaitCommEvent with no success. I think the timings are too quick to invoke an interrupt with ::WaitCommEvent. Thanks –  May 08 '15 at 08:05
  • Ok, I was thinking at things like IntervalZero RTX, but they are industrial products whose cost is only justified if you must absolutely read each message (safety critical projects etc.). I have, alas, no experience with solutions for smaller scale applications... Sorry! – Alberto M May 08 '15 at 15:48
  • By the way, are you forced to use Windows? There are some real-time versions of Linux that could fit your needs – Alberto M May 08 '15 at 15:50
  • I need to stick to windows. Further testing had found that a user mode application can’t generate the interrupts quick enough needed to read the eti reader (using ::GetCommModemStatus etc). So it’s on to a kernel mode driver!… –  May 13 '15 at 10:32

0 Answers0