Navigation:  Equipments (Devices) > PLC200 > Program > Conversion > STRING >

DWORD_TO_STRING

Conversão de Double Word para String

Previous pageReturn to chapter overviewNext page

Block that performs the conversion of a DWORD value into a STRING value.

 

Ladder Representation

 

DWORD_TO_STRING_block

 

Block Structure

 

Variable Type

Name

Data Type

Description

VAR_INPUT

EN

BOOL

Block enabling

IN

DWORD UDINT DINT

Value in DWORD

VAR_OUTPUT

DONE

BOOL

End of operation

OUT

STRING

Value in STRING

 

Operation

 

When this block has a TRUE value in EN, it interprets the IN value as DWORD and converts it into STRING, storing in Result.

 

wpshelp_common_fig_note

NOTE!

If the number represented has more digits than the capacity of the STRING, the value will be truncated.

 

When EN has FALSE value, OUT remains unchanged and DONE remains FALSE.

 

Compatibility

 

Device

Version

PLC300

2.10 or higher

 

Block Flowchart

 

DWORD_TO_STRING_flowchart

 

Example in Ladder

 

The following examples show various conversions of DWORD type values into STRING. All conversions enable the DONE output to the end of the operation.

 

DWORD_TO_STRING_example01

 

The conversion above was successfully completed.

 

DWORD_TO_STRING_example02

 

The conversion above was successfully completed.

 

DWORD_TO_STRING_example03

 

The above conversion was successful, but the size of the result of the conversion is greater than the OUT size, and this has been truncated.

 

DWORD_TO_STRING_example04

 

The above conversion was successful, but the size of the result of the conversion is greater than the OUT size, and this has been truncated.

 

Example in ST

 

 The example below displays the instructions for applying the example above in the ST language.

 

 

VAR

   IN : DINT := -123456789;

   OUT : STRING;

END_VAR

 

OUT := FB_DWORD_TO_STRING(

   EN:=DI1,

   IN:=IN,

  DONE=>DO1);