I know in v3.6 and higher you can insert a COMMENT/READOUT which inserts the comment text into the Probe Readout window during execution. So you could do something like this:
Thanks for the response, Jared. v3.2063 has no "COMMENT/READOUT" option.
I wondered if VB might be the way to go with this, but as far as VB is concerned, I'm Sgt Schultz.
v2013 MR1, v2015.1
B&S Global 544, 555
Mitutoyo A504 w/PC-DMIS
sigpic Since 1994
Never force anything. Get a bigger hammer.
(Advice from my dad.)
Thanks for the response, Jared. v3.2063 has no "COMMENT/READOUT" option.
I wondered if VB might be the way to go with this, but as far as VB is concerned, I'm Sgt Schultz.
Here's an example of a BASIC program and some PC-DMIS code within v3.2 that displays a loop number and message on the statusbar. Granted, it's not as visible as sending a comment to the readout window, but you might find it useful. This example works for me in v3.207b.
Step 1. Write the script.
Open up the BASIC Script Editor that comes with PC-DMIS, and type or copy and paste this code in. Save it as UPDATESTATUSBAR.BAS:
Sub Main (strText As String)
Dim App As Object
Set App = CreateObject ("PCDLRN.Application")
App.StatusBar = strText
End Sub
When executed, this script expects a passed in text string. It assigns the text message to the variable strText and then displays strText in the Statusbar.
Step 2. Pass the variable to display from the part program.
Inside your loop command, insert a Basic Script command that calls the above script and passes in the string to display as a parameter. Your part program code should look something like this:
ASSIGN/V7 = 1 V1 =LOOP/START, ID = YES, NUMBER = 15, START = 1, SKIP = , OFFSET: XAXIS = 0, YAXIS = 0, ZAXIS = 0, ANGLE = 0 ASSIGN/V2 = "The program is executing loop number " + V7 CS1 =SCRIPT/FILENAME= D:\MYAUTOMATIONSCRIPTS\UPDATESTATUSBAR.BAS FUNCTION/Main,V2,, STARTSCRIPT/ ENDSCRIPT/ COMMENT/OPER,V7 ASSIGN/V7 = V7 + 1 LOOP/END
In the above code, PC-DMIS loops 15 times and increments variable V7 each time. This loop count becomes part of variable V2 which says "The program is executing loop number X" where X is the current value of V7. V2 then gets passed into the UPDATESTATUSBAR.BAS script.
Note that the COMMENT/OPER,V7 command is for testing purposes only to slow down the script so you can visually see what's being displayed on the status bar in this test program. In actual use in a real part program, you can remove it.
I was working on a capability study program when ya'll started this thread so I tried it and it worked. Below is the routine I'm using:
ASSIGN/V7 = 1
C1 =COMMENT/INPUT,How many parts are you running?
V1 =LOOP/START, ID = YES, NUMBER = C1.INPUT, START = 1, SKIP = ,
OFFSET: XAXIS = 0, YAXIS = 0, ZAXIS = 0, ANGLE = 0
ASSIGN/V2 = "The program is executing loop number" + V1
CS1 =SCRIPT/FILENAME= C:\PCDMISW_MR3\PART PROGRAMS\UPDATESTATUSBAR.BAS
FUNCTION/Main,V2,,
STARTSCRIPT/
ENDSCRIPT/
ASSIGN/V7 = V7 + 1
L1 =LABEL/
C2 =COMMENT/YESNO,Have you changed parts?
IF/C2.INPUT=="YES"
GOTO/L2
END_IF/
IF/C2.INPUT=="NO"
GOTO/L1
END_IF/
L2 =LABEL/
The only thing I could not figure out was getting the ENDSCRIPT/ command in. After I ran the program once the ENDSCRIPT/ command appeared in the program. Jared, ignore the PM unless you can tell me how to insert it into the program.
...The only thing I could not figure out was getting the ENDSCRIPT/ command in. After I ran the program once the ENDSCRIPT/ command appeared in the program.....
Hi Perry,
Correct. The ENDSCRIPT/ command only appears after execution. I'm not sure why it does that. I'll have to ask the programmers about that and see if that's intentional.
Anyway, one other thing I figured out after looking at this more closely is that we don't need a separate variable to count the iterations in the loop. The LOOP/START command itself has it's own variable and puts the current iteration into that variable. So my example part program code above could be rewritten like this:
V1 =LOOP/START, ID = YES, NUMBER = 15, START = 1, SKIP = , OFFSET: XAXIS = 0, YAXIS = 0, ZAXIS = 0, ANGLE = 0 ASSIGN/V2 = "The program is executing loop number " + V1 CS1 =SCRIPT/FILENAME= D:\MYAUTOMATIONSCRIPTS\UPDATESTATUSBAR.BAS FUNCTION/Main,V2,, STARTSCRIPT/ ENDSCRIPT/ COMMENT/OPER,V1 LOOP/END
I just finished running a CAP study using this script. I'm never able to stay with the CMM from start to finish running CAPs. The way I have the program set up (dumb luck on my part) when the CMM is paused waiting for me to verify changing parts the status bar is telling me which part is next so I'm not trying to decide if I have run the current part yet.
I'm trying to optimize path of a routine that measures anywhere from 1 to 4 parts set on a fixture (variable QTY.INPUT). Fixture positions are spaced...
So I have 16 parts I need to measure in a 4 rows of 4 pattern. It's a simple 5 hole bolt pattern concentric to the I.D. Plane on the flange and level...
I was asked a question but one of our new inspectors when we were discussing looping. Say you have five parts you want to setup and measures all five....
Comment