LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I determine expected output size for System Exec vi

I am running a DOS exe from a Batch file using the System Exec vi. My exe is programming software for a microcontroller and passes data to the programmer via the serial port. When I run the batch file externaly to LabView it works fine. When I run the same batch file using the System Exec vi I get an error from the programmer app (DOS app). Not every time but usually within 20 attempts. I reduced the execution priority of my vi's to give more time to the DOS window. This seems to have helped but hasn't solved the problem completely. I read in the help file that LabView will run more efficiently if you specifiy the expected output size in the System Exec vi, but how do I determine it? Is the expected output
size the size of the bat file I call?
0 Kudos
Message 1 of 9
(4,848 Views)
> I am running a DOS exe from a Batch file using the System Exec vi. My
> exe is programming software for a microcontroller and passes data to
> the programmer via the serial port. When I run the batch file
> externaly to LabView it works fine. When I run the same batch file
> using the System Exec vi I get an error from the programmer app (DOS
> app). Not every time but usually within 20 attempts. I reduced the
> execution priority of my vi's to give more time to the DOS window.
> This seems to have helped but hasn't solved the problem completely. I
> read in the help file that LabView will run more efficiently if you
> specifiy the expected output size in the System Exec vi, but how do I
> determine it? Is the expected output size the size of the bat fi
le I
> call?

If you think it is due to timing, and you wish to yield to the DOS app,
don't just lower the priority of LV, but use Wait ms to put overeager
diagram elements to sleep and limit their loop rate. Use the task
manager or performance monitor of the computer to determint if this is
the issue.

Greg McKaskle
0 Kudos
Message 2 of 9
(4,848 Views)

You never answered the oiriginal question -- instead you suggested a solution to the problem he was having. But I'd like to know what "expected output size" means and how to calculate it. 

0 Kudos
Message 3 of 9
(4,130 Views)

Rather than complaining about the reply on a 15 year old message thread as your first message on the forums, it would be best if you just created a new message thread where you provide your question and details as it applies to your situation.

 

Are you trying to solve a particular problem you are having?  Are you just curious to know more about "expected output size"?

 

System Exec function is really not used all that commonly in LabVIEW, probably not as much as you might think.  And information about that output is probably even farther out there in terms of importance.  The fact you had to dig back to such and old thread pretty much reflects that.

0 Kudos
Message 4 of 9
(4,127 Views)

@lharley wrote:

You never answered the oiriginal question -- instead you suggested a solution to the problem he was having. But I'd like to know what "expected output size" means and how to calculate it. 


"

Use expected output size to improve memory efficiency. Use a number slightly larger than the output size you expect. The command runs if you exceed this size, but LabVIEW uses its memory less efficiently. The default is 4096

"

 

You "calculate it" by counting the number of characters returned by the function you are calling.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 9
(4,124 Views)

@RavensFan wrote:

Rather than complaining about the reply on a 15 year old message thread as your first message on the forums,


Only 14 Years, 4 months, 2 days.  Good contender but the record I've seen is 15 years 10 months.

 

Here is the help on the function.  If you expect to get back more than 4K, then set the number higher.  Otherwise leave it alone.  Are you having issues with the function?  I doubt performance differences are that noticeable with numbers closer to the actual output.  The input was likely more important back on late 80s computers (or early 90s) when initializing a buffer was a more carefully considered memory operation than it is now.

0 Kudos
Message 6 of 9
(4,117 Views)

Just to be clear, this isn't my first message -- I have asked a few others. I am not having a particular problem, so I didn't see any point in creating yet another message thread. I didn't mean to offend anyone.

 

0 Kudos
Message 7 of 9
(4,092 Views)

If you created other messages, then it must have been under a different username, because your profile showed you posted once.  And now shows twice.

 

While the forum is generally, ask a question, get some answers, in reality we are trying to help people solve their problems, and that sometimes means not answering the question that they asked, but actually trying to find out what they are really trying to do.

 

Your message came across as a complaint about that, though I'll take your word that you didn't mean it that way.  Smiley Happy

 

0 Kudos
Message 8 of 9
(4,087 Views)

Well, it's quite a conversation here and I see someone already answered this question, thanks for your contributions.

I do have another question somehow similar to this but not exactly and since the discussion is warmed up here I didn't make a new post.

I'm running a Perl API in Labview using System Exec and my API returns more than 4096 (something close to 8000). Without changing this setting the function runs fine on my computer but just to be ideal I changed this setting to 10240, the function still works fine on my computer but when installed the project on another PC, it crashes. I tried removing this setting (4096 default) and it didn't crash on another computer. I repeated this change a couple times and whenever my setting is 10240 for output size the other computer crashes. Now the question is, is there any limitation maybe hardware related for this setting that causes the other PC to crash?

Thanks

0 Kudos
Message 9 of 9
(3,985 Views)