From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Communication rs-232 using LabPython

Hello,

 

I want to control and make a UI for a mass flow meter-controller using LabView but it appeared that I have to use some ASCII characters that are not supported in LabView or in browsers.

A colleague wrote me a script in python that send the command in the shape of  "chr(int)" instead of using ASCII.

 

For example: "Sinv2.000 + CRC + cr" is converted to "chr(83) + chr(105) + chr(110) + chr(118) + chr(50) + chr(46) + chr(48) + chr(48) + chr(48) + chr(143) + chr(85) + chr(13)" in python

 

Now I have to execute the script inside of a LabView VI, I use for this LabPython.

 

I tried to follow advices from different forums but it seems that my VI doesn't want to do the link between the controller and my script.

 

I have never used Python before thus the problem might come from the script.

 

 

-Leo

 

 

PS: I need to execute my VI on a computer that doesn't have LabiView nor Python. What should I install to make the executable works?

 

 

 

0 Kudos
Message 1 of 2
(3,224 Views)

Hello,

 

You can use LabVIEW to convert ASCII Characters to ASCII Codes and Vice Versa : http://digital.ni.com/public.nsf/allkb/B9142E44E5363BAD86257441005A7454

 

Best regards,

 

Dasso

 

 

0 Kudos
Message 2 of 2
(3,186 Views)