Restrictions; Commonly Asked Questions - Omron CX-PROGRAMMER V8.1 Operation Manual

Function blocks/ structured text
Table of Contents

Advertisement

Restrictions

5-7

Restrictions

5-7-1

Restrictions

5-7-2

Commonly Asked Questions

ENO:=true;
ELSE
ENO:=false;
RETURN;
END_IF;
Num_BCD:=INT_TO_BCD_WORD(Input_Num);
(*For example, if Num is 100 (16#0064), it is converted to BCD 0100*)
Output_String:=WORD_TO_STRING(Num_BCD);
(*Convert BCD 0100 to text string*)
■ Nesting
• There is no restriction on the number of nests that can be used in IF,
CASE, FOR, WHILE, or REPEAT statements.
■ Data Type Restrictions
• Integers can only be allocated to variables with data types WORD,
DWORD, INT, DINT, UINT, UDINT, or ULINT. For example, if A is an INT
data type, A:=1; it possible. If the value is not an integer data type, a syn-
tax error will occur. For example, if A is an INT data type, a syntax error
will occur for A:=2.5;.
• If a real number (floating point decimal data) can only be allocated to vari-
ables with data types REAL and UREAL. For example, if A is a REAL data
type, A:=1.5; is possible. If the value is not an real data type, a syntax
error will occur. For example, if A is a REAL data type, a syntax error will
occur for A:=2;. Use A:=2.0;.
• Bits (TRUE, FALSE) can only be allocated to variables with the BOOL
data type. For example, if A is a BOOL data type, A:=FALSE; is possible.
If a BOOL data type is not used, a syntax error will occur. For example, if
A is an INT data type, a syntax error will occur for A:=FALSE;.
• Data types must all be consistent within the structured text. For example,
if A, B, and C are INT data types, A:=B+C; is possible. If, however, A and
B are INT data types, but C is a REAL data type or LINT data type, a syn-
tax error will occur for A:=B+C;.
• In the structured text, the following cannot be used:
P_CY, P_EQ, P_ER, P_N, P_GE, P_GT, P_LE, P_LT, P_NE, P_OF, and
P_UF
Q: How is a hexadecimal value expressed?
A: Add "16#" before the value, e.g., 16#123F.
The prefixes 8# and 2# can also be added to express octal numbers and
binary numbers, respectively. Numbers without these prefixes will be inter-
preted as decimal numbers.
Q: How many times can FOR be used?
A: In the following example, the contents of the FOR statement is executed
101 times. The loop processing ends when the value of "i" is equal to 101.
Section 5-7
167

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CX-PROGRAMMER V8.1 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Sysmac ws02-cxpc1-v8Sysmac cx-programmer 8.1

Table of Contents

Save PDF