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?

  • \$\begingroup\$ 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) \$\endgroup\$ – jsotola Feb 7 '19 at 3:10
  • \$\begingroup\$ True, but when I do fwrite(s, uint16(0)) in Matlab, the protocol transmits all zeros... \$\endgroup\$ – Yuriy Feb 7 '19 at 11:58
  • \$\begingroup\$ It sounds like MATLAB implemented RS-232 and NI-VISA implemented UART. electronics.stackexchange.com/questions/332362/… \$\endgroup\$ – Joe Friedrichsen Feb 8 '19 at 2:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.