cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Pro/PROGRAM - IF and AND help

TedOtto
3-Visitor

Pro/PROGRAM - IF and AND help

I've got an assembly with a program inside of it. There are two parameters, a shifting string and a pin string. The shifting string values are low or high, the pin string values are up or down. Currently I have a shift program written so a component's offset values is determined by the value of the shifting string. See below:

IF SHIFTING =="LOW"|SHIFTING =="low"
D5=33.5085
ENDIF


IF SHIFTING =="HIGH"|SHIFTING == "high"
D5=0
ENDIF

What I want to do is have that same component offset value be determined by both the shifting and pin values? Is there a way to add an "AND" statement so that if my shifting is "low" and my pin is "up" D5 would equal 33.5085 and if the shifting is "low" and the pin was "down" D5 would equal say 34.000?

There should be a way, I tried adding AND PIN =="UP" to the line, but that didn't work. What am I missing?

Thanks!
Ted


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
2 REPLIES 2

Try & instead of AND

Brian S. Lynn
Technical Coordinator, Product Engineering
TedOtto
3-Visitor
(To:TedOtto)

Thanks to all the responses....below is what I got to work...Thanks again!
Ted

IF (SHIFTING == "LOW" | SHIFTING == "low") & (PIN == "UP" | PIN == "up")
D5 = 33.5085
ENDIF

You could also use:
IF SHIFTING == "LOW" | SHIFTING == "low"
IF PIN == "UP" | PIN == "up"
D5 = 33.5085
ENDIF
IF PIN == "DOWN" | PIN == "down"
D5 = <value>
ENDIF
ENDIF

IF SHIFTING == "HIGH" | SHIFTING == "high"
IF PIN == "UP" | PIN == "up"
D5 = <value>
ENDIF
IF PIN == "DOWN" | PIN == "down"
D5 = 34.000
ENDIF
ENDIF

Top Tags