Long ago there was a posting about making a counter using a simple code rather than having to manually enter the number each time for the part sequence. We don't use datapage which would count for us, so I am left with this option, anyone know this code? To be used in a comment and printing to the report.
old subject, making a counter for part sequencing
Collapse
X
-
Tags: None
-
Loopidy loop loop
I'd use a loop. What do you want to do specifically? Perhaps a do while or do until, maybe one of those PCDMIS loops depends on your goal. How about details. We can handle it by the sounds of it.
Craig<internet bumper sticker goes here> -
What you could do is open a file, write a number to the first line. Close and save the file.
Next time you need to increment, open the file, read the first line into a variable and make it a number. Increment the number by 1 and overwrite the file. That way you always have a file where the first line is the latest increment number.
I have done all pieces, but never all. Try to implement and if you have trouble, post the code where it fails. I may be able to help to debug.
Jan.***************************
PC-DMIS/NC 2010MR3; 15 December 2010; running on 18 machine tools.
Romer Infinite; PC-DMIS 2010 MR3; 15 December 2010.Comment
-
If you are saving or printing your reports, which I'm sure you are since you are not using Datapage, you could simply insert a Keyin dimension at the very beginning of program. Make sure that this dimension is highlighted and each time you run the program and it asks for the key dimenion, simply key in what part you are on. It will be noted in every report as to which part the report goes to. I hope this is what you are looking for, and it is very simple to do.Comment
-
I want a automatic counter that was at one time explained in the other board long ago. It was VB code and very easy to write, I just cannot find it anywhere. I know I can use keyin dims, I wanted it to be automatic with a simple line of code like a variable, then displayed in a comment.Comment
-
Originally posted by Robert SquireI want a automatic counter that was at one time explained in the other board long ago. It was VB code and very easy to write, I just cannot find it anywhere. I know I can use keyin dims, I wanted it to be automatic with a simple line of code like a variable, then displayed in a comment.
Code:ASSIGN/LOOPINDEX = 1 WHILE/(condition here) . . (program code here) . ASSIGN/LOOPINDEX = LOOPINDEX + 1 END_WHILE/
The same thing can be used inside a PCDMIS loop like so:
Code:ASSIGN/LOOPINDEX = 1 THE_LOOP =LOOP/START, ID = YES, NUMBER = 6, START = 1, SKIP = , OFFSET: XAXIS = 0, YAXIS = 0, ZAXIS = 0, ANGLE = 0 . .(program code here) . ASSIGN/LOOPINDEX = LOOPINDEX + 1
Code:V1 =FILE/EXISTS,C:\PCDMISW\LoopCounter.txt IF/V1==0 ASSIGN/LOOPINDEX = 1 FPTR =FILE/OPEN, C:\PCDMISW\LoopCounter.txt,WRITE V1 =FILE/WRITELINE,FPTR, LOOPINDEX FILE/CLOSE,FPTR END_IF/ ELSE/ FPTR =FILE/OPEN, C:\PCDMISW\LoopCounter.txt,READ V1 =FILE/READLINE,FPTR,{LOOPINDEX} FILE/CLOSE,FPTR END_ELSE/ . .(part program code here) . ASSIGN/LOOPINDEX = LOOPINDEX + 1 FPTR =FILE/OPEN, C:\PCDMISW\LoopCounter.txt,WRITE V1 =FILE/WRITELINE,FPTR,LOOPINDEX FILE/CLOSE,FPTR
Craig<internet bumper sticker goes here>Comment
-
Related Topics
Collapse
-
by vajncHow can I set up automatic counter for measured parts into the header or any other place in the measurement report?
-
Channel: PC-DMIS for CMMs
11-26-2009, 06:26 AM -
-
by saldamico2Hello,
We have always played around with the idea of serializing our parts for trace-ability but never really acted on it. We currently...-
Channel: PC-DMIS for CMMs
07-12-2017, 02:32 PM -
-
by JIM HARRISIn your looping parameters there is a setting for skip number.Is there a way you can inter more than 1 number.I tried 3,33 but that does not work.Using...
-
Channel: PC-DMIS for CMMs
10-10-2007, 09:20 AM -
-
by cduveIn a program which is set up to measure multiple parts, how can I get the part count from PCDMIS? Is it a matter of getting the loop count or is there...
-
Channel: PC-DMIS Code Samples
03-14-2014, 06:36 PM -
-
by IDR_jtHi all.
We are trying to do a program to measure 4 parts with the same program. These parts are going to be fixed in a specific tooling...-
Channel: PC-DMIS for CMMs
09-17-2012, 03:21 PM -
Comment