Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Commands

I am having trouble communicating to what is supposed to be a plug and play instrumentation. They are multiposition valves from VICI, they are connected via RS232 to my PC, and normally these valves are run using HyperTerminal. However, I would like to run them using LabVIEW. I have established simple communications with the manufacturer's settings, but I am unable to send and receive commands to and from the valve. I.E. Set to position 10, reset. I will be daisy chaining several valves together, but setting the addresses is simple enough. Could you help me? Should I keep trying to run them through LabVIEW or should I use LabVIEW to open and automate HyperTerminal? What do you suggest? Thank you.

Patrick
0 Kudos
Message 1 of 27
(7,381 Views)

I'm not sure what you mean by you've 'established simple communications with the manufacturer's settings'. Do you mean the all you've been able to do is run the VISA Configure Serial Port? If so, that does not communicate to anything except the serial port on your pc. Are you running one of the shipping examples that come with LabVIEW? If so, which one? For the Basic Serial Write and Read, it's important that you use the \r\n control codes in the string to write. There are the control codes for carriage return and line feed. Many instruments require one or another (or both) in order to process any command you send.

As long as you are able to communicate to the instrument with Hyperterminal, you can use LabVIEW to do the same thing. Besides, there is no way to automate Hyperterminal.

Message 2 of 27
(7,369 Views)
Dennis,
 
I just posted a very similar question and you solved it with this response.  My problem was that the command was not reaching the instrument because I was using \n (linefeed) where the instrument was looking for a \r.  Replacing the write string with \r works beautifully. 
 
After spending a full day yesterday troubleshooting, it is nice to be back on track.   
 
Thanks,
Tim
Message 3 of 27
(7,350 Views)
So adjusting the string will fix the issues I'm having?
0 Kudos
Message 4 of 27
(7,344 Views)
pbuckley,
 
I'm not sure but it is something you should try. You haven't posted any information on the make and model of the instrument, posted the programming manual, or mentioned whether you are using the shipping example, the Instrument I/O Assistant, or something else. You haven't given a lot of information except that you seem to have a problem. Not providing a termination character is an extremeley common mistake.
0 Kudos
Message 5 of 27
(7,346 Views)
Sorry about that.  I am knew at this forum thing.  I will automatic the functions of four Valvo Instruments Co. Inc. (VICI) stepper valves (2 multi-position and 2 two-position).  These valves will be part of a complex plumbing system for an experimental air quality monitor I am building.  The operation docs will be included at the end.  What I've been able to do thus far is configure the serial port (using VISA Configure Serial Port).  However, I don't think basic read and write commands are what I need to be using.  I need to be telling the valves to open to a certain position (i.e. Valve 1 to open to position 6 and then reset after a time period).  Now, according to the documents I've attached the valves can be controlled using Windows HyperTerminal, so that's why I was asking earlier if there were a way to automate HyperTerminal through LabVIEW , perhaps via ActiveX controls.  I hope these docs help.


Download All
0 Kudos
Message 6 of 27
(7,335 Views)
VISA Reads and Writes are exactly what you need to be using. With each command you send, you just have to terminate it. The manual says you have to use the <enter> key. In Hyperterminal, what that does is append the CR and LF. As I already mentioned, the shipping example does that. When you right click on a string control or indicator, you can select '\' Codes Display. The '\' code for a CR is \r and the '\' code for a new line is \n. This is the same thing as hex 0D and hex 0A. You can also append the CR and LF to your commands with the Concantanate String function. On the string palette, there are constants for CR and LF that you can wire up.
 
And, I will repeat, there is no way to automate Hyperterminal. There is no ActiveX interface for it. The people who make Hyperacess sell a product called Hyperterminal which does have an ActiveX interface but you don't need that.
0 Kudos
Message 7 of 27
(7,333 Views)
Wow, thank you. I will give that a try. If I can get that to work, I will be well on my way. I will try that this afternoon and let you know what happens. Thank you so much.
0 Kudos
Message 8 of 27
(7,326 Views)
What I meant to say was the people who make Hyperterminal make a product called Hyperaccess.
0 Kudos
Message 9 of 27
(7,325 Views)
I'm also looking for a vi to control a valco multiport valve. If anyone has done this already, I would appreciate receiving a copy - before I do the work myself 🙂
lukas.emmenegger"at"empa.ch; Thanks!
0 Kudos
Message 10 of 27
(6,684 Views)