cancel
Showing results for 
Search instead for 
Did you mean: 

call and make changes to script

ZCY4444
Member

call and make changes to script

Hello,

 

I want to call a script and make changes to some of the numbers in that script and run it.

Can I just call the script without running it using System Exec vi?? I can separate the numbers from the script output after running it with system exec. But I want to get the default numbers in the script without running it. 

And after I get the numbers, how can I replace the numbers with whatever the numeric control input? 

 

Thanks a lot

6 REPLIES 6
RavensFan
Knight of NI

Re: call and make changes to script

What kind of script are you talking about?

 

Matlab script?

Java script?

a batch file?

ZCY4444
Member

Re: call and make changes to script

It is a batch file. The vi calls another software and execute the script.

 

Thanks

Highlighted
RavensFan
Knight of NI

Re: call and make changes to script

If it is a batch file, then you must use system Exec to run it.  Unless there is some other method I have never heard of.

0utlaw
NI Employee (retired)

Re: call and make changes to script

Hello ZCY 4444,

 

It seems like what you're looking for is a way to edit the script, not "call" it.  Batch files are just text files, so you should be able to read it as such, modify the strings, and resave as needed.

 

I'd recommend adding one or more arguments to the script that override these "numbers" though, rather than reading and replacing the file.

 

Regards,

Tom L.
ZCY4444
Member

Re: call and make changes to script

Hi Tom,

 

Thanks for the suggestion. I will work on that.

 

Regards,

zcy

ZCY4444
Member

Re: call and make changes to script

Thank you. I will keep working on it,