Kv -300 – KEYENCE Visual KV Series User Manual

Page 325

Advertising
background image

7.7 Non-procedure Mode Programming

KV-300 Series Only

KV

-300

KV-10/80

Chapter 7 KV-L2 Serial Interface Module

1-301

1

7

2804 2805

#09200

DW

DW

#00000 2314

DM9600 DM9601

2315

Turn ON to execute conversion (for one scan time).

DM9602

Write the first address of the data memory to which the converted ASCII
strings are to be stored.

DM9603

Write the first address of the data memory into which a binary value to be
converted is loaded.

Binary
A binary value is input to 16 high-order bits and 16 low-order bits in data memory
addresses separately. Binary data that can be converted ranges from -2147483647
to 2147483647 in decimal.
A space (20H) in ASCII is converted to 0 in binary.
Negative numeric values are represented as a 2’s complement.

Decimal position
The value of the decimal point represents the position of the data memory address
in which decimal point 2EH is stored, counting from the top of the ASCII string. For
example, if "38.5" is written to data memory as "33H 38H 2EH 35H" in ASCII, the
decimal point is in the third data memory position and "3" is set.

ASCII to binary conversion program
The following example shows a program that converts text data loaded at reception
of text data to binary form. The converted value is written to data memory addresses
starting from DM0000.

Binary to ASCII conversion

To convert a binary value to an ASCII string, use data memory addresses DM9602
and DM9603 and special utility relay 2315 as follows.

Special utility relay 2315
Special utility relay 2315 converts binary data during the scan when turning ON and
transfers the converted data to data memory for the next scan.
For reception of a converted value, simplify the program by describing a loading
program prior to a conversion program through N.O. contact of 2315.

➮ Refer to page 1-303.

Data memory address DM9602
The DM address into which the converted ASCII data is written is specified in
DM9602. For example, when the text data to be transferred is specified, the first DM
address +101 designated when data memory addresses are assigned (

➮ Refer to

page 1-296) is written here.

Data memory address DM9603
Write the first address of the data memory to which the binary data to be converted
is to be loaded. Binary data to be converted uses five DM addresses, including the
first DM address described above. Avoid using DM addresses already used by the
program.

KVHKA Chap 07_5to10.p65

08.3.11, 11:18 AM

301

Advertising