My board got a MAX485 that got its Drive-Enable input controlled by the state of the RTS line.
I tried to control the board using the modem line control properties of the NI VISA serial library. I can properly assert and unassert the RTS line, but the timing is wrong.
I can assert RTS and start a serial transfer at the same time, it will look good on the scope. But I have no way to wait for the serial transfer to finish so that i can un-assert the RTS line after my transfer is finished. If i would just unassert the RTS line after the serial write VI finished the RTS line would go un-asserted before the end of transfer - so i guess the transfer is actually running as an own thread.
So is there a way to detect if my transfer has already finished?
I could of course add a fixed wait time before I un-assert the RTS line, but then the RS485 slave would need to wait for quite a while before they could answer to the request sent by the PC (this is because accurate timing is not possible by inserting fixed wait times).