04-11-2011 02:43 PM
Hello,
I'm trying to control a micro-positioning stage made by Ludl. The controller's model is Ludl MAC2000. It seems the RS232 comunnication is set up because I can talk to the controller using Hyper Terminal. However, when I want to do the same thing via Labview, I can't get any response from the controller at all. The vi is pretty much the same as the basic visa write/read in the example. It seems like a very similar problem in this post:
But the termination character trick doesn't help for my case: I tried enable/disable the termination character setting in property node and different combinations of "\r", "\n" as termination characters but nothing worked so far.
Looks to me there is some difference between the interpretations of the same command in Hyper Terminal and in Labview. But I just can't figure out what it might be.
Could anybody with similar experience give me some comments/suggestions? Thanks a lot!
Solved! Go to Solution.
04-11-2011 02:54 PM
Post your code. "The vi is pretty much the same as the basic visa write/read in the example." is not at all enough to explain what you have done. There are a lot of mistakes that you could be making if you are not using the example itself. It would also help if you explained exactly what property you used to set the termination character.
04-11-2011 02:56 PM
04-11-2011 03:02 PM
Dennis,
Thank you for looking at this problem. I think you posted the termination character trick in the post I referred. I'd very much appreciate it if you can look into my problem. Code attached here.
I played around with the "termination character enable" and "termination character" property nodes and got no luck so far. I removed the VISA setup module because I want to make sure I'm under the same VISA setting as the one I used in Hyper Terminal, where the very same command works fine.
04-11-2011 03:13 PM
Thank you for your suggestion. I got some interesting result based on your suggestion:
1. After added the End of Line constant at the end of my command, with simply the command sent in the string, say "VER", I still can't get any response from the port;
2. If I add "\r\n" after the command I sent over, which is "VER\r\n" I got ":N -1" in the response, which means unknown command according to the manual. This is at least some progress because I started to get something as feedback;
When I type "VER" followed by a [carriage return] in Hyper Terminal, I get such response: "Version no. : 4.400 TRIPLE INTERFACE CPU
:A" which is supposed to be a normal feedback.
04-11-2011 03:20 PM
One other difference between hyperterminal and labview is speed of sending characters.
LabVIEW bursts the complete string to the controller
hyperterminal does this character by character. So much slower and slow controller can be affected by this.
You could add a for loop around the visa write ( to make it easy convert the string to a byte array outside the loop and inside convert back to a string and you have a char by char send in LabVIEW
04-11-2011 03:33 PM
Albert,
Voila... That's it! This is the key. As a matter of fact, I have to add an extra 2 msec waiting time for each of the loop iteration so as to make the controller keep up with my computer! I'd never thought of this trick without your suggestion! Thank you so much!
Best,