cancel
Showing results for 
Search instead for 
Did you mean: 

XMC CLI Task - sleep X seconds

XMC CLI Task - sleep X seconds

M_Nees
Contributor III

using XMC execute CLI commands …

 

searching for a command which makes a pause between 2 commands like:

 

show port X error no-refresh

pause 10

show port X error no-refresh

 

(sleep X or time.sleep X from XMC scripting does not work!)

 

Any ideas ?

1 ACCEPTED SOLUTION

StephanH
Valued Contributor III

Hello Matthias, 

you can't switch to TCL in CLI Command, that's correct. As far as I know CLI Command is a plain command input option without an intepreter, therefore you have to switch to task an TCL.

But as I wrote in difference to python no further code is necessary (only three lines from your example) therefore the code part is not realy complexe only the menus to start a script and select an name and usergroup is more complexe.

Regards Stephan

View solution in original post

7 REPLIES 7

StephanH
Valued Contributor III

Hello Matthias, 

you can't switch to TCL in CLI Command, that's correct. As far as I know CLI Command is a plain command input option without an intepreter, therefore you have to switch to task an TCL.

But as I wrote in difference to python no further code is necessary (only three lines from your example) therefore the code part is not realy complexe only the menus to start a script and select an name and usergroup is more complexe.

Regards Stephan

M_Nees
Contributor III


Hi Stephan,

i cannot select TCL in a CLI Command Task. If yes how ?

 

Switch over to Tasks - add script … this enters the compexity of scripts … (if i do that i use python - time.sleep X)

 

It seems XMC cannot handle this at this point.

 

BR,
Matthias

StephanH
Valued Contributor III

Hello Matthias,

TCL is the trick. You have to hide your “sleep X” command from the switch CLI.

Therefore select TCL (not CLI) and use (for a test):

 

show time
sleep 15
show time

Should work fine.

 

 

Regards Stephan

M_Nees
Contributor III

You are right but python scripts are too complicated for much customers/users.

 

So i am looking for a way with the easy “Executing CLI commmads”.

 

As a workaround sometimes i use a “save config” but this is not very smart.

Your approach is much more smart, but works only on EXOS - no VSP, no EOS, …

 

 

GTM-P2G8KFN