MaxRdgz Posted September 27, 2020 Share Posted September 27, 2020 Hello, I'm trying to the follow automatically: Open WaveForms program with a determinated workspace and run the scope 1. It's possible from .bat script? I tryed in CMD prompt with: C:\Program Files (x86)\Digilent\WaveForms3>WaveForms.exe "C:/MyWorkSpace.dwf3work" This open WaveForms but i don't know how to run automatically the first tab. Thanks and Best regards. Link to comment Share on other sites More sharing options...
1 attila Posted September 28, 2020 Share Posted September 28, 2020 Hi @MaxRdgz You can use the Script tool with Scope.run() function and the command: C:\Program Files (x86)\Digilent\WaveForms3>WaveForms.exe "C:/MyWorkSpace.dwf3work" - runscript sammit and MaxRdgz 2 Link to comment Share on other sites More sharing options...
0 MaxRdgz Posted September 28, 2020 Author Share Posted September 28, 2020 @attila Again, thanks Sr. attila 1 Link to comment Share on other sites More sharing options...
0 sergiodorazio Posted April 19, 2021 Share Posted April 19, 2021 Hi Attila, the command : "C:\Program Files (x86)\Digilent\WaveForms3>WaveForms.exe "C:/MyWorkSpace.dwf3work" - runscript" run the application with last configuration but it not run the script what is the correct syntax of "cmd" command ? how can I close Waveforms application at end of measure (by cmd command) ? Sergio Link to comment Share on other sites More sharing options...
0 attila Posted April 19, 2021 Share Posted April 19, 2021 Hi @sergiodorazio The -runscript should be without space after the minus sign. On normal "taskkill /IM WaveForms.exe" the application may ask if you want to save the changes in the workspace but you can use "taskkill /F /IM WaveForms.exe" to force close the app. sammit 1 Link to comment Share on other sites More sharing options...
0 sergiodorazio Posted April 27, 2021 Share Posted April 27, 2021 Hi Attila, I have "readCurrent" script, with 'cmd' command: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>"C:\Program Files (x86)\Digilent\WaveForms3\WaveForms.exe" "C:\Users\T0102950\default.dwf3work -readCurrent The "Waveforms" program start, the workspace start with all function that I want, but the script "readCurrent" not start . Questions: what is the correct command to start script ? can I run the application in background mode ? have you an example for exchange data from a script and an application visual basic program ? This is my script: if(!('Protocol' in this)) throw "Please open a Protocol"; Protocol.SPI.Start(); var average = 0; var data = 0; var nAmp; for(var i = 0; i < 100; i++){ Protocol.SPI.Start(); data = (Protocol.SPI.Read0(15,1) & 0x7ff); Protocol.SPI.Stop(); average += data; print("step", i+1, data) // wait hands over the execution to other process, returns false when script is stopped if(!wait(0.02)) throw "Canceled" } print("Lettura somma : "+average); average /= 100; print("Lettura media : "+average); average -= 1024; print("Lettura step : "+average); //average = average * 40000/2048; //mAmp = (average * 40000/2048)/0.89; //mAmp = (2250/89.95)*(average); //mAmp = 40000*(average - 2048)/89.95; mAmp = average * 20000 / 4096; //?????????????????? print("Current: "+mAmp+" mA"); Regards. Sergio. Link to comment Share on other sites More sharing options...
0 attila Posted April 28, 2021 Share Posted April 28, 2021 Hi @sergiodorazio Use: "C:\Program Files (x86)\Digilent\WaveForms3\WaveForms.exe" "C:\Users\T0102950\default.dwf3work -runscript Link to comment Share on other sites More sharing options...
0 sergiodorazio Posted April 28, 2021 Share Posted April 28, 2021 Hi Attila, OK , now I understand: If I must run 2 script in 2 different times, I must save 2 workspace with one script for every workspace and I run the 2 script in this way: script1 : "C:\Program Files (x86)\Digilent\WaveForms3\WaveForms.exe" "C:\Users\T0102950\workspace1.dwf3work -runscript script2 : "C:\Program Files (x86)\Digilent\WaveForms3\WaveForms.exe" "C:\Users\T0102950\workspace2.dwf3work -runscript I hop that this help other users !! For exchange data from script and visual basic I use a file, the script can write a file with these commands: var f = File("data.txt") f.write("data write") I have a last question for you: can I run the Waveforms.exe application in background mode (or hidden mode) by a 'cmd' command ? By Sergio. Link to comment Share on other sites More sharing options...
0 attila Posted April 28, 2021 Share Posted April 28, 2021 Hi @sergiodorazio The WF app can only run in foreground. For custom application or script see the WF SDK. Link to comment Share on other sites More sharing options...
0 sergiodorazio Posted April 29, 2021 Share Posted April 29, 2021 Yes, but 'THD' measure is possible only with 'spectrum measure' graphical application, in SDK interface there isn't 'THD' measure. I think that I need long time to develop a algorithm to obtain 'THD' measure from a samples sequence !! An other possibility is that 'Digilent' send me his 'THD' source code function. By Sergio. Link to comment Share on other sites More sharing options...
0 attila Posted April 29, 2021 Share Posted April 29, 2021 Hi @sergiodorazio As an alternative solution you could launch external application from the Script, with Tool.start() or Tool.exec() Link to comment Share on other sites More sharing options...
0 sergiodorazio Posted April 29, 2021 Share Posted April 29, 2021 Hi Attila, you have inverted my problem : I have a Visual Basic application that do many functions, one of this is THD measure . It isn't possible through 'waveforms SDK' , it is possible through the 'Digilent' application, through 'Digilent' script. I have tested this and it work well. My question is : is it possible lunch 'Digilent' in background mode (or hidden mode) ? You have answer NO. Have you an other solution for my problem ? By Sergio. Link to comment Share on other sites More sharing options...
Question
MaxRdgz
Hello,
I'm trying to the follow automatically: Open WaveForms program with a determinated workspace and run the scope 1.
It's possible from .bat script?
I tryed in CMD prompt with:
C:\Program Files (x86)\Digilent\WaveForms3>WaveForms.exe "C:/MyWorkSpace.dwf3work"
This open WaveForms but i don't know how to run automatically the first tab.
Thanks and Best regards.
Link to comment
Share on other sites
11 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