Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial VISA communication error with LUDL stage controller

Solved!
Go to solution

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:

 

http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/VISA-Serial-Communication-Problem/m-p/567065#...

 

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!

 

0 Kudos
Message 1 of 7
(3,160 Views)

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.

0 Kudos
Message 2 of 7
(3,157 Views)

Hi

please add simply the string end of line constant (CRLF in windows)  to your string and disable send end character.

You can have only one end char defined in visa and hyperterminal sends both cr and lf.

 

greetings from the Netherlands
0 Kudos
Message 3 of 7
(3,153 Views)

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.

0 Kudos
Message 4 of 7
(3,149 Views)

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.

 

0 Kudos
Message 5 of 7
(3,146 Views)
Solution
Accepted by topic author hhaamm

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

greetings from the Netherlands
0 Kudos
Message 6 of 7
(3,142 Views)

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,

 

0 Kudos
Message 7 of 7
(3,139 Views)