Jump to content
  • 0

Getting command line prints from scripts (not the output window)


ebrown

Question

I am trying to automate testing using scripting.

I want to use the network and spectrum analysers which is why I am not using the SDK option.

 

Question,

If I am executing script from the command line, for example,

"waveforms example.dwf3work -script example.js" 

Is there any way of piping the output console in waveforms to the command line so i can externally access status information.

The only way in the documentation seems to be through saving of information to files.

A simple example is knowing when the script is complete by printing to the command line "COMPLETE"

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

Hi @ebrown

In the next software version when the Output view is closed the print function will be directed to standard output and there will be a dedicated stdout function.

Wouldn't be easier for you if the testing is controlled from WF/Script ?
External apps can be started or commands executed using Tool.exec (wait) or Tool.start (no wait)

Edited by attila
Link to comment
Share on other sites

  • 0

Thankyou for such a fast response and additional feature addition.

However, can you explain the usage as I couldn't get it to work.

If I call this from the command line "waveforms example.dwf3work -script example.js" 

The command line executes and opens the waveforms but it almost instantly returns to a new command line. i.e. it does not keep the previous command line open so it won't be able to receive any stdout output presumably

If I force it to stay open using "start /wait waveforms example.dwf3work -script example.js" I still don't see any output

Finally if I pipe the output to a file I still don't see anything in the output file "waveforms example.dwf3work -script example.js > output.txt"

 

I have closed the output window in Waveforms and my script runs the following commands,

print("PRINT")
stdout("STD")

Link to comment
Share on other sites

  • 0

Thanks for the update.

I have downloaded and installed the update.

I am running under administrator mode in the command line.

However when I run it I get thread errors before the print statements execute.

It seems to be related to when instruments are included in the workspace.

If I open a blank workspace from the command line I don't get thread errors

D:\WaveForms3>start /wait WaveForms.exe test.dwf3work -script test.js
QObject: Cannot create children for a parent that is in a different thread.
(Parent is CSettings(0xa93ecfa9b0), parent's thread is QThread(0x1cc72a897c0), current thread is QThread(0x1cc75f5f5d0)
QObject::connect: Cannot connect (null)::Sig() to CWavegenConfigNode::DoSig()
QObject::connect: Cannot connect (null)::Sig() to CWavegenConfigNode::DoSig()
QObject::connect: Cannot connect (null)::Sig() to CWavegenConfigNode::DoSig()
QObject::connect: Cannot connect (null)::Sig() to CWavegenConfigNode::DoSig()

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...