
I think the first step to solving your problem is going to be determining why you are receiving an echo. Once that is solved you can focus on why you don't receive a response from the instrument. Can you answer the following questions for me?
1. Which USB-485 interface you are using (1 port, 2 port, or 4 port)? If using a multi-port interface, which port are you connecting your instrument to?
2. Open the serial port in MAX or Device Manager. On your Advanced tab, what is the default wire mode specified?
There are only a few reasons you could receive an echo while in 2Wire/Auto mode:
- The device you are connected to is echoing the commands
- Your USB-485 interface is not disabling the receivers while transmitting (Meaning the hardware could be bad)
- You are using very long cables and they do not have proper terminating resistors installed. I would not normally expect the data to look clean when it was received back, but this is worth double checking.
The approach I would take is the following:
- Unplug the USB controller, reboot the computer, then plug the controller back in. If using a USB-485/4, you should also unplug the power to the box when you disconnect it from the computer. This will ensure that the firmware on the USB interface is completely reloaded. Try your application to see if the problem has been solved.
- I've attached a simple VI which you can use to determine if your wire modes are properly disabling the receivers. This VI just transmits a word and tries to receive it on the same port in order to determine whether the receivers were disabled during transmission. Restart LabVIEW prior to running this VI, to ensure that LabVIEW doesn't have a stale VISA session open which may have changed the state of the serial port. I saved it in LabVIEW 8.2, but if you need something earlier you can easily reconstruct it from the picture I also attached. Go ahead and leave your instrument connected to make sure that this step fails for you. If it fails we will remove the instrument in the next step.
- Set your VISA Resource to the appropriate COM Port
- Select the RS485/Wire2-EchoDTR Wire Mode and run the VI - The read buffer should read "Test", indicating that the echo was received
If you see an error on this test or the buffer does not read "Test", then you likely do not have a 2-wire cable connected to the interface.
- Select the RS485/Wire2-CtrlDTR Wire Mode and run the VI - You should see a blank read buffer and an error
If you see "Test", either your instrument is sending the echo, or your USB-485 is bad. Go to step 3 to diagnose.
- Select the RS485/Wire2-Auto Wire Mode and run the VI - You should see a blank read buffer and an error
If you see "Test", either your instrument is sending the echo, or your USB-485 is bad. Go to step 3 to diagnose.
- If you did not see unexpected echoes, even with your instrument connected and powered on, then they are likely related to something the other application is doing.
- If you have not already done so, disconnect the instrument (but leave the cable attached to the USB-485, in order to connect the Tx and Rx lines together), and repeat step 2. If you still have unexpected echoes, then for some reason the receivers are not being disabled properly. You will probably need to have your USB-485 hardware repaired or replaced.
- If removing the instrument removed the unexpected echoes, then your instrument is likely to be the source of the echoes. You will need to either figure out how to disable them, or update your application to expect them.
Please let me know what you find when you try this out.