Numtoenum - Omron NY532-5400 Reference Manual

Ny-series
Hide thumbs Also See for NY532-5400:
Table of Contents

Advertisement

2 Instruction Descriptions

NumToEnum

The NumToEnum instruction converts DINT data to enumeration data.
Instruction
NumToEnum
Integer-to-
Enumeration
Variables
Name
Meaning
In
Data to
Input
convert
InOut
Conversion
In-out
result
Out
Return
Output
value
Bit strings
In
InOut
Out
OK
Function
The NumToEnum instruction converts the value of data to convert In, which is DINT data, to an enumer-
ation value and outputs that value to conversion result InOut.
Use this instruction, for example, to change the value of an enumerated variable from an HMI or other
display device that does not handle enumerated variables.
The following example shows how to convert the value of DINT variable In1 and output the results to
variable ColorA, which has an enumerated data type of Color. If green is the enumerator that corre-
sponds to an enumeration value of 1 for Color and the value of In1 is 1, the value of ColorA will be
green.
LD
In1
ColorA
2-314
Name
FB/FUN
FUN
I/O
Description
Data to convert
Conversion result
TRUE: Instruction was executed normally.
FALSE: Instruction was not executed or an
error occurred.
NumToEnum
EN
In
InOut
Graphic expression
(@)NumToEnum
EN
Out
In
InOut
Valid range
Depends on data
type.
---
Depends on data
type.
Integers
OK
Enumeration
ST
NumToEnum(In1,ColorA);
NY-series Instructions Reference Manual (W560)
ST expression
NumToEnum(In,InOut);
Unit
Default
---
0
---
---
---
---
Times, durations, dates,
and text strings

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents