ebrown Posted March 2, 2022 Share Posted March 2, 2022 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 More sharing options...
0 attila Posted March 7, 2022 Share Posted March 7, 2022 Hi @ebrown Warnings are fixed in the latest version: Link to comment Share on other sites More sharing options...
0 attila Posted March 2, 2022 Share Posted March 2, 2022 (edited) 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 March 2, 2022 by attila Link to comment Share on other sites More sharing options...
0 attila Posted March 2, 2022 Share Posted March 2, 2022 Hi @ebrown Link to comment Share on other sites More sharing options...
0 ebrown Posted March 2, 2022 Author Share Posted March 2, 2022 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 More sharing options...
0 attila Posted March 3, 2022 Share Posted March 3, 2022 Hi @ebrown The stdout/err is directed for Windows in WF v3.18.20-2 Link to comment Share on other sites More sharing options...
0 ebrown Posted March 4, 2022 Author Share Posted March 4, 2022 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 More sharing options...
0 attila Posted March 5, 2022 Share Posted March 5, 2022 Hi @ebrown The CWavegenConfigNode warning is fixed for the next version. Could you send me you test.js script to see what causes the CSettings/QObject print? Link to comment Share on other sites More sharing options...
0 ebrown Posted March 6, 2022 Author Share Posted March 6, 2022 This is the content of the test.js print("PRINT") stdout("STD") Link to comment Share on other sites More sharing options...
Question
ebrown
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
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 accountSign in
Already have an account? Sign in here.
Sign In Now