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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Capture the System Exec output in real time?

I am trying to write a LabVIEW wrapper for the comandline program iperf https://iperf.fr/

 

If I start iperf running with the commandline iperf -c10.1.14.107 -u -p5002 -b300M -t60 -i2 iperf will run for 60 seconds and repoort bandwidth every 2 seconds

 

I do not want to wait for the 60 seconds to end before LabVIEW gets it's "standard output"

 

I need it to take each update as iperf puts them on the screen and update an indicator (for now) in LabVIEW

 

I have tried piping iperf to a file and watching the file for changes, but I run into a sharing (file locked) situation because iperf and LabVIEW are trying to access the same file.

 

Second question:

 

Anyone know a quick and dirty way to make LabVIEW generate and measure through put on UPD traffic like iperf does

 

We need to verify 300 megabit down and 120 megabit up throughput during our environmental testing.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 1 of 6
(4,465 Views)

I don't have the iperf tool, but reading System Exec file, updated from ping, works for me (Windows 7).

 

ping_save_to_file.png

 

If you get file access problems with your command line program, it may help if you periodically copy the file and try to read the copy.

Message 2 of 6
(4,439 Views)

Ok, I downloaded iperf and used the previously posted code with it. It works without any file access problems.

 

iperf_save_to_file.png

0 Kudos
Message 3 of 6
(4,405 Views)

Intresting, that is very much simmilar to what I tried and LabView could not open the file because it was inuse by another program.

 

I will look at it again in the morning.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 6
(4,371 Views)

Okay, yeah I see what you are doing but....

 

Using a temp file is proving not a good idea, as I have to run Iperf for an extended time one enverionmental we do is a 7 day cycle.

 

Iperf needs to be running continusly to keep the data  throughput on the device >= 80% of max.

 

So after a while opening and simply displaying the temp file will be problematic as it's size grows.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 6
(4,342 Views)

Probably you can write a batch file and run iperf in a loop. Each iteration will run iperf for some period of time, then rename the temporary file, for example by adding a timestamp to the name, and  go to the next step. This will keep the temporary file size reasonable and the LabVIEW code can read always from the same file.

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