Str2Num
■ Control appearance
■ Description
Convert the character string in the specified STAG to a numeric value.
■ Properties
The following table is a list of properties that can be used with this control.
Property name | Default value | Description |
---|---|---|
TargetValue= | TAG00 | Select the TAG in which to save the operation result. |
Conversion Proc | Ascii Str >> Number |
Select the operation to perform. The available operations are “Ascii Str >> Number”, “Ascii HexStr >> Number”, “Getlength”, “1byte binary >> Number”, “2byte binary >> Number”, “4byte binary >> Number”,“4byte IEEE754 >> Number”and “Get data size”. |
Str | STAG00 |
Specify the value on which to perform the operation. |
Offset | Fixed Value |
Specify the position in the character string to perform the operation. The offset can be specified either as a numeric constant (“Fixed Value”) or as a TAG value (TAGxx). |
Endian | Little endian |
Select the format for storing multi-byte numeric values. [little endian] : Store data in lower to higher-order byte sequence. e.g.) 0123h is stored with the first byte = 23h and the second byte = 01h [big endian] : Store data in higher to lower-order byte sequence. e.g.) 0123h is stored with the first byte = 01h and the second byte = 23h |
Next step | Down | Set the direction of the next block to be executed. If the processing goes to the outside of the frame, go back to the first block at (0, 0). If the target is an empty block, then the execution stops. |
■ Property details
Write a detailed description of the property.
□Conversion Proc
Specify the calculation processing method for strings.
[Ascii Str >> Number]:Convert the ASCII string in Str to a numeric value and set the result in Target.

Example) If Str = “123”, the result of the operation is Target = 123.
[Ascii HexStr >> Number]:Convert the hexadecimal ASCII string in Str to a numeric value and set the result in Target.

Example)If Str = “12ab”, the result of the operation is Target = 4779 (decimal).
[Getlength]:Assign the number of letters to the calculation result storage destination.

Example)If Str = “123, the result of the operation is Target = 3.
[1byte binary >> Number] :Convert a 1-byte binary from the specified position of the string to a numerical value, and assign it to the calculation result storage destination.

Example)If “abc” is stored in STAG00, the value in the calculation result storage destination is 97 (decimal).

[2byte binary >> Number]:Convert a 2-byte binary from the specified position of the string to a numerical value, and assign it to the calculation result storage destination.

Example)If "abc" is stored in STAG00, the position from the beginning is 1, and the byte order is little-endian, the value in the calculation result storage destination is 25,442.

[4byte binary >> Number]:Convert a 4-byte binary from the specified position of the string to a numerical value, and assign it to the calculation result storage destination.

Example) If "abc" is stored in STAG00, the position from the beginning is 0, and the byte order is little-endian, the value in the calculation result storage destination is 1,684,234,849.

[4byte IEEE754 >> Number]:Convert a 4-byte binary from the specified position of the string to a numerical value, and assign it to the calculation result storage destination.

Example)If 0x0000803F is stored in STAG00 and little-endian is selected in byte order, the value of the calculation result storage destination is 1.000000.

[Get data size]:Assign the STAG byte size specified in the string property to the calculation result storage destination.

Example) If Str contains [0x31,0x32,0x34,0x00,0x35,0x36], the result of operation is Target = 6.
