LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CMD (command line interface) control using Labview 2011.

Solved!
Go to solution

Hello,

 

I'm trying to control a software that has a command line interface using LabView 2011 but I'm having problems at the moment to read the information back.

Attached is the VI I created until now, but it does not work properly.

Problems until now:

 

1.- If I use ReadLine(), it hangs showing no error and nothing else.

2.- ReadToEnd() Same problem as previous line, the software just hangs at that step.

3.- If I compare the response from "peek" waiting for the -1 indicating there is no more character, the software hangs as previous steps.

 

Do you have some clues on what could be wrong or another way to "control" the CMD to send messages, read back and then send messages, etc...

Thank you very much for your help.

0 Kudos
Message 1 of 5
(4,022 Views)

Hi Harman,

 

1. Replace all stacked sequences by flat ones.

2. Show the label of all terminals! (Why did you hide them anyway?)

3. Replace all local variables by wires.

 

When you have done this you could check those different reference controls you use in your VI.

Why do you use "StandardInput" and write this into "StreamWriter Ref"?

Why do you write "StandardOutput" to "StreamReader Ref"?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(4,019 Views)

Hello GerdW,

 

Thank you very much for your feedback.

About your two last questions, why not ?, what do you recomend to use ?.

 

Thanks,

0 Kudos
Message 3 of 5
(4,015 Views)

Attached the new VI,

 

 

0 Kudos
Message 4 of 5
(4,008 Views)
Solution
Accepted by topic author HarmanAlexander

I have done this before - I posted about it on the forums here: https://forums.ni.com/t5/LabVIEW/How-to-open-close-and-monitor-a-application-xyz-exe-using/m-p/32511...

 

I did also wrap it up into a library at some point and post it on the forums but I couldn't find that particular post.


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 5 of 5
(4,003 Views)