5 Script Coding Examples
20-50
WindO/I-NV4 User’s Manual
Script
Operation description
Converts the stored string starting at LDR200 to a decimal and stores the result in LDR100.
The number of digits that can be converted is the maximum number of digits for each data type with added sign.
If the string to convert contains NULL or characters that cannot be converted to numeric values, the string is
converted up to that character.
Setting the string “1234” (when the data type is UBIN16(W))
Setting the string “1234567” (when the data type is UBIN16(W))
Setting the string “-12345” (when the data type is BIN16(I))
String “1234567890” (when the data type is UBIN32(D))
■
Example 5.7.21
Convert string to decimal
[LDR 100] = ASCII2DEC([LDR 200]);
• This function can only be configured when
UBIN16(W)
,
BIN16(I)
,
UBIN32(D)
,
BIN32(L)
,
BCD4(B)
or
BCD8(EB)
is specified as the
Data Type
.
• You can only specify an internal device.
• When using functions that handle strings, check the
Storage Method of string data
setting on the
System
tab in the
Project Settings
dialog box. Depending on the setting, the upper and lower bytes
are stored in the reverse of the following explanation. For details, refer to Chapter 4 “3.1 System Tab” on
page 4-25.
Device address
Stored value
Upper byte
Lower byte
Device address Stored value
4
3
2
1
LDR100
2
3
x
0
=
'
2
'
1
3
x
0
=
'
1
'
LDR200
LDR201
'3' = 0x33
'4' = 0x34
LDR202 0x00
0x00
Terminating character
Terminating character
Device address
Stored value
Upper byte
Lower byte
Device address Stored value
5
4
3
2
1
LDR100
2
3
x
0
=
'
2
'
1
3
x
0
=
'
1
'
LDR200
LDR201
'3' = 0x33
'4' = 0x34
LDR202
'5' = 0x35
'6' = 0x36
LDR203
'7' = 0x37
0x00
Terminating character
Terminating character
Device address
Stored value
Upper byte
Lower byte
Device address Stored value
5
4
3
2
1
-
LDR100
1
3
x
0
=
'
1
'
D
2
x
0
=
'
-
'
LDR200
LDR201
'2' = 0x32
'3' = 0x33
LDR202
'4' = 0x34
'5' = 0x35
LDR203 0x00
0x00
Terminating character
Terminating character
Device address
Stored value
Upper byte
Lower byte
Device address Stored value
0
9
8
7
6
5
4
3
2
1
LDR100 - 101
2
3
x
0
=
'
2
'
1
3
x
0
=
'
1
'
LDR200
LDR201
'3' = 0x33
'4' = 0x34
LDR202
'5' = 0x35
'6' = 0x36
LDR203
'7' = 0x37
'8' = 0x38
LDR204
'9' = 0x39
'0' = 0x30
LDR205 0x00
0x00
Terminating character
Terminating character
Содержание WindO/I-NV4
Страница 1: ...B 1701 16 User s Manual...
Страница 50: ...1 WindO I NV4 Specifications 2 18 WindO I NV4 User s Manual Baltic ANSI 1257 Cyrillic ANSI 1251...
Страница 108: ...5 WindO I NV4 Common Operations and Settings 2 76 WindO I NV4 User s Manual...
Страница 256: ...7 BACnet Communication 3 148 WindO I NV4 User s Manual...
Страница 372: ...6 Screen Restrictions 5 32 WindO I NV4 User s Manual...
Страница 390: ...5 Part Library Function 6 18 WindO I NV4 User s Manual...
Страница 420: ...3 Text 7 30 WindO I NV4 User s Manual...
Страница 522: ...5 Key Button 8 102 WindO I NV4 User s Manual Password Input These keys switch the user on the Password Input Screen...
Страница 628: ...2 Multi State Lamp 9 34 WindO I NV4 User s Manual...
Страница 924: ...4 Meter 11 76 WindO I NV4 User s Manual...
Страница 990: ...7 Timer 12 66 WindO I NV4 User s Manual...
Страница 1030: ...4 Using Data and Detected Alarms 13 40 WindO I NV4 User s Manual...
Страница 1098: ...4 Using the Data 15 22 WindO I NV4 User s Manual...
Страница 1248: ...5 Restrictions 22 18 WindO I NV4 User s Manual...
Страница 1370: ...2 Monitoring on the MICRO I 25 28 WindO I NV4 User s Manual...
Страница 1388: ...4 Restrictions 26 18 WindO I NV4 User s Manual...
Страница 1546: ...5 Module Configuration Dialog Box 30 36 WindO I NV4 User s Manual...
Страница 1614: ...3 Settings 34 14 WindO I NV4 User s Manual...
Страница 1694: ...5 HG1P 35 80 WindO I NV4 User s Manual 5 6 Dimensions Unit mm Cable Dimensions 191 169 56 70 6 51 55 7...
Страница 1726: ...5 Text Alignment A 10 WindO I NV4 User s Manual...