LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass a command into Telnet Play Script dynamically?

I'd like to pass a command into Telnet Play Script dynamically. Could I do it?

 

Thank you.

0 Kudos
Message 1 of 7
(3,948 Views)
I don't undestand your question. The input to the Telnet Play Script is an array of clusters, so you can just make this cluster to be whatever you want to reflect the script you want to perform with the VI.
0 Kudos
Message 2 of 7
(3,934 Views)

In my case I need to pass a command like "configure #n bla-bla-bla", where "#n" - number of gateway port which is set by end-user and my script doesn't know which exectly port will be configured.

It is easy to to do that when I use Write Telnet.vi - I just use the LabView function of strings concatenation.

I couldn't manage to do the same using Telnet Play Scrip.vi.

 

Thank you a lot.

0 Kudos
Message 3 of 7
(3,916 Views)
In order to use Telnet Play Script you have to tell it what text to wait for before it sends out a response. The "prompt" part of the cluster is what the VI should look for, and the "reply" is what it will send out. So, if you were sitting in front of a telnet terminal, what would you see? How would you know to enter the command "configure #n bla-bla-bla", where "#n"?
0 Kudos
Message 4 of 7
(3,909 Views)

With the "prompt" part of the cluster - everything is understandable for me - I write my Telnet prompt string there and it works well.

I have question about the "reply" part. In case if I enter the command "configure 1 bla-bla-bla"- the script works well. But I need to enter the command "configure #n bla-bla-bla" where #n is changeable (#n=5 one time, #n=3 next time and so on).

 

It seems to me that it's possible to write txt-file in "reply" part and it could be a decision for me, but it doesn't work.

0 Kudos
Message 5 of 7
(3,905 Views)

Hello Ludmilla,

 

After reading over this forum, I have some questions about the "configure" command you are using in the Telnet VIs. What is the format of the command (ie. what is the bla-bla-bla)? What is the format of the response you are expecting back? And what are you getting instead? Are you getting any error messages?

 

In your last post, you said that you would need to enter the command where #n=3 and then #n=5. Are these defined before this VI executes and placed into the array of clusters?

 

JimS


Jim St
National Instruments
RF Product Support Engineer
0 Kudos
Message 6 of 7
(3,869 Views)

Jim,

 

I've attached a vi just to show how I send a command to my gateway using Telnet Write.vi. Actually this command changes speed on entered port of my gateway. Port number is changeable. I have question: could I send this command using Telnet Play Script.vi instead of Telnet Write.vi? If Yes - then How?

Tank you

0 Kudos
Message 7 of 7
(3,800 Views)