I am trying to communicate with a LIN sensor device via a PC COM port (I built a board that converts USB to UART and then UART to LIN). The board works and I wrote a simple Matlab script to grab data from it. The problem is that now I need to convert my code to LabVIEW to integrate with a larger application. However, I ran into a problem where I am struggling to find a way to transmit more than 8 zeros (for proper LIN I need 13-16 zeros in a row) since the NI VISA Write maximum data size is a byte. If I try to transmit two zero bytes in a row, I get a logic 1 between them e.g. 0...010...0. Is there a good way to generate a 13-16 bit stream of 0 with LabVIEW?
Asked
Active
Viewed 212 times
0
-
`two zero bytes in a row, I get a logic 1 between them` .... that would be either the start bit or the stop bit in the RS232 protocol (UART) – jsotola Feb 07 '19 at 03:10
-
True, but when I do fwrite(s, uint16(0)) in Matlab, the protocol transmits all zeros... – Yuriy Feb 07 '19 at 11:58
-
It sounds like MATLAB implemented RS-232 and NI-VISA implemented UART. https://electronics.stackexchange.com/questions/332362/why-does-rs-232-need-a-stop-bit – Joe Friedrichsen Feb 08 '19 at 02:09