[Mi...] Posted Thursday at 01:35 PM Share Posted Thursday at 01:35 PM I took out the actual Part Numbers to avoid leaking any sensitive data. The PCM File runs fine except for the loadCADFile() function. when trying to compute it on its own it returns 0 shown in the attached picture. Any help would be greatly appreciated. Mike // IGVAPCM.txt //variable named 'paramFile' is equal to the actual .para file name // Then 'fileExists' checks if the .para file is in the program's directory then reads(readPCMFile()) it if its there. paramFile = "PARAMETER.para" if fileExists(paramFile) readPCMFile(paramFile) else // If file isnt there, this writes the file to the programs directory addToFile("PARAMETER.para","RH = getRecordHead("u_field1")") // part number header addToFile("PARAMETER.para","ORH = getRecordHead("planid")") // plan/program id header addToFile("PARAMETER.para","DWGREV = getRecordHead("u_field2")") // drawing revision header addToFile("PARAMETER.para","MNAME = getRecordHead("operid")") // machine/operator name addToFile("PARAMETER.para","MAT = getRecordHead("u_field4")") // takes into account the material being used endif // Main selection / confirmation loop starts here. // The repeat...until loop will keep asking until exitLoop becomes true. repeat PART = inquireList("Select the correct Program Number","ZA3657","ZA3658") validSelection = false // reset the flag for this loop iteration fileExists("ZA3657CAD.sat") fileExists("ZA3658CAD.sat") clearCAD() setCoordSysVisible(true) // --- PART-specific cases --- if PART == "ZA3657" loadCADFile("ZA3657CAD.sat") setRecordHead("planid", "ZA3657_PARTNO_002_OP40") setRecordHead("u_field9", "ZA3657_PARTNO_002_OP40") setRunID("ZA3657") // runs the named mini-plan validSelection = true endif if PART == "ZA3658" loadCADFile("ZA3658CAD.sat") setRecordHead("planid", "ZA3658_PARTNO_002_OP40") setRecordHead("u_field9", "ZA3658_PARTNO_002_OP40") setRunID("ZA3658") // runs the named mini-plan validSelection = true endif wait(10) redrawCAD() setFit() // If no valid PART matched (user canceled or selected an unexpected value), show a message if validSelection == false message("No valid selection. Please select a part or check automation headers.") endInspection() else // Refresh header variables so the next steps use what we just set RH = getRecordHead("u_field1") // part number we set above ORH = getRecordHead("planid") // program/plan id we set above DWGREV = getRecordHead("u_field2") // drawing / revision read back MAT = getRecordHead("u_field4") // FIX: ensure the header key is a string // Ask the operator to confirm the displayed metadata before starting exitLoop = confirm("ARE THESE VALUES CORRECT?", cr(),"PART NUMBER: ", RH, cr(),"PROGRAM NUMBER: ", ORH, cr(),"REVISION: ", DWGREV) // confirm returns true if operator clicks Yes/OK endif until exitLoop == true Link to comment Share on other sites More sharing options...
[Je...] Posted Friday at 04:54 AM Share Posted Friday at 04:54 AM try runPCMFile(paramFile) instead of readPCMFile(paramFile) 1 Link to comment Share on other sites More sharing options...
[Er...] Posted Friday at 05:19 AM Share Posted Friday at 05:19 AM There is no path to the file. 1 Link to comment Share on other sites More sharing options...
[Mi...] Posted Friday at 01:17 PM Author Share Posted Friday at 01:17 PM I'll try that Please sign in to view this username. and see if it works. Link to comment Share on other sites More sharing options...
[Mi...] Posted Friday at 01:19 PM Author Share Posted Friday at 01:19 PM Please sign in to view this quote. the fileExists() comes back as true. i have also tried using actualInspectionsDir() and still no luck Link to comment Share on other sites More sharing options...
[Mi...] Posted Friday at 02:16 PM Author Share Posted Friday at 02:16 PM Please sign in to view this quote. No change occured when using runPCMFile() Link to comment Share on other sites More sharing options...
[Mi...] Posted 18 hours ago Share Posted 18 hours ago As Eric mentioned add the complete path to the cad file. Whereas fileExists accepts relative paths loadCADFile (like most pcm commands) doesn't. Btw actualInspectionsDir() is no valid command, use getActualInspectionDir() or directoryPath("actualinspection"). 2 Link to comment Share on other sites More sharing options...
[Pi...] Posted 9 hours ago Share Posted 9 hours ago I agree with Eric - you should have full path to the CAD file. I used this command when I made huge multi-size-type-operation Inspection plan. 3 part families, 10 sizes in each, 3 OPs per family part. 90 programs in 1. Barcode scanner was used to get data for headers and conditions. I was reloading CAD files and different curve scans - all worked fine but I had full path to the files. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in