LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

high speed serial port's DSR bit verification

    Hy!

I have an infrared sensor connocted to the serial port. A semnal from the sensor is connected to the DSR bit. The transmission protocol is (lenght coded):
    Logic               Physic
1 Logic = ~600microsec 1 and ~1600microsec 0
0 Logic = ~600microsec 1 and ~500microsec 0

How can I check the DSR bit state and the time between the changes?

I can't use Timer or AsyncTimer, because 1 millisec is too long. I lose data.
I have tried installing a ComCallback function on DSR bit change, but is not working properly. I recive incorrect data's
I have tried using a separate thread and in an infinite loop I check the DSR bit state. In this way I can recive the data correctly, but the CPU usage is 100%.
If I use the ProcessSystemEvents() function, the CPU usage is ok, but I lose data.

Any advice?

Thanks in advance,
Balogh Szabolcs
0 Kudos
Message 1 of 2
(2,976 Views)
I don't believe you will be able to do this job in software, unless you write a special device driver for the port (which is outside the scope of CVI). We would nomally use a small embedded processor (e.g. a PIC) to translate such signals to standard RS-232.
--
Martin
Certified CVI Developer
0 Kudos
Message 2 of 2
(2,959 Views)