Jump to content

PCM Command for Stylus Qualification – Is It Possible?


---
 Share

Recommended Posts

---

Also when you click LOOP there is an option for PARAMETER there, there should be where to insert PCM that gets run before or after the LOOP.

Glad to hear it worked for you.

Link to comment
Share on other sites

---

Please sign in to view this quote.

image.png.f07249b8eb8377f81ab1084ea1df5b89.pngimage.png.ccbafd87a05f0d708a82818dfd7e5642.png

Please sign in to view this username.

The loop runs, but I can't get different behavior for the first second loops.

I tried the logic shown in the image, but iit doesn't seem to wok properly.

Link to comment
Share on other sites

---
Posted (edited)

Wouldn't be condition to end loop with AND instead of OR? And there should be exit condition for no more than 3 passes - or it will run indefinitely.

And don't forget to first initialize variable "measureCount" as ZERO before "repeat"

Edited
init measureCount
Link to comment
Share on other sites

---
Posted (edited)

Please sign in to view this quote.

Hi,

Please sign in to view this username.

 thanks again for your help earlier.

I have one more question.

In my current setup, I defined a loop with 2 repetitions directly in the characteristic settings (using Calypso's built-in loop function).
At the same time, I declared a variable measureCount = 0 and increased it inside a PCM repeat block using measureCount = measureCount + 1.

What I'm not sure about is whether this variable (measureCount) actually reflects the number of measurement attempts within the characteristic loop.
For example, when measureCount == 1, does that really mean it's the first measurement attempt?

Also, I’ve noticed that different people use different variable names in examples — like A, LOOP, or measureCount.
Does Calypso internally recognize these as special loop counters, or is it entirely up to how we define and use them in PCM?

One more thing — I ran into a strange issue.
When the first measurement fails (i.e., one of the results is out of tolerance), I expect only NOK_1 to be triggered.
But instead, both NOK_1 and NOK_2 are being executed in the same loop cycle.
It seems like multiple goto statements are being activated even though only one failure should occur at that point.
I'm not sure if it's a PCM behavior or a mistake in my logic.

I'm still learning how PCM interacts with characteristic-based loops, so I’d really appreciate your insight.

Thanks in advance!

Edited
Link to comment
Share on other sites

---

So to your first question:

People are using different names for variables, because the name is irrelevant - just use name which describe it's value, or what's used for.

Potential problem can be with unclosed labels statements ( NOK_1, NOK_2 ) which can lead to displaying both messages.
Perhaps you can add "goto NEXT" after showing message.

I also have no experience in PCM and manual is not helpfull with basic syntaxes.

In posted code you can be sure that with value measureCount as 1 is indeed first loop.

Link to comment
Share on other sites

---

image.png.8239c007a561139fb3ea229cc2063d6b.png

image.png.533cb401250024de34e26e72a719c4bc.png

Please take a look at the attached photo. It seems like CASE2 is not being recognized—only CASE1 is working."

Link to comment
Share on other sites

---

Please sign in to view this username.

 You are posting incomplete codes.

You could have fullfiled break condition.

You can tryout pcm code just to be sure

measureCount = 0

repeat
measureCount = measureCount + 1
  selectCase measureCount
    case 1
      message("Clean")
    case 2
      message("Check")
  endSelect
until measureCount == 3

It should pop two messages if this works.

I don't see anywhere where is set inTolerance_M and outOfTolerance_M. If you need to have one check on all four conditions, then there should be a way to combine all into one.

Link to comment
Share on other sites

---

Please sign in to view this quote.

I followed your suggested method, but CASE1 kept repeating.
I also tried modifying it in various ways, but both CASE1 and CASE2 were displayed at the same time.
It seems that the loop count and the distinction between CASE1 and CASE2 are not being recognized properly.

 

Link to comment
Share on other sites

---

Please sign in to view this username.

 Well then someone with PCM license must step in and correct code - i'm out of Calypso for a week and i don't have PCM

Link to comment
Share on other sites

---
Posted (edited)

I'm confused as to what you are expecting to happen here. This is a simple repeat statement that in this case will start at (1), which should show "Clean", then will increment to (2), which should show "Check", then will increment to (3), which will end the repeat due to the until statement being until measureCount is equal to 3. 

2025-05-2816-59-33.thumb.gif.db106c2fe6a5c75fb2a5a053dd52882d.gif

Looking at your snippet up above I see no issues with it working, except for one thing. 

The command in case 2 for endInspection() will not work inside of a repeat command. cncBreak() will though. If you want endInspection() it will have to live outside of the repeat command. 

Oh, I also added the break condition for if the measurement count got to 3. This will save you from getting stuck in a loop. 

measureCount = 0

OutOfTolerance_M = true
inTolerance_M = true

repeat
measureCount = measureCount + 1
  selectCase measureCount
    case 1
		if OutOfTolerance_M then
			positionCMM(getPositionCMM().x,getPositionCMM().y,-150)
			positionCMM(50,getPositionCMM().y,-150)
      		message("Clean the master stylus")
		endif
    case 2
		if OutOfTolerance_M then
      		message("Check the stylus system")
			endInspection()
		endif
  endSelect
until (measureCount == 3) or (inTolerance_M == true)

2025-05-2817-10-53.thumb.gif.0289efee5f0308375830c0fd3d93d0b5.gif

Edited
Link to comment
Share on other sites

---

Please sign in to view this quote.

Thanks for your help. I'll keep trying.😀

Link to comment
Share on other sites

---

Please sign in to view this quote.

Hi,

Thanks for the clarification.

  1. What I wanted was to show a "Clean" message before the first measurement,

  2. And then show a "Check" message during the actual measurement process.

The current issue is that both messages appear at the same time:

  • On the first measurement, the "Clean" message is immediately followed by the "Check" message.

  • On the second measurement, the same thing happens — both messages appear together.

I’ll try again using the code you provided.
Thanks in advance for your help!
 

Link to comment
Share on other sites

 Share

×
×
  • Create New...