Driver/Program Shortcut Compile Setting

Ben W.
King of Prussia, PA

Aug 4, 2016
8 Posts

0  |  0  

Re: Driver/Program Shortcut Compile Setting

Ronnie,

Is there any way to set the compile flag for all driver procedures at once? I was able to do this fairly quickly (compared to checking option in all procedures individually) using a find/replace command in a text editor with the text version of a driver file. However, if there is not another way, then I think it would be an excellent feature to add to ATEasy to be able to simply check a box in the driver shortcut in the system driver. This would allow multiple projects/system drivers to utilize the same driver file with different compile options. I understand there will most likely be a limitation that multiple copies of the same driver within the system driver will have to use the same setting, but that is the same as it currently stands. The same feature could be extended to program shortcuts and possibly system driver properties.  Let me know what you think.

Thanks,

Ben

DrATEasy (Ron Y.)
Mission Viejo, CA

Aug 4, 2016
367 Posts

0  |  0  

Re: Driver/Program Shortcut Compile Setting

No there is no way  to set all of the procedure compile  However I don't think it is needed since you can use Build, CheckAll command to make sure that all of the procedures compile (it will check everything), and when the driver is included in a project it only compiles the functions that are referenced which works faster and generates smaller memory footprint.

Ben W.
King of Prussia, PA

Aug 5, 2016
8 Posts

0  |  0  

Re: Driver/Program Shortcut Compile Setting

Ronnie,

Procedures are not always automatically compiled in the case of using a procedure variable type to dynamically call procedures/commands based on a built string. This is useful for making identical calls to multiple instances of instruments such as DMM1, DMM2, DMM3, etc. without having to explicitly call each driver interface. For example:

For i = 1 To 5
    Proc = "DMM" + Str(i) + " Measure"
    MeasurementArray[i-1] = Proc()
Next

will be equivalent to:
MeasurementArray[0] = DMM1 Measure()
MeasurementArray[1] = DMM2 Measure()
MeasurementArray[2] = DMM3 Measure()
MeasurementArray[3] = DMM4 Measure()
MeasurementArray[4] = DMM5 Measure()

Code reuse and efficiency only increases as  the sequence of commands increases. The compiler is not quite smart enough to recognize the built string as a procedure that must be compiled. In some cases it might not be possible at all since it could rely on user input, a configuration file, etc. I'm suggesting as an ATEasy feature that if the driver shortcut could specify to compile all rather than on a per-procedure basis within the driver file, then unnecessary compilations wouldn't need to be made for projects that share the driver but do not use dynamic procedure calls.

Thanks,

Ben

Solution Available
DrATEasy (Ron Y.)
Mission Viejo, CA

Aug 5, 2016
367 Posts

1  |  0  

Re: Driver/Program Shortcut Compile Setting

Yes, if you are using procedure variables and you are setting them using a string literal instead of the procedure literal,  ATEasy will not compile it since the expression is evaluated at run time and not during compile. I will add your request to our suggestion list.

Raz A.
Haifa,

Aug 10, 2016
82 Posts

0  |  0  

Re: Driver/Program Shortcut Compile Setting

Are you sure that when you use procedure variables and use them as a string literal it wont compile it?

i just tried to do to something like this:

Proc = "func"
Proc()

func() is a function that just prints "i am compiled"

when i run the program it prints "i am compiled", although compile flag of func() isnt set, how can it be?

ive attached the sources


File Attachment:
RAZ COMPILATION.zip

DrATEasy (Ron Y.)
Mission Viejo, CA

Aug 10, 2016
367 Posts

0  |  0  

Re: Driver/Program Shortcut Compile Setting

Yes [Raz], this will work (procedure string literal generates a refrence), however if you did:

s="func"
Proc=s
Proc()

You will get a run -time error since at compile time proc=s does not know that s contain "Proc".

Raz A.
Haifa,

Aug 11, 2016
82 Posts

0  |  0  

Re: Driver/Program Shortcut Compile Setting

Ok, got it!

Ben W.
King of Prussia, PA

Aug 23, 2016
8 Posts

0  |  0  

Re: Driver/Program Shortcut Compile Setting

Thanks, Ronnie. By the way, I don't seem to be getting email notifications for any replies to forum posts. I selected the option to receive them but so far have not actually gotten any.

DrATEasy (Ron Y.)
Mission Viejo, CA

Aug 23, 2016
367 Posts

0  |  0  

Re: Driver/Program Shortcut Compile Setting

Should work now.



Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click here to register today!

All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk. [Read More]