hexagon logo

Assign variable, PCdmis or Inspect running?

Hello!

Fast question! Is it possible to assign a variable that will let us know if it is run by pcdmis directly or through inspect (be 0 if run by inspect for example and 1 if run through pcdmis)? Thanks in advance!
Parents
  • 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...
Reply
  • 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...
Children
No Data