hexagon logo

Variables Dropping, Lighting flipping, and problems, Global Variables. suggestions?


All,

I've been working with a hexagon tech extensively building a program template to globally handle our structure for global editing as we are re-developing our quality systems and tracking capabilities.

Note: 2017 R2 (Service Pack 5) at both locations - Programming offline at desk - Exporting to server - Running at machine

Effectively a program looks like this. (Disclaimer: I'm very much a novice at programming.)
<Initilize>
<Callsub: FormSub; Initial Form> calls the initial form for the operator input
<Callsub: VarSub; Variables> calls the global variables for light, %tol and other misc settings
<Callsub: VarSub; Tracefields> generates tracefields and writes form data to a .txt file to later be read into the part program (Done for future-proofing; ie adding tracefields globally)
<generate header page for report>

<program specific information, file paths etc.>
<program features>
<append report with features>
<save into file structure, if no file structure - create file structure>
<datapage output>
<end>


This is mostly working great. But i have a feeling that my variables are being dropped.

PROBLEM #1:
I have one variable, for parallelism, checking the cut of the sample (aluminium extrusion). The lighting variable values are passing, as well as this one, but this one will not ... sorta. If i write this code in the program
Ex:

<From VarSub>
Assign/Light=80
Assign/Light2=60
Assign/Flat=.4

<From VarSub>

<comment(y/n): FLAT>

Dim(Parallelism) <Parallelism to stage check>

If/ Parallelism.meas>FLAT
<Comment: Re cut sample>
Goto/ENDPRG
End_IF/

Label=ENDPRG





At the end of the program if i hover over the variables all of the correct values are shown. However at my comment prompt, It will show a value of one. (Edit: Incorrectly stated it was returning a Zero value, bad memory, see additional posts.)


PROBLEM #2
(See Attachments, at bottom ) When I write at my desktop, the 'physical' position that PCDMIS writes the light settings --> gets imported differently at the machine.
Ex:
At Desktop reads:
<--,YES,-1,-1,-1,NO,Top Light=<OFF,0,OFF> ,Bottom Light=<OFF,LIGHT,ON>,Ring Light=<OFF,0,OFF>

At Machine reads:
<--,YES,-1,-1,-1,NO,Bottom Light=<OFF,0,OFF> ,Top Light=<OFF,LIGHT,ON>,Ring Light=<OFF,0,OFF>

Almost as if it's reading the string file in a different order. So every offline program requires an edit for this, or I'll have to get used to programming the wrong light settings.

PROBLEM #3
I have a variable for RPT_Path... I feel like maybe this one is something I can do more investigating into. Each program contains the original assignment for this report path. Then an executable file creates a folder for the Tool Copy Number, a sub folder for the year, then a subfolder for the month and saves the file in that location. Right now it is saving it in the original test templates location.






Any thoughts would be greatly appreciated!!!!!!!!!!

Thank you!



Attached Files
Parents
  • vpt.se - Thanks for your response! Was unfamiliar with how to post here. Thank you!

    I'll paste the code in a few responses.

    #1.) Sorry, I didn't mention that that is what I am trying to show in the example for number one, is the unsuccessful debugging. I've put a comment to trace the value and can tell it's dropping out or at least not being used. It should be returning a value of .4


    #2. )At my desk top the code for any feature will read:
    CIR3       =FEAT/VISION/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                THEO/<-3.2,-6,0>,<0,0,1>,4.12,0,0
                ACTL/<-3.2,-6,0>,<-0.0412971,-0.024986,0.9988344>,4.118,0,0
                TARG/<-3.2,-6,0>,<0,0,1>
                ANGLE VEC=<1,0,0>
                SHOW FEATURE PARAMETERS=NO
                SHOW_VISION_PARAMETERS=YES
                  TYPE=AUTOMATIC HIT TARGET
                  COVERAGE=100%
                  COVERAGE ACTIVE TARGETS=4
                  MAGNIFICATION=0.638
                  HIT TARGET COLOR=YELLOW (HMI),NOMINAL COLOR=GREEN (HMI)
                  HIT TARGET=EA1,0,1,HIGH,0.768
                  FILTER=NO,YES,0,1.8
                  EDGE=DOMINANT EDGE,[|]->[ ],-->,YES,-1,-1,-1,NO,Top Light=<OFF,0,OFF>,Bottom Light=<OFF,LIGHT,ON>,Ring Light=<OFF,0,OFF>
                  FOCUS=NO
    


    At the Optiv it reads:
    CIR3       =FEAT/VISION/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                THEO/<-3.2,-6,0>,<0,0,1>,4.12,0,0
                ACTL/<-3.2,-6,0>,<-0.0412971,-0.024986,0.9988344>,4.118,0,0
                TARG/<-3.2,-6,0>,<0,0,1>
                ANGLE VEC=<1,0,0>
                SHOW FEATURE PARAMETERS=NO
                SHOW_VISION_PARAMETERS=YES
                  TYPE=AUTOMATIC HIT TARGET
                  COVERAGE=100%
                  COVERAGE ACTIVE TARGETS=4
                  MAGNIFICATION=0.638
                  HIT TARGET COLOR=YELLOW (HMI),NOMINAL COLOR=GREEN (HMI)
                  HIT TARGET=EA1,0,1,HIGH,0.768
                  FILTER=NO,YES,0,1.8
                  EDGE=DOMINANT EDGE,[|]->[ ],-->,YES,-1,-1,-1,NO,Bottom Light=<OFF,0,OFF>,Top Light=<OFF,LIGHT,ON>,Ring Light=<OFF,0,OFF>
                  FOCUS=NO
    


    Note the top and bottom light have switched positions.

    #3) I have not applied this practice here yet, so I'll get to it. I was trying to prevent changing the 'core' code until I tried all else to understand it. I think it's probably time to save a backup-backup and get to it.


    Thanks again for your response!

Reply
  • vpt.se - Thanks for your response! Was unfamiliar with how to post here. Thank you!

    I'll paste the code in a few responses.

    #1.) Sorry, I didn't mention that that is what I am trying to show in the example for number one, is the unsuccessful debugging. I've put a comment to trace the value and can tell it's dropping out or at least not being used. It should be returning a value of .4


    #2. )At my desk top the code for any feature will read:
    CIR3       =FEAT/VISION/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                THEO/<-3.2,-6,0>,<0,0,1>,4.12,0,0
                ACTL/<-3.2,-6,0>,<-0.0412971,-0.024986,0.9988344>,4.118,0,0
                TARG/<-3.2,-6,0>,<0,0,1>
                ANGLE VEC=<1,0,0>
                SHOW FEATURE PARAMETERS=NO
                SHOW_VISION_PARAMETERS=YES
                  TYPE=AUTOMATIC HIT TARGET
                  COVERAGE=100%
                  COVERAGE ACTIVE TARGETS=4
                  MAGNIFICATION=0.638
                  HIT TARGET COLOR=YELLOW (HMI),NOMINAL COLOR=GREEN (HMI)
                  HIT TARGET=EA1,0,1,HIGH,0.768
                  FILTER=NO,YES,0,1.8
                  EDGE=DOMINANT EDGE,[|]->[ ],-->,YES,-1,-1,-1,NO,Top Light=<OFF,0,OFF>,Bottom Light=<OFF,LIGHT,ON>,Ring Light=<OFF,0,OFF>
                  FOCUS=NO
    


    At the Optiv it reads:
    CIR3       =FEAT/VISION/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                THEO/<-3.2,-6,0>,<0,0,1>,4.12,0,0
                ACTL/<-3.2,-6,0>,<-0.0412971,-0.024986,0.9988344>,4.118,0,0
                TARG/<-3.2,-6,0>,<0,0,1>
                ANGLE VEC=<1,0,0>
                SHOW FEATURE PARAMETERS=NO
                SHOW_VISION_PARAMETERS=YES
                  TYPE=AUTOMATIC HIT TARGET
                  COVERAGE=100%
                  COVERAGE ACTIVE TARGETS=4
                  MAGNIFICATION=0.638
                  HIT TARGET COLOR=YELLOW (HMI),NOMINAL COLOR=GREEN (HMI)
                  HIT TARGET=EA1,0,1,HIGH,0.768
                  FILTER=NO,YES,0,1.8
                  EDGE=DOMINANT EDGE,[|]->[ ],-->,YES,-1,-1,-1,NO,Bottom Light=<OFF,0,OFF>,Top Light=<OFF,LIGHT,ON>,Ring Light=<OFF,0,OFF>
                  FOCUS=NO
    


    Note the top and bottom light have switched positions.

    #3) I have not applied this practice here yet, so I'll get to it. I was trying to prevent changing the 'core' code until I tried all else to understand it. I think it's probably time to save a backup-backup and get to it.


    Thanks again for your response!

Children
No Data