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.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

LabWindows/CVI 2013 Linux RS232

I am trying to run a RS232 serial program that I developed on LabWindows/CVI 2013 Windows7, and I have installed the LabWindows CVI Linux Run Time Engine on LINUX RHEL 7 and it seems to run great in both configs Windows 7 and Linux.

On the Linux side I am unable to do any SENDS or READS but the Comm Config seems to work fine at least it doesn't complain.  I first checked to ensure I had full access to R/W on dev/ttyS0 and I do but nothing ever seems to make in and out using a loop back serial cable.

With the same cable on the Windows side I have no problems what I send out NumofBYTES is always availble to READ and works great.

With the Windows config COM1 which is represented as an int = 1 doesn't necessarily mean that same int = 1 would map to dev/ttyS0 on the Linux side which could be one problem.

I also have never installed any additional NI Drivers on the LINUX machine such as NI VISA or NI SERIAL which are installed on the Windows side.

Any information would be appreciated I know this is a small group doing these kind of applications and deploying on Linux.

 

0 Kudos
Message 1 of 10
(3,348 Views)

NI VISA and NI Serial are not responsible/necessary for the operation of the RS232 library.

So this is probably not the problem.

S. Eren BALCI
IMESTEK
0 Kudos
Message 2 of 10
(3,280 Views)

Does anyone know if the Open Com and Open Com Config function panels in the RS232 library for LabWindows/CVI 2013 have any capability on linux for example to access serial ports if you pass the  "/dev/ttyS0" as second argument and if so then what do you pass in the first agrument?

The build on linux with the CVICC will fail if you don't pass something for the first argument but the behavior suggests it ignores "/dev/ttyS0" if you pass any int in argument 1. 
Thanks for any help!

 

0 Kudos
Message 3 of 10
(3,228 Views)

The OpenCom and OpenComConfig functions are listed under functions that behave slightly differently in Linux than in Windows:

http://zone.ni.com/reference/en-XX/help/370051K-01/cvi/differences/ 

 

From my understanding of the help documentation the first parameter is the port number that you want to map to the device name you put in. Here is a very similar forum post that gives a more in depth explanation than I have here:

https://forums.ni.com/t5/LabWindows-CVI/LabWindows-CVI-OpenComConfig-usage/td-p/1691120

 

0 Kudos
Message 4 of 10
(3,210 Views)

I do a lot of serial port programming on CVI for Linux, but I use the Posix interface, not the CVI library.

Can you actually get your serial interface to work manually in minicom ?

Message 5 of 10
(3,208 Views)

Yeah serial port do work using Minicom on Linux.   it is a little difficult to use minicom because it maybe an older version but I did get it to transmit bytes out both serial ports.

0 Kudos
Message 6 of 10
(3,206 Views)

I should also say I wrote a quick and dirty C program and compiled it with the GCC and ran it and it worked fine on both serial ports.

0 Kudos
Message 7 of 10
(3,202 Views)

So what I ended up doing was using the Linux serial libraries versus using the CVI sort of a hybrid solution thanks for this suggestion it was what ultimately ended up being my partial solution.

0 Kudos
Message 8 of 10
(3,117 Views)

Just beware that Linux gives you a TON of options for serial port (the flags for open(), the ioctl() calls, the fcntl() options, the c_flag, l_flag, i_flag, o_flag...), many of which are poorly understood and rarely used, and some will depend on your hardware adapter (in other words, some options don't actually change anything).

0 Kudos
Message 9 of 10
(3,112 Views)

How to transmit data by using RS232 from cvi2013 linux installed version (CVI is installed in Opensuse 12.1)?

All other operations are working fine, can able to access RS232 from opensuse, but could not transmit or receive data only when i run CVI linux version.


@jschafer10272 wrote:

I am trying to run a RS232 serial program that I developed on LabWindows/CVI 2013 Windows7, and I have installed the LabWindows CVI Linux Run Time Engine on LINUX RHEL 7 and it seems to run great in both configs Windows 7 and Linux.

On the Linux side I am unable to do any SENDS or READS but the Comm Config seems to work fine at least it doesn't complain.  I first checked to ensure I had full access to R/W on dev/ttyS0 and I do but nothing ever seems to make in and out using a loop back serial cable.

With the same cable on the Windows side I have no problems what I send out NumofBYTES is always availble to READ and works great.

With the Windows config COM1 which is represented as an int = 1 doesn't necessarily mean that same int = 1 would map to dev/ttyS0 on the Linux side which could be one problem.

I also have never installed any additional NI Drivers on the LINUX machine such as NI VISA or NI SERIAL which are installed on the Windows side.

Any information would be appreciated I know this is a small group doing these kind of applications and deploying on Linux.

 


 

0 Kudos
Message 10 of 10
(3,032 Views)