Example program, Kv -300 – KEYENCE Visual KV Series User Manual

Page 293

Advertising
background image

7.5 KV Mode Programming

KV-300 Series Only

KV

-300

KV-10/80

Chapter 7 KV-L2 Serial Interface Module

1-269

1

7

Example program

Sample program

Text data received from an external device is converted to binary data and is
written in the DM0000 after conversion.

3. The ASCII-converted value is loaded to data memory addresses as follows.

The number of DM addresses used is the value specified as the number of bytes
in the ASCII string.

4. Program for converting binary data to ASCII

The following example shows a program that converts binary data to an ASCII
string during transmission of text data. The converted values are written to data
memory addresses starting from DM9301. The total number of digits, including
the decimal point, is written to DM9300.

0000

2315

1000

1000

2807

2315

#09301

#00000

DIFU

SET

(

)

< DW >

< DW >

DM9602

DM9603

DM****+0

First DM address of ASCII string (data 1 of text data)

:

:

DM****+98

Last DM address of ASCII string (data 99 of text data)

2008

2314

3000

1100

1100

2314

DIFU

3000

RES

(

)

#00000

< DW >

DM9600

#01500

< DW >

DM9601

#03000

< DW >

DM9700

#01000

< DW >

DM9701

DM1500

< LDA>

DM1200

< STA >

DM1501

< LDA >

DM2001

< STA >

DM1502

< LDA >

DM2002

< STA >

KVHKA Chap 07_5to10.p65

08.3.11, 11:18 AM

269

Advertising