Hello,
First let me apologize for having published my question intended for the french community to the international forum: I took the liberty to translate the title and here is the translation of the text:
I would like my PC to communicate with a peripheral using RS485 link: I have an RS232 to RS485 bidirectionnal converter controlled by the RTS line of RS232 serial port. So that I need to activate the RTS line of the RS232 port to receive the message from the peripheral.
The problem I am facing, as seen on the RTS line and RS485 line with a scope, is a too long delay between the moment the PC has finished sending its command and the activation of the RTS line for "listening to" the answer of the peripheral: in greater detail = the trace associated with the RS485 line shows the pulse train of the command from the PC to the peripheral with a reasonable amplitude (~10V) followed by a blank of about 4ms; then the first 2ms of the pulse train of the answer from the peripheral to the PC with a strongly reduced amplitude (<1V) followed by the remaining part of the pulse train of the answer from the peripheral to the PC with a large amplitude (~10V).
On the scope, the RTS line is activated after 6 ms (i.e. 4ms + 2ms = when the signal on the RS485 line becomes correct), indicating that the peripheral and the converter are both working fine, but the PC does not drive the RTS line after sending the command.
I am using LabView 6.1. When I tried LabView 7.1, I could not see the RTS signal at all (why?). In both cases I had to configure the VISA properties using a "Property node", (the VISA config function not being effective for this parameter - and neither for the Termination Character enable flag) using the RTS/CTS protocol.
In the VI in "afap-rw.gif" (enclosed in a polygonal zone), the VISA Read function is already called right after the VISA Write function in order to reduce the delay as much as possible. It does not seem to be possible to reduce this latency by proper construction of the program.
I have also tried "asserting" and "unasserting" the RTS line in the Modem properties (while the flux control was set to None in the VISA Config AND in the "Node properties/serial port/Flux control", cf. "Manual.gif" inside the ellipse) but then the delay reaches about 50 ms!!
I understand that I could develop a DLL to assert the RTS line as soon as possible after the last character of the command has been sent, and return the answer prior to returning to the system, but I am not familiar with this, not being a developer.
I might also consider
- commanding the RTS line with a circuit (retriggerable monostable triggered by the train of pulses coming from the PC so that it will activate the RTS line 2...3 ms after the last trigger pulse on line 3. This is something cheap I could do but would sure look ugly!
- buying the latest version of LabView (if it is guaranteed to solve the problem !...)
- buying a PCI interface board with an RS485 port (if it works properly with LabView 6.1 or 7.1)
Is there a better solution, preferably using LabView 6.1 or 7.1 and the RTS line?
Thank you very much for your help
Denis