Jump to content
  • 0

Execute and run workspace


MaxRdgz

Question

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

  • 0

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

  1. what is the correct syntax of "cmd" command ?
  2. how can I close Waveforms application at end of measure (by cmd command) ?

Sergio

Link to comment
Share on other sites

  • 0

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:

  1. what is the correct command to start script ?
  2. can I run the application in background mode ?
  3. 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

  • 0

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:

  1. 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

  • 0

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

  • 0

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

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...