Jump to content

PCM Pre Settings skipping commands.


---
 Share

Recommended Posts

In my post settings, I have the following code.

Please sign in to view this quote.

This is supposed to execute the exe file.

It happens right after opening the program and running the first part or it just happens when ever.

This action is critical, the CMM could easily crash when this happens.

I am guessing it may be a load time out issue. How much time does systemCallWithWait allow?

This may also affect the writing of "runpart.para". On one run, where I selected a part number, the folder path created was the prior part number, which means the "runpart.para" file was not over written. (That code is not shown).

Link to comment
Share on other sites

PCM pre settings:

//Pre Settings:
optest=getRecordHead("u_OperatorName") //Use char Black List here
if len(optest)<2
            repeat
                        optest=inquireText("Please enter your Stamp ID. Example: M000.")
                        setRecordHead("u_OperatorName",optest)
            until len(optest)>2
endif

idtest=getRecordHead("u_WorkOrderID") //Use char Black List here
if len(idtest)<2
            repeat
                        idtest=inquireText("Please enter a Work Order ID.")
                        setRecordHead("u_WorkOrderID",idtest)
            until len(idtest)>2
endif

idtest=getRecordHead("u_MachCenter") //Use char Black List here
if len(idtest)<2
            repeat
                        idtest=inquireText("Please enter a Machining Center.")
                        setRecordHead("u_MachCenter",idtest)
            until len(idtest)>2
endif

coordoveride=="Rough Bore Machine"
newy=0
newz=0
Mac_X="" 
Mac_Y="" 

measure("Load Alignment")
miniselection=getRunID()
flag=0
PN=""

