Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

I/O Compatibility --> Serial Port Write in Linux

I know that usage of old I/O Compatibility VIs is deprecated...

I know that NI-VISAhas a lot af advantages over the old serpdrv...

I usually use NI-VISA to develop my applications...

...

but for a specific project I need to send and receive data through COM port and I can't waste RAM loading all the VISA RunTime Engine.

I read a thread of some years ago announcing an upcoming less-than-1-megabyte VISA serial installation,but I can't find it in NI website

 

I wrote a simple VI (LabVIEW 6.1) to reproduce the strange behaviour:

Run the attached VI, then chose a file on your Hard-Disk more or less 50kB large, and this program will send it byte-after-byte throug COM port 

- under Win XP Pro SP2 everything works fine and all the file issent

- under OpenSUSE 10.2 only the first 4096 bytes are sent, then the program doesn't return from the Serial Port Write function 

 

Could anyone give me a workaround to send all the file also in linux?

 

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 1 of 6
(4,065 Views)

Hi Vix,

as far as I know, no "less-than-1MB VISA serial installation" has been released. Is the current VISA Run-Time Engine (4.5 version) too larger for your PC?

The Linux distibution you are using (OpenSUSE) is not officially supported by National Instruments. Anyway, what exactly do you mean with "the program doesn't return from the Serial Port Write function"? Do you get any error code?

 

Bye!

Licia

0 Kudos
Message 2 of 6
(4,049 Views)

Hi Licia,

I think it's a pity that no "less-than-1MB VISA serial installation" has been released. For several application only a basic serial RS232 usage is required...

I know that openSUSE is not officially supported, but the VISA RunTime Engine supports it (see here)
With "the program doesn't return" I mean that the exacution of the Serial Port Write VI starts, but it doesn't end... I don't know where the execution is hung because in this VI the debug feature is hidden..

 

vix

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 3 of 6
(4,046 Views)

Hi Vix,

try opening Serial Port Write.vi, go to its VI properties and in category "Execution" select "Allow debugging": execution highlighting and single stepping should become active. In this way, you could be able to debug your application.

Also, wire an indicator to "error code" output of Serial Port Write.vi: maybe it could give us further indications. It also could be a problem of timeout...

Bye!

 

Licia

0 Kudos
Message 4 of 6
(4,042 Views)

If I enable "Highlight Execution" everything works fine.

If I disable it, the program hangs while executing the VI indicated in the attached image (I don't know its name because the Help only says "Function no longer supported" - maybe "Write Device"?).

So I introduced a 1 second delay between two "Serial Port Write" calling, and the program seems OK.

But should this workaround be considered OK? Or could I find other problems in the future, or in other situations (for example, sending larger files)?

Do you know in Linux such a delay is mandatory?

And do you know its minimum value? Of course it slows the communication speed, so I don't want a delay longer than necessary....

 

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 5 of 6
(4,032 Views)

Hi Vix,

I'm glad you have been able to solve your problem: thank you for posting your solution!

If everything works fine when Highlight Execution is enabled, then we can argue it was a timing issue needing a delay to properly communicate with the serial port.

I dont't know why this delay is necessary in your application on Linux, maybe there are differences in the O/S performances or in the driver settings (timeout,...), nor the minimum value, which has to be found by attempts.

Sorry not being of more help!

Bye!

 

Licia

0 Kudos
Message 6 of 6
(4,025 Views)