4.7.3 Operation / Mathematical functions woodWOP (9

Operation / Mathematical functions
woodWOP
Hilfe
woodWOP 5.x
0-000-00-0000
4.7.3
Conditions
Î This function makes it possible to make
the execution of processing dependent on
a condition
- Transfer to the NC program
Î If a condition is met, processing is
executed; if it is not met, processing is not
executed
Î Condition fields can be switched on and
off using the Processing - Conditions
menu bars
The program system offers the following
options:
• Conditions with variables
L > 800 Î Variable L must be greater
than
800 mm
B < 600 Î Variable B must be less than
600 mm
Example:
Processing should only be executed with a
workpiece length (variable L) greater than
1000 mm. Î Condition: L > 1000
8.6
2005-10-26
9-082-47-3931
enu11.doc
1/8
Operation / Mathematical functions
woodWOP
Hilfe
woodWOP 5.x
0-000-00-0000
4.7.3
• Conditions dependent on processing
position
_mirror
Î Processing is only
executed in the mirrored
part
_nonmirro Î Processing is only
r
executed in the normal
part
Example:
• A “right-hand” and a “left-hand”
(= mirrored) part should be processed
Î Generation of the normal and the
mirrored NC program
• One of the processes, however, should be
executed in the “left-hand” (= mirrored)
part
Condition:
_mirror Î The macro is only written in
the mirrored NC program
Condition:
Macro active or inactive
1 Î Processing is always executed.
0 Î Processing is never executed.
8.6
2005-10-26
9-082-47-3931
enu11.doc
2/8
Operation / Mathematical functions
woodWOP
Hilfe
woodWOP 5.x
0-000-00-0000
4.7.3
It is possible to link conditions to one
another.
Î There are two operators available
AND link
The macro is active if all linked conditions
are met.
OR link
The macro is active if at least one of the
linked conditions is met.
Example:
Condition
_nonmirror AND L > 750
Condition is met for a normal part if the
variable L is greater than 750.
The condition is never met for the mirrored
part.
Note:
¾ Separate the AND and OR operators from
the conditions that are to be linked using
empty spaces
Î Variable names, functions, and conditions
must be used with the correct
capitalization rules
8.6
2005-10-26
9-082-47-3931
enu11.doc
3/8
Operation / Mathematical functions
woodWOP
Hilfe
woodWOP 5.x
0-000-00-0000
4.7.3
Other options
Hiding macros
¾ Press the space bar in the macro list
Ö The current macro will be displayed or
hidden
Î Hidden macros (green check-mark) are
not transferred to into the NC program
during NC generation
Î Is possible to write macro programs
containing the processes from various
workpiece versions and then to hide the
macros that are not needed depending on
the version.
IF...THEN...ELSE
This function can be used to make the value
of a parameter dependent on a condition.
Example of use:
A contour process is to be executed with a
cutter that cuts to the right and with a cutter
that cuts to left in the mirrored part.
Tool:
IF _nonmirror THEN 150 ELSE 151
15
Tool number, cutter that cuts to the
0
right
15
Tool number, cutter that cuts to the
1
left
8.6
2005-10-26
9-082-47-3931
enu11.doc
4/8
Operation / Mathematical functions
woodWOP
Hilfe
woodWOP 5.x
0-000-00-0000
4.7.3
Mathematical functions
woodWOP checks to see whether the
expression entered is computable.
• If so, then this expression is calculated
under the application of common
algebraic rules.
- Parenthetical priority, period before
dash, etc.
Î If the expression entered is faulty, then a
corresponding error message is
generated
The following elements are allowed:
• Numbers: e.g.. 34, 546.45, 0.455, .78, 004
• Variables from the list of variables
• Predefined constants and variables: e.g.
_mirror, _nonmirror
• Functions: e.g. SIN(45), COS(60),
TAN(22.5), SQRT(2)
• Operators: +, -, *, /, ^
• Comparisons: =, <, >, < =, > =, < >, (= <, =
>, > <, AND, OR)
Î The result of a comparison is 0.0
Ö The condition is not met
Î The result of a comparison is 1.0
Ö The condition is met
• Conditions with IF... THEN... ELSE...
Note:
Variable names, functions, and conditional
expressions must be used with the correct
capitalization rules
8.6
2005-10-26
9-082-47-3931
enu11.doc
5/8
Operation / Mathematical functions
woodWOP
Hilfe
woodWOP 5.x
0-000-00-0000
4.7.3
The following predefined designations and
functions are recognized by woodWOP:
Name / Code
Definition
Type
_mirror
_nonmirror
_ymirror
_nonymirror
_BSX
_BSY
_BSZ
@
SIN()
COS()
TAN()
ARCSIN()
ARCCOS()
ARCTAN()
EXP()
LN()
SQRT()
MOD()
Mirroring activated = 1, Mirroring deactivated = 0
Mirroring activated = 0, Mirroring deactivated = 1
Mirroring activated in Y = 1, deactivated = 0
Mirroring activated in Y = 0, deactivated = 1
Workpiece: finished part length in X
Workpiece: finished part width in Y
Workpiece: finished part thickness in Z
Code for relative dimensioning
Sine, argument in degrees
Cosine, argument in degrees
Tangent, argument in degrees
Arc sine
Arccosine
Arc tangent
Exponential function
Natural logarithm
Square root
Modular function, digits after decimal point are
omitted
Digits before decimal point are omitted
Absolute value of the argument
If the condition is met, i.e. the IF value does not equal
0, the THEN value is assigned to the expression;
otherwise, the ELSE value is assigned.
Example:
IF L > 1200 THEN 5 ELSE 7
IF _nonmirror THEN 101 ELSE 102
Takes the corresponding value from the tool
database
Negates the expression
Returns 0 or 1
Variable
Variable
Variable
Variable
Variable
Variable
Variable
Code
Function
Function
Function
Function
Function
Function
Function
Function
Function
Function
PREC()
ABS()
IF THEN ELSE
STANDARD
NOT
8.6
2005-10-26
9-082-47-3931
enu11.doc
Function
Function
Function
Keyword
Function
6/8
Operation / Mathematical functions
woodWOP
Hilfe
woodWOP 5.x
0-000-00-0000
4.7.3
The following error messages are possible:
Error message
Explanation
Examples:
General syntax error in
expression
The expression does not
represent a permissible
mathematical expression
The expression contains more
closed parentheses than open
ones
An unknown word is used that is
not defined as a variable
100.1.1
1040 * * 4
More closed than open
parentheses in expression
Undefined variable in
expression
More open than closed
parentheses in expression
Division by zero in
expression
Invalid argument of
logarithm in expression
Negative argument of root
function in expression
Invalid argument of arc
function in expression
Several IFs in expression
No IF in expression
THEN or
ELSE is used in the expression
without IF.
Multiple THENs are listed
in the expression
Multiple ELSEs are listed in the
expression
Several THENs in
expression
Several ELSEs in
expression
8.6
The expression contains more
open parentheses than closed
ones
A value is to be divided by 0 in
the expression
The value of the argument from
which the logarithm is to be
calculated is less than or equal to
0
The value of the argument from
which the square root is to be
calculated
is less than 0
The value of the argument with
which an arc function is to be
executed is invalid. Arc sine or
arc cosine are applied to an
argument with a value greater
than 1 or less than -1
Multiple IFs are listed
in the expression
2005-10-26
9-082-47-3931
enu11.doc
SIN(100)) *2
(1+2)*(3+6))
An example of when only
variable B is defined
100+L
200+b
SIN((100)*2
(1+2)*((3+6)
100/COS(90)
(1+2)/(90-15*6)
LN(-120)
100+LN(SIN(180))
SQRT(-1)
200*SQRT(200-100)
ARCSIN(45)
ARCCOS(100-123)
IF A>200 THEN 20 ELSE IF
A>300 THEN 300 ELSE
400
IF B = 100 IF B = 200 THEN
100 ELSE 200
THEN 20 ELSE 300
100 ELSE 200
IF 10 THEN 20 ELSE 300
THEN 400
IF 10 THEN 20 ELSE 300
ELSE 400
7/8
Operation / Mathematical functions
woodWOP
Hilfe
8.6
woodWOP 5.x
0-000-00-0000
4.7.3
Error message
Explanation
Examples:
THEN after ELSE in
expression
IF THEN ELSE incomplete
in expression
Unknown function in
expression
THEN is not listed until after
ELSE in the expression
IF THEN ELSE is
incomplete in the expression
An unknown function
is used in the expression,
or the name of the function is
written incorrectly
(Note capitalization rules)
IF 10 ELSE 300 THEN 400
2005-10-26
9-082-47-3931
enu11.doc
IF 10 THEN 400
IF 20 ELSE 300
LOG(100)+300
sin (45)*30
8/8