Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

mass flow controller communication (RS232)

Hi guys,  LV 8.5 user here.

 

I'm trying to set up a data acquisition program for reading data from my Apex mass flow controller (MFC) via RS232.

 

I'm trying to verify that the contoller is able to talk to my serial port on my PC before I even attempt the VI using some of the driver VI's available on Apex's website (i'm new to instrument control, so that is another problem I have yet to tackle).

 

I can get the MFC to talk via hyperterminal, but have not been able to get anything out of the VISA test panel via MAX, or through the "basic serial write and read.vi" program available in the example finder. 

 

In searching the forums and ni.com, I found this article Why Does My Serial Instrument Work in Hyperterminal But Not in LabVIEW or VISA Test Panels in MAX?, which would seem to be my exact problem.

 

When trying the serial loopback check, I run into issues, either from just me lacking a basic understanding, or due to a poorly written article Smiley Happy

 

Here is the loopback test article:  http://zone.ni.com/devzone/cda/tut/p/id/3450

 

The first article discusses the termination characters, and warns that the termination characters used in Hyperterminal need to match those in LabVIEW.  Hyperterminal returns no other characters with the message I type into the terminal.  In fact, having never really used hyperterminal previously, I'm not certain it's returning anything, or i'm simply seeing the original message I typed.  The MFC does spit data out to hyperterminal though, so I know that hyperterminal works to some extent.......

The loopback test works in labview's "basic serial write and read.vi" and VISA's test panel, so I think the jumper harness I made is correct.

 

Lastly, if I was able to confirm what the termination characters hyperterminal uses are, how would I go able changing anything LabVIEW is using?

 

Anyone have an article or a tip to something I'm missing?

 

Thanks

Darren

 

 

0 Kudos
Message 1 of 9
(4,751 Views)

Evidently I can't edit my message.  I just wanted to add that I'm not 100% certain that the "basic serial write and read.vi" or the VISA test panel is capable of displaying data from my MFC.  This is where my ignorance on the subject matter is hindering progress, and hence the reason for this message post.

 

esentially, what I'm after from the LabVIEW experts is this:

 

-  can I use the "basic serial write and read.vi", or the VISA test panel to get data from my MFC.  It doesn't use my instrument drivers, but neither does hyperterminal, as it's just a RS232 connection and serial port config that it uses.

 

I tried *@=@ and the *@=a to switch from streaming and polling modes.  Hyperterminal is fine with these commands.

 

- if the termination characters is a problem, I need further explanation on where to use them, find them.

 

Thanks

Darren

0 Kudos
Message 2 of 9
(4,742 Views)

The basic example is as capable of communicating data as is hyperterminal.

 

The termination character in the example is the the \n that you see in default string to write. When '\' Codes display is chosen (a right click option) the \n is the way that a line feed is specified. The \ code for a carriage return is \r. You can use these in the front panel or use the constants on the block diagram with the concantanate string function. You can also specify a single termination character with a VISA property node. This is what the advanced serial example does.

 

Typically, hyperterminal appends a CR and LF when you press the enter key.

0 Kudos
Message 3 of 9
(4,738 Views)

Ok, for some reason that makes sense to me now.

 

I tried adding \r\n to the string to write box, *@=@\r\n, but that still didn't get me any output from the MFC.

 

The tutorial says that typically hyperterminal adds both to each line:

 

Typically, Hyperterminal appends a \r\n, which corresponds to a carriage return followed by a line feed, at the end of each message it sends.

 

And I don't see exactly how to find what hyperterminal is sending , just to confirm

 

thanks

Darren

0 Kudos
Message 4 of 9
(4,735 Views)

did you have the string control displaying /codes?

greetings from the Netherlands
0 Kudos
Message 5 of 9
(4,712 Views)

No.  Are you referring to the visa read section?

 

I was able to "blunder" into the correct solution by using \r for the termination character on the input visa write command.

 

how would I go about having the string control displaying the / codes?

0 Kudos
Message 6 of 9
(4,696 Views)

try a right click on the string control, not the visa control please.

greetings from the Netherlands
0 Kudos
Message 7 of 9
(4,694 Views)

Hi Darren,

 

I have been working through a similar issue. I have been trying to communicate with a SRS QMS200 residual gas analyzer over a RS232 port. Initially the LabVIEW serial port read and write example wouldn't work. After I manually added (in the block diagram) a return character via the concatenate character icon and figured out all the correct serial port settings from the manual I was good to go.

 

Regards,

 

Tom

 

PS

We use a lot of mass flow controllers in our lab, but none of them use serial communication. Ours simply rely on fixed dc voltages on some lines, variable analog settings on an input line, and then a 0-5 V signal on the output line. I guess we always picked up the cheaper  models 🙂

0 Kudos
Message 8 of 9
(4,675 Views)

I used the basic serial read and write to verify communication before trying to write my own code.  That was the problem, as the basic program doesn't know what termination characters my device needed (an Apex MC series mass flow controller).  From that, I downloaded the instrument drivers available from idnet (for the Alicat meter, turns out its the same device) and the communication worked flawlessly.

 

My next issue is logging an analog signal with the serial communication data.  I need to save the data as well.  SOme issues already starting.  i'll post another question on these though.

 

Thanks

Darren

0 Kudos
Message 9 of 9
(4,671 Views)