cd=(getActualInspectionDir())
systemCallWithWait(cd+"\"+"Parameters_2025.exe")
cd=(getActualInspectionDir())
readPCMFile(cd+"\"+"runpart.para")

if PN==0
cncBreak()
endif

//Stop CMM if operator canceled
//Read Canc-Cont.txt value
my_list=readListFile("Canc-Cont.txt")
//Extract value from file
CanCon=val(getParameterNamed(my_list,2))
if CanCon==1
cncBreak()
endif
//End.

//01.22.24 - Setup Last User information
OpName=getRecordHead("u_OperatorName")
OpWoID=getRecordHead("u_WorkOrderID")
OpPartNumb=getRecordHead("u_PartNumb")
OpSerNumb=getRecordHead("u_SerNumb")
OpFam=getRecordHead("planid") //Program ID
Opminiselection=miniselection //Mini Plan Name
OpLastMachCtr=getRecordHead("u_MachCenter")
inspPath2 = "C:\Users\Public\Documents\Zeiss\CALYPSO\workarea\inspections\Zeiss 1 Block\Eaton Aerospace\PCM Program\"
//end

//new 10.15.25
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID2.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, OpPartNumb, ())
addToFile(inspPath+fileName, getRecordHead("dmesn") )
addToFile(inspPath+fileName, OpWoID, ())
fileName = "setRunID3.txt"
inspPath = getActualInspectionDir()+"\"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRecordHead("dmesn") )
//End New

if kidney_length_format=="angle"
kidney_length_arc = 2*pi*(kidney_bolt_circ_dia/2)*(kidney_angle_arc/360)
endif

if kidney_length_format=="decimal"
kidney_length_arc = kidney_angle_length
kidney_angle_arc = 360*kidney_length_arc/(kidney_bolt_circ_dia*pi)
endif

kidney_operator=2*sin(kidney_angle_arc/2)*(kidney_bolt_circ_dia/2)

zoff = ((dia_OD/2)/cos(30))/2

if kidney_bolt_circ_dia>=2
spd=0.2
scanoffset=0.085
kidmeasslot=0.1
endif

if (kidney_bolt_circ_dia>=1) and (kidney_bolt_circ_dia<2) 
spd=0.15
scanoffset=0.075
kidmeasslot=0.06
endif

if kidney_bolt_circ_dia<1 
spd=0.1
scanoffset=0.065
kidmeasslot=0.05
endif

if true_cyl==1
cyl_tol=cyl_tol/2
endif

if kidney_width<=0.150
kid_spd=0.0387401
endif

if kidney_width<=0.300
kid_spd=0.0787401
endif

if (kidney_width>=0.300) and (kidney_width<1)
kid_spd=0.1181102
endif

if miniselection=="Finished Bore Characteristics"
bore_dia=bore_dia_hone
bore_dia_tol=bore_dia_tol_hone
perp_tol=perp_tol_hone
cyl_tol=cyl_tol_hone
endif

if (num_bores==3) and (miniselection=="Finished Bore Characteristics")
setRunID("3 Finished Bore Characteristics")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
endif

if (num_bores==3) and (miniselection=="Rough Bore Characteristics") 
setRunID("3 Rough Bore Characteristics")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
endif

if (num_bores==3) and (miniselection=="Kidney Characteristics")
setRunID("3 Kidney Characteristics")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
endif

if (num_bores==7) and (miniselection=="Finished Bore Characteristics")
setRunID("7 Finished Bore Characteristics")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
endif

if (num_bores==7) and (miniselection=="Rough Bore Characteristics") 
setRunID("7 Rough Bore Characteristics")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
endif

if (num_bores==7) and (miniselection=="Kidney Characteristics")
setRunID("7 Kidney Characteristics")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
endif

if (num_bores==9) and (miniselection=="Finished Bore Characteristics")
setRunID("9 Finished Bore Characteristics")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
endif
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if (uc_inspect==1) then
		goto UCchk
	else
		goto NoUCchk
	endif
if (uc_inspect==1) and (hob==1) 
then
		goto UCchk1
	else
		goto NoUCchk1
	endif

NoUCchk:
if (num_bores==7) and (miniselection=="Rough Bore Characteristics")
setRunID("7 Rough Bore Characteristics")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
endif
if (num_bores==9) and (miniselection=="Rough Bore Characteristics")
setRunID("9 Rough Bore Characteristics")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
endif
if (num_bores==11) and (miniselection=="Rough Bore Characteristics")
setRunID("11 Rough Bore Characteristics")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
endif
if (num_bores==13) and (miniselection=="Rough Bore Characteristics")
setRunID("13 Rough Bore Characteristics")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
endif
goto Measure
endif
UCchk:
	if (mmc_req==1) then
		setRunID("9 Rough Bore Under_Cut_MMC Characteristics")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
goto Measure
		else
		setRunID("9 Rough Bore Under_Cut Characteristics")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
goto Measure
	endif
UCchk1:
	if (mmc_req==1) then
		setRunID("9 Rough Bore Under_Cut_MMC HOB Characteristics")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
goto Measure
		else
		setRunID("9 Rough Bore Under_Cut HOB Characteristics")	
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
goto Measure
	endif
Measure:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (num_bores==9) and (miniselection=="Kidney Characteristics")
setRunID("9 Kidney Characteristics")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
endif

if (num_bores==11) and (miniselection=="Finished Bore Characteristics")
setRunID("11 Finished Bore Characteristics")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
endif

if (num_bores==11) and (miniselection=="Rough Bore Characteristics") 
setRunID("11 Rough Bore Characteristics")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
endif

if (num_bores==11) and (miniselection=="Kidney Characteristics")
setRunID("11 Kidney Characteristics")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
endif

if (num_bores==13) and (miniselection=="Finished Bore Characteristics")
setRunID("13 Finished Bore Characteristics")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
endif

if (num_bores==13) and (miniselection=="Rough Bore Characteristics") 
setRunID("13 Rough Bore Characteristics")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
endif

if (num_bores==13) and (miniselection=="Kidney Characteristics")
setRunID("13 Kidney Characteristics")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
//End New
endif

 //Start new Ring section   01.19.24
if (ring_count==24) and (miniselection=="Rings")
setRunID("24 Ring Dimensions")
//New 12.12.23
inspPath = getActualInspectionDir()+"\"
fileName = "setRunID.txt"
deleteFile(inspPath+fileName)
addToFile(inspPath+fileName, getRunID())
endif
//End New

if (miniselection=="Rings")
Machine="Ring Dimensions"
endif 
//end ring section

if (miniselection=="Rough Bore Characteristics")
Machine="Rough Bore Machine"
endif

if (miniselection=="Finished Bore Characteristics")
Machine="Hone Bore Machine"
endif

if (miniselection=="Kidney Characteristics")
Machine="Kidney Machine"
endif

if (miniselection=="Steel Bore Characteristics")
Machine="Steel Bore Machine" 
endif

if (confirm("The machine for this part is ", Machine,".", " Is this correct?")) 
coordoveride=Machine
else
coordoveride=inquireList("Choose correct machine.", "Rough Bore Machine", "Hone Bore Machine", "Kidney Machine", "Steel Bore Machine", "Ring Dimensions")
endif

//offset_x = + ((kidney_length_arc/2) - (kidney_width/2) - getNominal("LCL1_CIR_LEFT_1").y)
//offset_y = getNominal("BASE_RSLT_KIDNEY",1).z + getNominal("LCL1_CIR_LEFT_1").z

//redrawCAD()

setRecordHead("u_PartNumb",PN)
setRecordHead("u_Machine",coordoveride)

 

Link to comment
Share on other sites

Additional information.

This code was added to the vb.net solution to prevent errors when published. For some reason, when I publish the executable app, it wants to run the app right after install.

Module Startup
    Sub Main()
        If ApplicationDeployment.IsNetworkDeployed Then
            If ApplicationDeployment.CurrentDeployment.IsFirstRun Then
                ' Optionally log or show a message
                Exit Sub
            End If
        End If

        Application.Run(New Form1())
    End Sub
End Module

The activity in my initial post was not present prior to adding this preventive measure.

Link to comment
Share on other sites

This needed to be set prior to executing this file: Parameters_2025.exe

setRecordHead("u_PartNumb",PN))

Otherwise, my part number was always wrong, it would be the prior part instead of the current part.

Link to comment
Share on other sites

 Share

×
×
  • Create New...