07-02-2023 03:57 PM
I am attempting to transmit bytes from an STM32 board to a cRIO 9068 but I am having problems verifying if anything has been received. One end is a NUCLEO-G431KB board, where I am using one of it's USART ports to transmit a the following string: "Serial Message Test X". The USART TX/RX lines are connected to a MAX485 RS485 transceiver module (HCMODU0081), which has a DE/-RE hardware switching line. The DE line is held in Drive mode via a GPIO on the Nucleo while the USART outputs the previously mentioned char with the settings shown in "Settings.png". The code was written with the STM32CubeIDE and is included in "main.c".
The MAX485 transceiver module outputs in half-duplex mode RS-485 to a 1ft shielded cable with three conductors, (one twisted pair and a single conductor) A+/B-/COM. At the other end, approximately an inch from Port 2 of the NI-9871 module, A+ and B- are terminated with a 120ohm resistor. The A+ wire is soldered to the RX+/TX+ wires of an RJ-50 cable that has been cut to access wires. B- is soldered to RX-/TX-, and COM to COM (per this link's diagram: https://www.ni.com/docs/en-US/bundle/ni-9871-getting-started/page/overview.html). The NI-9871 module and the cRIO-9068 chassis it is plugged into are powered by a more than sufficient 24V supply.
For LabVIEW, I have taken the "NI-987X Serial Loopback" example project and have adjusted it to fit my application:
Everything compiles correctly, there are no broken VIs, and it all deploys without error. At this point, I set the Nucleo to constantly sent out the string, using a "transmit complete" callback to initiate another transmit, endlessly. What is happening is that every time the Host VI is run, the timeout for the byte Read hits and stops the process ("timeout.png"). Prior to that, the data is written to Port 1 without issue even with no cable connected. None of the bytes being sent from the Nucleo to Port 2 of the NI-9871 seem to be read, or if they are, the code is not saving or displaying them, and I can't find out why. There are no errors being marked, the code just reaches a natural end after the Read timeout. The LabVIEW project is included in "Examples.zip".
Troubleshooting so far:
Any help would be greatly appreciated on this matter, thanks in advance!