From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading bits from serial port

Hi!
Ok, here is mi problem. A PIC with a 10 bit A/D send to me by serial port his data (10 bits). How i Can read the correct value wich range is around 0 - 1024 ?
Wich function of ComRd() or ComRdByte () os teh best suitable for that operation?
0 Kudos
Message 1 of 2
(2,767 Views)
Hi,

Most serial ports in PCs do not support more than 8 bits of data. The fist thing to check here is the hardware connection.

Some PICs communicate with the SPI protocol that is a different interface than a regular RS-232 serial interface.

If the PIC is transmitting RS 232 then you would use ComRd that allows you to read multiple bytes, the you would have to cast the data to a short int.

Hope this helps.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 2 of 2
(2,767 Views)