Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

serial port communication works in max but not in labview

Solved!
Go to solution

Hello,

 

I am trying to connect an oxygen flow controller (Bronkhorst EL flow) to a laptop through a serial to USB port adapter using both MAX and Labview. After opening MAX I see my instrument on port COM5, and need to change the settings on baud rate from 9600 to 38400. After that I querry the command :06030101217D00\r\n I can turn the mass flow controller to the maximum output (the command looks a bit odd because of the syntax of the instrument, but it works fine). If I write a vi to do the same thing and send the same string through serial visa, I do not get any result, it looks as if the command is not send to the instrument. I tried changing all the setting for the serial port, nothing seems to work.

 

I attached an example vi here, any suggestions?

0 Kudos
Message 1 of 3
(3,717 Views)
Solution
Accepted by topic author Boraxis

Hi

just a simple misunderstanding, glad you added the code.

In MAX   \r\n will always be interpreted as send a cr and linefeed.

In LabVIEW only when you select  view  \codes by right clicking on the string.

 

In your situation it sends now a \ an r another \ and a n

greetings from the Netherlands
0 Kudos
Message 2 of 3
(3,710 Views)

Great, it works!

0 Kudos
Message 3 of 3
(3,695 Views)