0% found this document useful (0 votes)
20 views

Cyrillic ASCII2Unicode ENG

This document describes a demo project that uses macros to convert ASCII characters entered via numeric input objects to Unicode for display. Macro_1 and Macro_11 convert the ASCII values from RW0-RW7 to Unicode and display the high and low bytes in LW0-LW15. The project includes screens for numeric input, function keys to trigger macros, an ASCII display object and numeric displays for the Unicode values. A character map is provided to reference ASCII values for supported Cyrillic characters.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Cyrillic ASCII2Unicode ENG

This document describes a demo project that uses macros to convert ASCII characters entered via numeric input objects to Unicode for display. Macro_1 and Macro_11 convert the ASCII values from RW0-RW7 to Unicode and display the high and low bytes in LW0-LW15. The project includes screens for numeric input, function keys to trigger macros, an ASCII display object and numeric displays for the Unicode values. A character map is provided to reference ASCII values for supported Cyrillic characters.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Demo Project for Cyrillic ASCII2Unicode

Demo Project for Cyrillic ASCII2Unicode

1 v1.00
Demo Project for Cyrillic ASCII2Unicode

Table of Contents
1. Overview and Operation
2. Setting Up the Screen
3. Addresses

2 v1.00
Demo Project for Cyrillic ASCII2Unicode

1. Overview and Operation

[Overview]
This demo project demonstrates how to use Macro to transform PLC ASCII
string to Unicode characters according to the Unicode included in
Character Map and display them on HMI.

[Operation]
Input ASCII using Numeric Input objects then press Macro_1 to display
Unicode using ASCII Display object. Macro_1 and Macro_11 display in
different order. Macro_1 displays high byte first, then low byte. Whereas
Macro_11 displays low byte first then high byte as shown in the 2 lines at
the bottom.

Input ASCII

Press Macro buttons to Display Unicode


transform to Unicode characters

3 v1.00
Demo Project for Cyrillic ASCII2Unicode

2. Setting up the screen

2-1 Setting objects on Window 10


 Add Numeric Input objects with RW addresses in 16-bit HEX format.

Set [Read Address] to “RW”.

For Numeric Input object, select [Numeric Format] tab. For [Data
format], select “16-bit Hex”.

4 v1.00
Demo Project for Cyrillic ASCII2Unicode

Create 8 Numeric Input objects with addresses “RW0~RW7”.

 Create 2 Function Key objects to execute Macro_1 and Macro_11.

Tick [Execute Macro], and then select the Macro to be executed from the
pull down list.

5 v1.00
Demo Project for Cyrillic ASCII2Unicode

 Create a Set Bit object for sound control.

Set the following functions for PLC Control object:


1. [Type of control]: Sound control
2. [Trigger address]: LB 0
3. Select the sound form [Sound Library]. When the project is started
this sound will be played.
4. [Trigger mode]: OFF->ON

6 v1.00
Demo Project for Cyrillic ASCII2Unicode

When LB 0 status changes form OFF to ON, the sound chosen will be
played. Add another Set Bit object, set [Write address] to “LB0” and
[Attribute] to “Set ON when window opens”.

 Create 1 ASCII Display object and 16 Numeric Display objects.

7 v1.00
Demo Project for Cyrillic ASCII2Unicode

For ASCII Display object, set [Read address] to “LW0”. Press [Setting…],
set [No. of word] to “16”.

Create 16 Numeric Display objects from addresses “LW0~LW15”. Under


[Numeric Format] tab select “16bit- Hex”.

8 v1.00
Demo Project for Cyrillic ASCII2Unicode

2-2 On Window 11, create Text object for inputting Cyrillic characters used
in the project. In this way this font can be downloaded and displayed
correctly on HMI

9 v1.00
Demo Project for Cyrillic ASCII2Unicode

2-3 Character Map on window 12


The ASCII map is shown below; users can check the ASCII number to be
filled in Numeric Input objects on window 10.
For example, refer to the value left side and upper side.

To display , write “0081” to Numeric Input object, and for , “00A8”.

10 v1.00
Demo Project for Cyrillic ASCII2Unicode

2-4 Macro_1
According to the Character Map that shows how Unicode corresponds to
ASCII code, write the code to Macro.
For example: UNICODE[128]=0x0402 is the transformation of
U+0402(0x80). As shown below, 0x80 is transformed into decimal, 128.

11 v1.00
Demo Project for Cyrillic ASCII2Unicode

In the end of macro, from line 135 to line 144 change the value received

12 v1.00
Demo Project for Cyrillic ASCII2Unicode

form RW0~RW7 to high byte and low byte of Unicode, then display on
LW0~LW15.

As for macro_11, low byte is displayed first and then high byte.

13 v1.00
Demo Project for Cyrillic ASCII2Unicode

3. Addresses
The Object Addresses used in this demo project are listed below: Users
can change Addresses and Object ID base on actual usage.
Addresses Object’s ID Detail
Operating objects Window 10
Word RW0 NE_0 Numeric input object
RW1 NE_1 Numeric input object
RW2 NE_2 Numeric input object
RW3 NE_3 Numeric input object
RW4 NE_4 Numeric input object
RW5 NE_5 Numeric input object
RW6 NE_6 Numeric input object
RW7 NE_7 Numeric input object
LW0 AD_1 ASCII Display with 16 words
LW0 ND_0 Numeric Display
LW1 ND_1 Numeric Display
LW2 ND_2 Numeric Display
LW3 ND_3 Numeric Display
LW4 ND_4 Numeric Display
LW5 ND_5 Numeric Display
LW6 ND_6 Numeric Display
LW7 ND_7 Numeric Display
LW8 ND_8 Numeric Display
LW9 ND_9 Numeric Display
LW10 ND_10 Numeric Display
LW11 ND_11 Numeric Display
LW12 ND_12 Numeric Display
LW13 ND_13 Numeric Display
LW14 ND_14 Numeric Display
LW15 ND_15 Numeric Display
Bit LB0 SB_0 Sound control
Others FK_0 Execute Macro_01
FK_1 Execute Macro_11
Cyrillic character Window 11
Others TX_0~TX_5 Cyrillic characters
Character Map Window 12
GP_0 Cyrillic ASCII Character Map

14 v1.00

You might also like