LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI Serial port communication unlike HYPERTERMINAL (Agilent 33250A)

"Agilent 33250A is a function generator. It responds to simple strings vis COM port, such as: "APPL:SQU", "OUTPUT ON", etc...

I used the windows HPERTERMINAL with "Send line ends with line feeds" enabled, the instrument worked well.

But I can't make it work with .vi file. COM setting is correct because 33250A shows "remote" icon immediatly after string sent. It will respon "error" to any mismatched setting (e.g. 9600 vs 115200). So, the connection is there but it just doesn't respond to commands.

I don't know why. I attached two .vi files that I am using to communicate with the Agilent 33250A. Would someone can help to see what's the bug that make those .vi to send different string th
an the equivalent string sent by HYPERTERMINAL?

I apprecite your help. Thank you in advance.

Jian
Download All
0 Kudos
Message 1 of 6
(3,625 Views)
You need to append the line feed to your string in the VI. Neither VISA or the old serial VIs does that for you.
0 Kudos
Message 2 of 6
(3,625 Views)
Dennis:

Can you expain it briefly how to append line feed after the string? I never used the vi/visa com and
didn't find the way to do that. It might take me long to figure it out. Adding a "\n" doesn't work.

Thanks.

Jian
0 Kudos
Message 3 of 6
(3,625 Views)
In order to append a line feed inside your string control, you have to first enable "\" codes. You do this by right clicking on the control. Without doing that, when you type \n into the control, it gets interpreted as the characters \ and n. To append the line feed on the diagram, connect your string control to the first input of a concatenate strings function and wire a Line Feed Constant to the second input. The Line Feed Constant is on the String palette. Wire the output of the concatenate function into either the serial or VISA write. I've attached a picture to show you what I mean.
0 Kudos
Message 4 of 6
(3,625 Views)
Mnay thanks for the tip. Both vi and visa versions work now.

You said: " In order to append a line feed inside your string control, you have to first enable "\" codes. You do this by right clicking on the control. Without doing that, when you type \n into the control, it gets interpreted as the characters \ and n."

But right click the control gives only "display \ code" (It showed "line feed" is a "\s") not "enable \ code".
Jian
0 Kudos
Message 5 of 6
(3,625 Views)
A \s is a space. If you typed \n before you turned on \ codes, delete it and reenter it.
0 Kudos
Message 6 of 6
(3,625 Views)