Your Products have been synced, click here to refresh
Good day,
what do you mean by "run" ? read or write? It doesn't really make a difference, you can't determine from which source a variable was written, you can only read out the content.
It is also not possible to determine whether a measurement program was started by pcDMIS itself or by automation, if that's what you meant.
You can maybe create a second variable and write it there if the first one was changed by automation, maybe that will help.
ASSIGN/V1=GETPROGRAMINFO("PARTPATH") ASSIGN/V2=INDEX(V1,"TempExecutionLocation") ASSIGN/RUN_FROM_INSPECT="FALSE" IF/V2>0 ASSIGN/RUN_FROM_INSPECT="TRUE" END_IF/
Inspect has an option (in the settings area) to create a temporary copy of the routine rather than run it directly. The temporary routines are saved in the following location...
C:\Users\ account name\AppData\Local\Temp\Hexagon \Inspect\TempExecutionLocation
If you turn that setting on, you should be able to use the the GETPROGRAMINFO("PARTPATH") function to distinguish between a routine which is being run from the temporary location and one that isn't. This would therefor provide a way for you to know if the routine was run from Inspect (temporary location) or from Operator mode (usual location). You would need to add something similar to this to each routine...
ASSIGN/V1=GETPROGRAMINFO("PARTPATH") ASSIGN/V2=INDEX(V1,"TempExecutionLocation") ASSIGN/RUN_FROM_INSPECT="FALSE" IF/V2>0 ASSIGN/RUN_FROM_INSPECT="TRUE" END_IF/
This is the Inspect setting that you'd need to turn on...
{"alt":"Click image for larger version Name:\tScreenshot 2022-10-04 110758.png Views:\t0 Size:\t422.8 KB ID:\t521345","data-align":"none","data-attachmentid":"521345","data-size":"custom","height":"539","title":"Screenshot 2022-10-04 110758.png","width":"958"}
Do you exit PCDmis when switching between inspect and operator mode? So you have two shortcuts that runs each software? If so, just modify the shortcuts into a script that writes to a text file a 0 when running the inspect shortcut or 1 when running operator mode and have your programs read it and behave accordingly.
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |