Download as pdf or txt
Download as pdf or txt
You are on page 1of 406

96118E

Chapter 1 Before Use

Programming
Chapter 2 Technique
Data Collection/Transfer・Monitoring Software KV-DH1LE
Property Page
Chapter 3 Setting Method

KV COM+ Library Ver. 1 Chapter 4 Property Method


Event

User's Manual Chapter 5 DLL Function

࡮Device List
࡮ Error Message Lists
Please read this Manual before use.
Keep this Manual in a safe place for later reference.

Applicable CPU Unit


Preface

This manual describes function, operation procedures, precautions, etc. of KV COM+ Library. Be sure
to carefully read and fully understand this manual before use. In addition, keep this manual in an easy-
to-reach place so that you can use it from time to time.

 Related manuals
Read the following manuals when using KV COM+ Library.
Make contact with our branch offices at the back of this manual to request those manuals.

Manual Name Description


Describes the composition/ specification, CPU internal
KV-5500/5000/3000 series
function, ladder programming method of KV-5500/5000/3000
User's Manual
series.
KV-5500/5000/3000/1000 Series
Describes various instructions available in ladder program.
Instruction Reference Manual
KV-5500/5000/3000/1000 Series Describes the script programming method and available
Script Programming Manual operators, control statements and functions, etc.
KV STUDIO
Describes how to operate KV STUDIO.
User's Manual
KV-5500/5000/3000/1000 Series Describes the system macros available for the KV-5500/5000/
System Macro Manual 3000/1000 series.
KV-1000 Series
Guide manual for the import of KV-1000.
Introduction Manual
KV-1000 series Describes the specifications, integrated functions and
User's Manual operating method of the KV-1000 PLC.
KV-1000 series Describes how to make ladder programs using the KV-1000
Programming Manual PLC, modules/macros and local devices.
KV-700 series Describes the specifications, integrated functions and
User's Manual operating method of the KV-700 PLC.
KV-700 series
Describes the instructions used in KV-700.
Instruction Reference Manual
Safety Precautions

This manual gives information on and operation procedures of KV COM+ Library.


Be sure to carefully read this manual in order to take advantages of performance and function of KV
COM+ Library.
Keep this manual in an easy-to-reach place so that you can use it from time to time.
Distribute this manual to the end users.

 Symbols
The following symbols are used to understand important matters at one view. Be sure to read below.

DANGER Failure to follow the matters described in this manual will result in death or sever injury.

WARNING Failure to follow the matters described in this manual may result in death or severe injury.

CAUTION Failure to follow the matters described in this manual may result in moderate or minor injury.

Failure to follow the matters described in this manual will cause a damage to the product
NOTICE
itself as well as other properthe’s.

Important Precautions for necessary operations.

Point Precautions for easily mistaken operations.

Reference Useful information or information that helps understanding of descriptions in this manual.

Pages or other manuals including the related information.

 General Precaution
• Proceed with care when modifying this product, or when using it in a manner that falls out of the
range indicated in its specifications, since KEYENCE is unable to guarantee device functionality or
performance in such situations.
• Use this product in combination with other devices only after careful consideration, since the product
may fail to satisfy its functionality and performance capabilities as a result of the conditions and
environment in which it is used.
• Part or all of this manual can not be used or copied without prior consent of KEYENCE.
• Information in this manual may be changed without prior notice.
• Company names and product names described in this manual are registered trademarks or
trademarks of each company.
• Microsoft, Windows, Visual Studio, Visual Basic, Visual C++, Excel, Access are registered
trademarks or trademarks of Microsoft Corporation in the United States or other respective countries.

96118E 1
Software License Agreement

By using or copying all or any portion of KV COM+ Library (hereinafter referred to as “This Software”),
you accept all the terms and conditions of this Software License Agreement (hereinafter referred to as
“This Agreement”).

1. Definition
1.1 “use” or “using” means to access, install, download, copy, or otherwise benefit from using the
functionality of This Software.
1.2 “This Software” means the software and all associated documentation provided by KEYENCE.

2. Grant of License.
2.1 As long as you comply with all of the terms and conditions of This Agreement, KEYENCE grants
to you a non-exclusive license to use This Software.
2.2 You may install This Software on a single computer (in the case of KV-DH1LE-5: 5 computers) in
order to use the products produced by KEYENCE.

3. Limitation on Copying.
3.1 You may make one copy of this software for backup purposes only.

4. Restrictions.
4.1 Other than installation of updates or new functions provided by KEYENCE, you may not modify or
add any functions to This Software.
4.2 You may not reverse engineer, decompile, or disassemble This Software.
4.3 You may not create derivative works based on This Software.
4.4 Other than expressly stated by KEYENCE, you may not resell, retransfer, rent, or otherwise
redistribute This Software to any third parties.

5. Copyright.
5.1 This Software is the property of KEYENCE. Other than expressly stated herein, This Agreement
does not grant you any intellectual property rights.

6. Disclaimer.
6.1 This Software is being delivered to you “AS IS” and KEYENCE makes no warranty as to its use or
performance. In no event will KEYENCE or its suppliers be liable to you for any damages, claims,
costs, or any lost profits caused by using This Software.

7. Termination.
7.1 This Agreement will automatically expire when you stop using This Software.
7.2 The license will terminate if you fail to comply with the terms and conditions of This Agreement.
KEYENCE may terminate the license by notifying you that your continued use of This Software is
prohibited. In the event the license is terminated for any reason, you must destroy This Software
including its backup copy.
7.3 You will compensate KEYENCE for costs or any lost profits caused by your violation of This
Agreement.

8. Governing Law.
8.1 This Agreement will be governed by Japanese laws and regulations.
8.2 If any part of This Agreement is found void and unenforceable, it will not affect the validity of the
balance of This Agreement, which shall remain valid and enforceable according to its terms and
conditions.

2 - KV COM+ Library User’s Manual -


How This manual Is Organized

The chapter describes overview, operating environment


Chapter 1 Before Use and system configuration of the product.

1
The chapter describes programming technique using KV 2
Chapter 2 Programming
Technique
COM+ Library for each language supported.

3
The chapter describes how to set property pages. 4
Chapter 3 Property Page
Set value of property can be easily set on property pages.
Setting Method
5
This chapter describes properties, methods and events of A
Chapter 4 Property Method
Event
KV COM+ Library.

This chapter introduces the installation of DLL and DLL


Chapter 5 About DLL
Function
functions.

Device list, error message lists etc. are provided.


Appendices

- KV COM+ Library User’s Manual - 3


Contents

Preface ....................................................................................................................0
Safety Precautions .................................................................................................1
Software License Agreement ................................................................................2
How This manual Is Organized .............................................................................3
Contents .................................................................................................................4
Conventions Used In This Manual .....................................................................10
Terminology ......................................................................................................... 11
Symbols ............................................................................................................... 11

1 Before Use
1-1 Overview ....................................................................................................1-2
1-2 Operation Environment and System Configuration ..............................1-3
Operation Environment ......................................................................................1-3
System Configuration .........................................................................................1-4
1-3 Software Installation .................................................................................1-5
Before Installation of KV COM+ Library .............................................................1-5
Installation of KV COM+ Library .........................................................................1-6
1-4 Safety Precautions .................................................................................1-10

2 Programming Technique
2-1 Configuration and Function .....................................................................2-2
Configuration of KV COM+ Library .....................................................................2-2
How to Use KV COM+ Library ............................................................................2-5
2-2 Program Creation on Visual Studio ........................................................2-6
Use of KV COM+ Library (on Visual Basic 2005) ..............................................2-6
Program Example - Switching Operation Mode of KV Series PLC ....................2-8
Program Example - Synchronous Monitor .......................................................2-14
Program Example - Asynchronous Monitor ......................................................2-20
Program Example - Device Trigger ..................................................................2-28
Use of KV COM+ Library (When Using Visual C++) ........................................2-38
2-3 Use of KV COM+ Library on Excel ........................................................2-41
Use on a Worksheet .........................................................................................2-41
Use on User Form ............................................................................................2-43
2-4 Use of KV COM+ Library on Access .....................................................2-45

3 Property Page Setting Method


3-1 DBCommManager Control .......................................................................3-2
Comm Settings ...................................................................................................3-3
3-2 DBTriggerManager Control ......................................................................3-8
Addition of Trigger Setting ..................................................................................3-9
Device Specification .........................................................................................3-15
Change of Trigger Setting ................................................................................3-21
Deletion of Trigger Setting ................................................................................3-21
3-3 DBDeviceManager Control ....................................................................3-22
Communication manager Object ......................................................................3-23
Device ..............................................................................................................3-24

4 - KV COM+ Library User’s Manual -


Trigger ..............................................................................................................3-29
3-4 DBRTLoggingManager Control .............................................................3-31
Commanagement Object .................................................................................3-32
Device ..............................................................................................................3-33
PLC Trigger ......................................................................................................3-38
Trigger ..............................................................................................................3-40
3-5 DBCommandButton Control ..................................................................3-42
Basic .................................................................................................................3-43
3-6 DBBarMeter Control ...............................................................................3-44
Basic .................................................................................................................3-45
Display ..............................................................................................................3-46
Scale ................................................................................................................3-48
3-7 DBFanMeter Control ...............................................................................3-49
Basic .................................................................................................................3-50
Display ..............................................................................................................3-51
Scale ................................................................................................................3-53

4 Property Method Event


4-1 Lists of Properties/Methods/Events ........................................................4-2
DBCommManager Object ..................................................................................4-2
DBMemcardAccess Object ................................................................................4-3
DBDeviceManager Object ..................................................................................4-4
DBDevices Object ..............................................................................................4-5
DBDevice Object ................................................................................................4-6
DBTriggerManager Object .................................................................................4-7
DBTriggers Object ..............................................................................................4-7
DBTrigger Object ...............................................................................................4-8
DBTriggerParamInterval Object .........................................................................4-9
DBTriggerParamTimeAt Object ..........................................................................4-9
DBTriggerParamTimeSpan Object ...................................................................4-10
DBTriggerParamLogical Object ........................................................................4-10
DBTriggerParamCustom Object .......................................................................4-11
DBTriggerParamDevice Object .......................................................................4-12
DBRTLoggingManager Object .........................................................................4-13
DBRTLoggingDataCollection Structure ..........................................................4-15
DBRTLoggingDataCollection Object ................................................................4-16
DBRTLoggingData Object ................................................................................4-17
DBRTLoggingDataValue Object .......................................................................4-18
4-2 Details of Properties/Methods/Events ..................................................4-19
DBCommManager Object ................................................................................4-19
Properties ....................................................................................................4-19
Methods .......................................................................................................4-25
DBMemcardAccess Object ..............................................................................4-39
Methods .......................................................................................................4-39
DBDeviceManager Object ................................................................................4-50
Properties ....................................................................................................4-50
Methods .......................................................................................................4-54
Events .........................................................................................................4-58
DBDevices Object ............................................................................................4-63
Properties ....................................................................................................4-63
Methods .......................................................................................................4-65
DBDevice Object ..............................................................................................4-73

- KV COM+ Library User’s Manual - 5


Properties ....................................................................................................4-73
DBTriggerManager Object ...............................................................................4-84
Properties ....................................................................................................4-84
Events .........................................................................................................4-86
DBTriggers Object ............................................................................................4-87
Properties ....................................................................................................4-87
Methods .......................................................................................................4-89
DBTrigger Object ..............................................................................................4-93
Properties ....................................................................................................4-93
Events .......................................................................................................4-104
DBTriggerParamInterval Object .....................................................................4-105
Properties ..................................................................................................4-105
DBTriggerParamTimeAt Object ......................................................................4-106
Properties ..................................................................................................4-106
DBTriggerParamTimeSpan Object .................................................................4-114
Properties ..................................................................................................4-114
DBTriggerParamLogical Object ......................................................................4-116
Properties ..................................................................................................4-116
DBTriggerParamCustom Object .....................................................................4-119
Properties ..................................................................................................4-119
Methods .....................................................................................................4-120
DBTriggerParamDevice Object ......................................................................4-121
Properties ..................................................................................................4-121
DBRTLoggingManager Object .......................................................................4-130
Properties ..................................................................................................4-130
Methods .....................................................................................................4-150
Events .......................................................................................................4-158
DBRTLoggingDataCollection Object ..............................................................4-160
Properties ..................................................................................................4-160
DBRTLoggingData Object ..............................................................................4-162
Properties ..................................................................................................4-162
DBRTLoggingDataValue Object .....................................................................4-166
Properties ..................................................................................................4-166
4-3 ActiveX Control .....................................................................................4-168
DBCommandButton Object ............................................................................4-168
DBBarMeter Object ........................................................................................4-169
DBFanMeter Object ........................................................................................4-170
Properties ..................................................................................................4-171
Methods .....................................................................................................4-183
Events .......................................................................................................4-186
4-4 Data Conversion Function ...................................................................4-187
DBValueConverterEx Object ..........................................................................4-187
Methods .....................................................................................................4-189

5 About DLL Function


5-1 Installation of DLL ....................................................................................5-2
How to Set the Path ...........................................................................................5-2
Link Setting .........................................................................................................5-2
Include File .........................................................................................................5-2
5-2 DLL Function .............................................................................................5-3
1 Constant, Type and Structure Definition .........................................................5-3

6 - KV COM+ Library User’s Manual -


2 Initialization of DataBuilder.dll .........................................................................5-8
3 Connection Control ..........................................................................................5-9
4 Operation Mode/State Control .......................................................................5-13
5 Read/Write to a Device .................................................................................5-15
6 Alarm .............................................................................................................5-41
7 Access Functions to a Memory Card ............................................................5-43
8 Other Control .................................................................................................5-54

Appendices
1 USB Driver Installation ............................................................................ A-2
Install on Windows 7/Vista ................................................................................ A-2
Install on Windows XP ....................................................................................... A-2
2 Device List ................................................................................................ A-4
3 Bit Specification of Word Device ........................................................... A-8
4 Model Change .......................................................................................... A-9
5 Error Message Lists .............................................................................. A-10
ActiveX ............................................................................................................ A-10
Each object ................................................................................................. A-10
During communication ................................................................................. A-12
Other .......................................................................................................... A-14
DLL .................................................................................................................. A-15
6 About Compatibility ............................................................................... A-20
7 Index ....................................................................................................... A-21

- KV COM+ Library User’s Manual - 7


Conventions Used In This Manual

This section describes page components, meaning of symbols, etc.

Headline 2-6 Setting Basic Functions

Chapter title This section explains how to set the basic functions of KV COM+ for Excel.

Function Part
Monitor Mid-heading
Index for each 2
At the occurrence of a trigger (that can be set by cycle, time, device, or button), the PLC device value
is written into a set cell. It is also possible to write a cell value into a PLC device at the occurrence of

chapter
a trigger or at the confirmation of input.

Sub-heading
Setting Basic Functions

■Create a new monitor.


1 Select a cell (range) where to set the monitor.
Reference A cell (range) can also be specified at "Object Cell" in the Set Monitor dialog box. Procedures
2 From the menu, select "Add-in" "KV COM+(K)" -> "Set Basic Function (F)" -> "New Monitor (M)".
Other procedure Different procedure
Reference
Describes the ‡ Click .
‡ Open the right-click menu and click "Create Monitor".
information.
operations The Set Monitor screen is displayed.

3 Click the Set Device tab. Shows points for


corresponding to menu Set a object cell range and also a monitoring device and its display.

4 better understanding
operations in procedure Select a device type and enter a device number.

of the text and useful


Page or manual to "Appendices: Device List" (Page App-7) information.
5
refer to. Set a device name display position.

Operation dialog box


The page or manual
containing the related Point
When "Object Cell" is specified by a range, the settable items are limited. Note
information is Shows easily
Example
indicated here. If a cell range is specified in the column direction, "Above" and "Below" cannot be set.
mistaken operations.
Be sure to read
Examples. carefully.

2-26 - KV COM+ for Excel User’s Manual -

* KV COM+ for Excel User’ s Manual is used as an example.

8 - KV COM+ Library User’s Manual -


Terminology

This manual uses the following terminology excluding some instances.

Term Description
Refers to the overall system of a programmable logic controller; it contains a base
PLC unit and CPU unit with each units mounted. The word PLC here represents the
overall system.
PC Stands for personal computer.
KV STUDIO Indicates KV STUDIO Ladder Support Software.
Ladder program Indicates programs compiled with KV STUDIO Ladder support software.

Symbols

Menus and buttons in this manual are indicated using the following marks and symbols.

Symbol Description
[ ] Menu item, which can be selected from menu.
" " - Name of dialog box or item.
- Buttons with text description on dialog box in various operations (such as performing
and canceling).
Ctrl CTRL key on keyboard.

- KV COM+ Library User’s Manual - 9


MEMO

10 - KV COM+ Library User’s Manual -


1

Before Use
Before Use 1

The chapter includes overview, operating environment and system


configuration of the product.

1-1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-2


1-2 Operation Environment and System Configuration .1-3
1-3 Software Installation. . . . . . . . . . . . . . . . . . . . . . . . . . .1-5
1-4 Safety Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . .1-10

- KV COM+ Library User’s Manual - 1-1


1-1 Overview
Before Use

KV COM+ Library supports ActiveX control* which makes it easier to handle PLC information with user
applications including Microstate Excel.
Since most properties can be easily set on property pages not requiring complex communication
programs, the coding amount is significantly reduced. KV COM+ Library is the most suitable for
1 programmers who want to create original programs to deal with PLC information or who are not
satisfied with KV COM+ for Excel.
Overview

*) ActiveX control: ActiveX is a technology developed by Microsoft, enables components of different


software to use together. Those components are called ActiveX controls.

PC

User application Microsoft Excel

KV COM+ Library

KV-5000
KV STUDIO
simulator Communication

Serial, USB, Ethernet


Bluetooth, Routing setting

1-2 - KV COM+ Library User’s Manual -


1-2 Operation Environment and System Configuration

Before Use
This section describes operation environment and system configuration of KV COM+ Library.

Operation Environment
1
The following environment is required for operation of KV COM+ Library.

Operation Environment and System Configuration


Make sure that using your system meets the following conditions and has the required devices.
Computer system supported
Computer installed with Windows XP, Windows 2000, Windows 7 or Windows Vista, equipped with
RS-232C or USB interface.
CD-ROM drive
CPU
Windows XP/2000: Pentium 800MHz or more
(Pentium 1GHz or more recommended)
Windows 7/Vista: Processor recommended by Microsoft Corporation.
Memory capacity
Windows XP/2000: Expanded memory 256 MB or more (512 MB or more
recommended)
Windows 7/Vista: Memory recommended by Microsoft Corporation.
Applicable OS
• Windows XP
• Windows 2000 (SP3 or more)
• Windows Vista (Not included 64-bit version)
• Windows 7
(Only English operation system)
Supported languages
Microsoft Visual Basic Visual Basic 2010/2008/2005, Visual Basic.NET 2003,
Visual Basic 6.0
Microsoft Visual C++ Visual C++ 2010/2008/2005, Visual C++.NET 2003,
Visual C++ 6.0
Microsoft Office Excel2010/2007/2003/2002/2000
Microsoft Office Access2010/2007/2003/2002/2000
VBScript*1
*1. Only DBCommManager supported.
Free Space Available on Hard Disk
200M bytes or more

《PLC》
KV COM+ Library supports the following PLC.
• KV-5500
• KV-5000
• KV-3000
• KV-1000
• KV-700

- KV COM+ Library User’s Manual - 1-3


1-2 Operation Environment and System Configuration
Before Use

System Configuration

1
Operation Environment and System Configuration

KV-5000 Routing setting (FL-net)


KV-5000/KV-FL20V

VT3 series
Routing setting (VT/DT)
KV-3000/1000/700/L20V

Ethernet switch
Ethernet connection

(STP/UTP straight cable)

Ethernet connection
(STP/UTP straight cable)

Ethernet connection
(STP/UTP cross cable)

Serial connection
㧔RS-232C‫ޔ‬RS-422A㧕

Ethernet KV-5500/5000/LE20V/LE21V/EP21V
Routing setting (FL-net) KV-5000/KV-FL20V
(VT/DT) KV-3000/1000/700/L20V
Bluetooth USB connection
(EtherNet/IP) KV-5500/KV-EP21V
connection

Serial KV-3000/1000/700/L20V

USB KV-5500/5000/3000/1000/700
Bluetooth KV-5500/5000*1/3000 (Ver.2 above)
(* For 1 KV-5000, Ver.1.1 above)

1-4 - KV COM+ Library User’s Manual -


1-3 Software Installation

Before Use
This section explains installation and uninstallation of KV COM+ Library.
“KV COM+ Library installation CD” also includes both ActiveX and DLL.

Before Installation of KV COM+ Library 1

Software Installation
Check the following items before starting the installation of KV COM+ Library.

● Free Space Available on Hard Disk


KV COM+ Library can be installed only on hard disks. Fee space of 200M bytes shall be necessary on
the hard disk to be installed. If there is not enough free space, clean up the hard disk so that there is
enough space.

● Windows Environment and Installation Directory


KV COM+ Library should be installed and operated on Windows.
Make sure that Windows 7/Vista/XP/2000 are installed and are running normally on the PC when in
use.

● Serial port (RS-232C)


To connect device with RS-232C, serial port on the PC must be able to detect the device. For setting
details, refer to the PC manual.

● USB Port
To connect each device with USB, USB port on the PC must be able to detect the device. For setting
details, refer to the PC manual.
USB connection requires USB driver for each connected device.
"USB Driver Installation"(A-2 page)

● Ethernet Port
To connect each device with USB, USB port on the PC must be able to detect the device. For setting
details, refer to the PC manual or ask your network administrator.

● Bluetooth
To connect each device with USB, USB port on the PC must be able to detect the device. For setting
details, refer to the PC manual.

- KV COM+ Library User’s Manual - 1-5


1-3 Software Installation
Before Use

Installation of KV COM+ Library

This section describes how to install KV COM+ Library on Windows 7 with the following drive

1 1
configuration.

Turn on the computer to activate Windows.


Software Installation

Point • Shut down all other software running on the PC before starting installation. If antivirus
software is running, installation may take more time.
• Only the administrator, users with rights to change the system, can install this software;
administrator login is necessary.

2 Place “KV COM+ Library installation CD” in the CD-ROM drive on the PC.
“KV COM+ Library installation CD” starts automatically due to automatic execution system. If the
installation program is automatically activated, go to step 5. If not, go to step 3.

3 Click “Start” button and enter “e:\setup” in the search box.


The search result list comes up.

4 Click “setup” on the list.


Installation program is activated.

1-6 - KV COM+ Library User’s Manual -


1-3 Software Installation

Before Use
Progress bar shows preparation progress for setup.

Software Installation
6 When the next dialog box is displayed, click “Next (N)” button. To cancel setup, click “Cancel”
button.

7 When the next dialog box is displayed, read the software licensing. If you agree, click the radio
button for “I accept the terms in the license agreement” and click “Next (N)” button.

- KV COM+ Library User’s Manual - 1-7


1-3 Software Installation

8
Before Use

Enter user name, Organization, Serial Number and click "Next (N)" button.
The serial number is on "License certificate" included in the package.

1
Software Installation

9 Confirm drive name and folder (directory) name to be installed.


"C:\Program Files\KEYENCE\KVComPlusLB" is specified as the installation destination by default. To
install the program to the destination displayed, click "Next (N)" button.
To change the installation destination, click "Change" button to specify drive name and folder (directory)
name.

10 When the next dialog box is displayed, click "Install" button. To quit setup, click "Cancel"
button.

1-8 - KV COM+ Library User’s Manual -


1-3 Software Installation

11 When setup is finished successfully, a message comes up to indicate the end of the setup

Before Use
procedure.
Click "Finish" button to finish installation.

Software Installation

- KV COM+ Library User’s Manual - 1-9


1-4 Safety Precautions
Before Use

This section describes the notes when using KV COM+ Library. Be sure to read carefully.

● Interface of PC
Make sure that devices connected to serial, USB, Ethernet port or Bluetooth is detected by the PC. If
1 not set properly, devices do not work. For setting details, refer to the PC manual.

● Precautions during communication


Safety Precautions

During communication, do not turn off the connected devices or pull the connection cable out to avoid
communications errors.

● Precautions when using USB


For USB connection, USB must be directly connected to the USB port of the device without using USB
hub. Communications may be disrupted since noise or other factors may cause unstable
communications. If communication is disrupted, pull out and re-insert the USB cable. To avoid frequent
interruption of communication, attach a ferrite bead to the connection cable.

● Precautions for long time use


Duplicate data with 2 PCs to archive significant data reliability.

● Precautions for the rights upon use


When using KV COM+ Library, assign "Power User" or higher authority for users using KV COM+
Library.

1-10 - KV COM+ Library User’s Manual -


Programming Technique
2
Programming Technique 2

The chapter includes programming technique when using KV COM+ Library


for each language supported.

2-1 Configuration and Function. . . . . . . . . . . . . . . . . . . . .2-2


2-2 Program Creation on Visual Studio . . . . . . . . . . . . . .2-6
2-3 Use of KV COM+ Library on Excel . . . . . . . . . . . . . .2-41
2-4 Use of KV COM+ Library on Access . . . . . . . . . . . . .2-45

- KV COM+ Library User’s Manual - 2-1


2-1 Configuration and Function
Programming Technique

This section describes the overview of configuration and function of KV COM+ Library as well as how to
use KV COM+ Library.

Configuration of KV COM+ Library

2 KV COM+ Library supports ActiveX control which makes it possible easy handling of information in
PLCs through communication with KV series PLC, is composed of 7 control objects and has other 15
objects.
Configuration and Function

DATABUILDERAXLibLB

Management Reference
DBTriggerManager
DBMemcardAccess DBCommManager DBDeviceManager
Management
Management Reference
DBTriggers
DBDevices
Creation/
Management
Creation/Management Reference
DBRTLoggingManager DBTrigger
DBDevice
Reference Creation/
Management Management

DBRTLoggingDataCollection DBTriggerParamInterval

Management
DBTriggerParamTimeAt
DBRTLoggingData

Management DBTriggerParamTimeSpan

DBRTLoggingDataValue
DBTriggerParamLogical

DBTriggerParamCustom

DBTriggerParamDevice

Memory card Communication Real time logging


management management Device management management Trigger management

Data Conversion

DBValueConverterEx

ActiveX Control
DBCommandButton

DBBarMeter

DBFanMeter

2-2 - KV COM+ Library User’s Manual -


2-1 Configuration and Function

Programming Technique
 Function of Each Control Object
KV COM+ Library has 7 control objects; "DBCommManager", "DBDeviceManager",
"DBTriggerManager", "DBRTLoggingManager", "DBCommandButton", "DBBarMeter" and
"DBFanMeter".

The following is the main features of each object:

Control name Function


Manages communication with the connected device. Synchronous read and
2
write operation is possible. Unable to proceed to next processing until

Configuration and Function


“DBCommManager” completing the current processing, however, it is easy to handle in
programming.
"DBCommManager Object"(4-2 page)
Manages device information for butch read and write at arbitrary timing.
Reads and writes data asynchronously, resulting in complex handling on
“DBDeviceManager” programming while reducing burden of application.
"DBDeviceManager Object"(4-4 page)
Manages trigger information which determines the timing of arbitrary order
behavior. Able to set triggers of either cycle, time, time range or combination
“DBTriggerManager” of those triggers.
"DBTriggerManager Object"(4-7 page)
Manages device information and trigger information that use real time
logging. Able to collect data with less without losing while communicating
“DBRTLoggingManager” due to data buffer inside PLC. (PLC supported: KV-5500/5000/3000)
"DBRTLoggingManager Object"(4-13 page)
Controls switch, lump switch, lump, N status lump by using ActiveX control.
“DBCommandButton”
"DBCommandButton Object"(4-168 page)
Controls bar-type meter by using ActiveX control.
“DBBarMeter”
"DBBarMeter Object"(4-169 page)
Controls Circle meter or Sector meter by using ActiveX control.
“DBFanMeter”
"DBFanMeter Object"(4-170 page)

- KV COM+ Library User’s Manual - 2-3


2-1 Configuration and Function
Programming Technique

 Function of Each Object


KV COM+ Library has 15 objects other than 7 control objects.
Since these objects can be easily set on the property page, you do not have to concern about those
functions under normal conditions.

Object name Function


Represents DBDevice collection
2 “DBDevices” Creates/manages DBDevice object
"DBDevices Object"(4-5 page)
Represents device for asynchronous read and write
Configuration and Function

“DBDevice”
"DBDevice Object"(4-6 page)
Represents DBTrigger collection
“DBTriggers” Creates/manages DBTrigger object.
"DBTriggers Object"(4-7 page)
Represents triggers
Creates/manages the following trigger condition objects:
DBTriggerParamTimeSpan
DBTriggerParamLogical
“DBTrigger” DBTriggerParamCustom
DBTriggerParamInterval
DBTriggerParamTimeAt
DBTriggerParamDevice
"DBTrigger Object"(4-8 page)
Represents trigger conditions. Able to set 6 types of cycle, time, time
“DBTriggerParamInterval” range, device combination and custom.
“DBTriggerParamTimeAt” "DBTriggerParamInterval Object"(4-9 page)
“DBTriggerParamTimeSpan” "DBTriggerParamTimeAt Object"(4-9 page)
“DBTriggerParamDevice” "DBTriggerParamTimeSpan Object"(4-10 page)
“DBTriggerParamLogical” "DBTriggerParamDevice Object"(4-12 page)
“DBTriggerParamCustom” "DBTriggerParamLogical Object"(4-10 page)
"DBTriggerParamCustom Object"(4-11 page)
Represents access to memory card. Manages files in the memory card.
“DBMemcardAccess”
"DBMemcardAccess Object"(4-39 page)
“DBRTLoggingDataCollection” Manages data acquired by real time logging
“DBRTLoggingData” "DBRTLoggingDataCollection Object"(4-160 page)
"DBRTLoggingData Object"(4-162 page)
“DBRTLoggingDataValue” "DBRTLoggingDataValue Object"(4-166 page)
Executes mutual conversion of data for character string type and value
“DBValueConverterEx” type.
"DBValueConverterEx Object"(4-187 page)

2-4 - KV COM+ Library User’s Manual -


2-1 Configuration and Function

Programming Technique
How to Use KV COM+ Library

KV COM+ Library enables PLC information handling with DBCommManager control alone. For
handling of multiple nonsequential devices or read and write at more complex timing, combination of
DBDeviceManager control and DBTriggerManager control is used.

 Single Use of DBCommManager Control


PLC information is handled only by DBCommManager control. Upon read and write on the device,
2
processing proceeds one by one. However, handling on programming is easy. Select single use to read

Configuration and Function


and write on single device or sequential devices at simple timing.

Connected
DBCommManager
device

"Program Example - Switching Operation Mode of KV Series PLC"(2-8 page)


"Program Example - Synchronous Monitor"(2-14 page)

 Use of 4 Combined Controls


For batch handling of multiple devices, DBDeviceManager control and DBCommManager control
works together. Asynchronous read and write of data makes handling on programming more complex
but reduces burden of applications. Using the combination of DBRTLoggingManager control and
DBCommManager for batch handling of multiple devices makes programming more complex but
reduces data lost by communication because logging data buffered in PLC can be acquired.
DBTriggerManager control sets trigger conditions to read and write on the device. Select combination
of 4 controls to handle multiple nonsequential devices or read and write at more complex timing.

KV COM+ ActiveX control

Reference
DBDeviceManager DBTriggerManager

DBRTLoggingManager
Reference

Connected
DBCommManager
device
Communication

"Program Example - Asynchronous Monitor"(2-20 page)


"Program Example - Device Trigger"(2-28 page)

- KV COM+ Library User’s Manual - 2-5


2-2 Program Creation on Visual Studio
Programming Technique

This section describes how to create program on Visual Studio using KV COM+ Library.

Use of KV COM+ Library (on Visual Basic 2005)

Following is procedure to make KV COM+ Library available on Visual Basic:


2 1 Start up Visual Basic.
Program Creation on Visual Studio

2 Select “File (F)” -> "New Project (P)" from the menu bar to display "New project" dialog box.

3 Select "Windows Forms Application" and click "OK" button to create a new project.

4 Select "Tools (T)" -> "Choose Toolbox item (X)" from the menu bar.
Click COM components tab to open. Select an item, then click "Browse (B)" button.

2-6 - KV COM+ Library User’s Manual -


2-2 Program Creation on Visual Studio

Programming Technique
5 Check the following items from COM component as necessary and click "OK" button.

• DBCommManager Class (Library)


• DBDeviceManager Class (Library)
• DBTriggerManager Class (Library)
• DBRTLoggingManager Class (Library)


DBCommandButton Control (Library)
DBBarMeter Control (Library)
2
• DBFanMeter Control (Library)

Program Creation on Visual Studio


If the item is successfully added, a component is shown in the tool box window.

6 Select control of KV COM+ Library to be used.

7 Drag the selected control on the form.


ActiveX control is created on the form.

- KV COM+ Library User’s Manual - 2-7


2-2 Program Creation on Visual Studio
Programming Technique

Program Example - Switching Operation Mode of KV Series PLC

This program switches operation mode of KV-5000. Upon starting the program, KV-5000 is connected
to the PC and operation mode of acquired KV-5000 is reflected on the option button.

2
Program Creation on Visual Studio

RUN switch PROGRAM switch


Switches to RUN. Switches to
PROGRAM mode.

Point • Select RUN switch here to proceed to next procedure.

2-8 - KV COM+ Library User’s Manual -


2-2 Program Creation on Visual Studio

Programming Technique
 Procedures to Create Program

1 Create a new project.


2 Allocate AxDBCommManager Class control.
3 Allocate the first RadioButton control.
4 Allocate the second RadioButton control.
2

Program Creation on Visual Studio


1 Create a new project.

(1) Create a new project and configure KV COM+ Library available.


"Use of KV COM+ Library (on Visual Basic 2005)"(2-6 page)

2 Allocate AxDBCommManager Class control.

(1) Allocate AxDBCommManager Class control on a form of the project and select the control to
create "AxDBCommManager1".

(2) Set "PLC" (Connection model) in the property window of "AxDBCommManager1".


Select "KV-5500/5000/3000".
"PLC"(4-19 page)

- KV COM+ Library User’s Manual - 2-9


2-2 Program Creation on Visual Studio
Programming Technique

(3) Click "Property page" button on the property window of "AxDBCommManager1". "Property
page" dialog box comes up.

"Property page" button

2 (4) Click "Settings" button to display "Communication setting" dialog box.


Program Creation on Visual Studio

(5) Select communication setting. Select "USB" here.


"Comm Settings"(3-3 page)

(6) To edit the configuration of the form, select "View (V)" -> "Code (C)" from the menu.
Other procedure
Double-click the form to display a code window.

2-10 - KV COM+ Library User’s Manual -


2-2 Program Creation on Visual Studio

Programming Technique
(7) Write the following code in "Form_Load" procedure.
Detail: To start communication with KV-5000 upon the start of the program.
"Connect"(4-26 page)

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _


Handles MyBase.Load
AxDBCommManager1.Connect() ' Start communication.
End Sub
2
3 Allocate the first RadioButton control.

Program Creation on Visual Studio


(1) Allocate RadioButton control on the form to create "RadioButton1".

(2) Change "Text" on the property window from "RadioButton1" to "RUN".

(3) To edit the text "RadioButton1", select "View (V)" -> "Code (C)" from the menu.
Other procedure
Double-click "RadioButton1" to display the code window.

(4) Write the following code in "RadioButton1_Click" procedure.


Details: To click "RadioButton1" to change the mode of KV-5000 to RUN mode.
"SetMode"(4-29 page)

Private Sub RadioButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) _


Handles RadioButton1.Click
AxDBCommManager1.SetMode(True) 'Switch to RUN mode.
End Sub

- KV COM+ Library User’s Manual - 2-11


2-2 Program Creation on Visual Studio
Programming Technique

4 Allocate the second RadioButton control.

(1) Create "RadioButton2" and change "Text" to "PROGRAM" as described in the procedure above.

(2) Write the following code in "RadioButton2_Click" procedure.


Details: To click "RadioButton2" to change the mode of KV-5000 to PROGRAM mode.

2 Private Sub RadioButton2_Click(ByVal sender As Object, ByVal e As System.EventArgs) _


Handles RadioButton2.Click
AxDBCommManager1.SetMode(False) 'Switch to PROGRAM mode.
Program Creation on Visual Studio

End Sub

(3) Add the following code to "Form_Load" procedure.


Details: To reflect the current operation mode of KV-5000 to option toolbar upon the start of the
program.
"GetMode"(4-28 page)

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


MyBase.Load
AxDBCommManager1.Connect() ' Start communication.
If AxDBCommManager1.GetMode Then
RadioButton1.Checked = True
Else
RadioButton2.Checked = True
End If
End Sub

 Code
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _
MyBase.Load
AxDBCommManager1.Connect() ' Start communication.
If AxDBCommManager1.GetMode Then
RadioButton1.Checked = True
Else
RadioButton2.Checked = True
End If
End Sub

Private Sub RadioButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles _


RadioButton1.Click
AxDBCommManager1.SetMode(True) 'Switch to RUN mode.
End Sub

Private Sub RadioButton2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles _


RadioButton2.Click
AxDBCommManager1.SetMode(False) 'Switch to PROGRAM
End Sub

2-12 - KV COM+ Library User’s Manual -


2-2 Program Creation on Visual Studio

Programming Technique
To create with Visual C++ (Switching PLC operation mode)

// Start communication with PLC.


BOOL CDialog::OnInitDialog()
{
// TODO: Add initialization here.
CDBCommManager1.Connect();
if (CDBCommManager1.GetMode()) {
m_rdBtn1.SetCheck(true);
} else { 2
m_rdBtn2.SetCheck(false);

Program Creation on Visual Studio


}
UpdateData();
return TRUE;
}
// Change operation mode to RUN.
void CTestDlg::OnBnClickedRadio1()
{
CDBCommManager1.SetMode(true);
}
// Change operation mode to PROGRAM.
void CTestDlg::OnBnClickedRadio2()
{
CDBCommManager1.SetMode(false);
}
// Stop communication with PLC.
void CTestDlg::OnBnClickedOk()
{
CDBCommManager1.Disconnect();
OnOK();
}

- KV COM+ Library User’s Manual - 2-13


2-2 Program Creation on Visual Studio
Programming Technique

Program Example - Synchronous Monitor

This program reads device values at each click of the “Read” button.
It also writes input values at each click of the “Write” button.

2
Program Creation on Visual Studio

Device value display "Write" button


Displays device value. Writes device values in
"Read" button the device value
Reads device values from PLC and display into PLC.
displays the device values in the
device value display.

2-14 - KV COM+ Library User’s Manual -


2-2 Program Creation on Visual Studio

Programming Technique
 Program Creation Procedure

1 Create a new project.


2 Allocate AxDBCommManager Class control.
3 Allocate TextBox control.
4
5
Allocate Label control.
Allocate the first Button control.
2
6

Program Creation on Visual Studio


Allocate the second Button control.

1 Create a new project.

(1) Create a new project and configure KV COM+ Library available.


"Use of KV COM+ Library (on Visual Basic 2005)"(2-6 page)

2 Allocate AxDBCommManager Class control.

(1) Allocate AxDBCommManager Class control on a form of the project and select the control to
create "AxDBCommManager1".

(2) Set "PLC" (connection model) on the property window of "AxDBCommManager1".


Select "KV-5500/5000/3000".
"PLC"(4-19 page)

- KV COM+ Library User’s Manual - 2-15


2-2 Program Creation on Visual Studio
Programming Technique

(3) Click "Property page" button on the property window of "AxDBCommManager1". "Property"
dialog box comes up.

(4) Click "Settings" button to display "Communication setting" dialog box.


2
Program Creation on Visual Studio

(5) Select communication setting. Set "USB" here.


"Comm Settings"(3-3 page)

(6) To edit the configuration of the form, select "View (V)" -> "Code (C)" from the menu.
Other procedure
Double-click the form to display the code window.

(7) Write the following code in "Form_Load" procedure.


Details: To start communication with the connected device while running the program.
"Connect"(4-26 page)

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _


Handles MyBase.Load
AxDBCommManager1.Connect() ' Start communication.
End Sub

2-16 - KV COM+ Library User’s Manual -


2-2 Program Creation on Visual Studio

Programming Technique
3 Allocate TextBox control.

(1) Allocate TextBox control on the form to create "TextBox1".

Program Creation on Visual Studio


4 Allocate Label control.

(1) Allocate Label control on the form and change "Text" to "DM0".

5 Allocate the first Button control.

(1) Allocate Button control on the form to create "Button1".

(2) Change "Button1" to "Read".

(3) To edit the text "Button1", select "View (V)" -> "Code (C)" from the menu.
Other procedure
Double-click "Button1" to open the code window.

(4) Write the following code in "Button1_Click" procedure.


Details: To click Button1 to read DM0 value and display it in TextBox1.
"ReadDevice"(4-32 page)

- KV COM+ Library User’s Manual - 2-17


2-2 Program Creation on Visual Studio
Programming Technique

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _


Handles Button1.Click
TextBox1.Text = AxDBCommManager1.ReadDevice _
(DATABUILDERAXLibLB.DBPlcDevice.DKV5000_DM, "0")
End Sub

6 Allocate the second Button control.


2 (1) Allocate Button control on the form to create "Button2".
Program Creation on Visual Studio

(2) Change "Button2" to "Write".

(3) To edit the text of "Button2", select "View (V)" -> "Code (C)" from the menu.
Other procedure
Double-click "Button2" to display a code window.

(4) Write the following code in "Button2_Click" procedure.


Detail: Click Button2 to write the value input in TextBox1into DM0.
"WriteDevice"(4-36 page)

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As _


System.EventArgs) Handles Button2.Click

AxDBCommManager1.WriteDevice(DATABUILDERAXLibLB.DBPlcDevice.DKV5000_DM, _
"0", CLng(TextBox1.Text))
End Sub

 Code
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _
MyBase.Load
AxDBCommManager1.Connect() ' Start communication.
End Sub

2-18 - KV COM+ Library User’s Manual -


2-2 Program Creation on Visual Studio

Programming Technique
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _
Button1.Click
TextBox1.Text = AxDBCommManager1.ReadDevice _
(DATABUILDERAXLibLB.DBPlcDevice.DKV5000_DM, "0")
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button2.Click 2

Program Creation on Visual Studio


AxDBCommManager1.WriteDevice(DATABUILDERAXLibLB.DBPlcDevice.DKV5000_DM, "0", _
CLng(TextBox1.Text))
End Sub

- KV COM+ Library User’s Manual - 2-19


2-2 Program Creation on Visual Studio
Programming Technique

Program Example - Asynchronous Monitor

This program reads device values at the cycle of 50ms.

2 Device value display


Displays device value.
Program Creation on Visual Studio

2-20 - KV COM+ Library User’s Manual -


2-2 Program Creation on Visual Studio

Programming Technique
 Program Creation Procedure

1 Create a new project.


2 Allocate AxDBCommManager Class control.
3 Allocate AxDBTriggerManager Class control.
4 Allocate AxDBDeviceManager Class control.
2
5 Allocate TextBox control.

Program Creation on Visual Studio


6 Allocate Label control.

1 Create a new project.

(1) Create a new project and configure KV COM+ Library available.


"Use of KV COM+ Library (on Visual Basic 2005)"(2-6 page)

2 Allocate AxDBCommManager Class control.

(1) Allocate AxDBCommManager Class control on a form of the project and select the control to
create "AxDBCommManager1".

(2) Set "PLC" (Connection model) in the property window of "AxDBCommManager1".


Select "KV-5500/5000/3000".
"PLC"(4-19 page)

- KV COM+ Library User’s Manual - 2-21


2-2 Program Creation on Visual Studio
Programming Technique

(3) Click "Property page" button on the property window of "AxDBCommManager1". "Property"
dialog box comes up..

(4) Click "Settings" button to display "Communication setting" dialog box.


2
Program Creation on Visual Studio

(5) Select communication setting. Select "USB" here.


"Comm Settings"(3-3 page)

(6) To edit the configuration of the form, select "View (V)" -> "Code (C)" from the menu.
Other procedure
Double-click the form to open the code window.

(7) Write the following code in "Form_Load" procedure.


Detail: To start communication with the connected device while running the program.
"Connect"(4-26 page)

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _


Handles MyBase.Load
AxDBCommManager1.Connect() ' Start communication.
End Sub

2-22 - KV COM+ Library User’s Manual -


2-2 Program Creation on Visual Studio

Programming Technique
3 Allocate AxDBTriggerManager Class control.

(1) Allocate AxDBTriggerManager Class control on a form of the project and select the control to
create "AxDBTriggerManager1".

Program Creation on Visual Studio


(2) Click "Property page" button on the property window of "AxDBTriggerManager1". "Property"
dialog box comes up..

(3) Click "Add" button to display "Trigger setting" dialog box.

(4) Set a trigger period as shown below and click "Finish" button.
"Trigger setting for period"(3-10 page)

→ →

The current dialog box is closed and "Property" dialog box comes up. Set trigger is displayed on the list.

(5) Click "Close" button to close "Property" dialog box.

- KV COM+ Library User’s Manual - 2-23


2-2 Program Creation on Visual Studio
Programming Technique

(6) Write the following code in "Form_Load" procedure.


Detail: To enable a trigger while running the program.
「DBCommManager.Active」(4-24 page)

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _


Handles MyBase.Load
AxDBCommManager1.Connect() ' Start communication.
2 AxDBTriggerManager1.Active = True ' Enable trigger.
End Sub
Program Creation on Visual Studio

4 Allocate AxDBDeviceManager Class control.

(1) Allocate AxDBDeviceManager Class control on a form of the project to create


"AxDBDeviceManager1".

(2) Click "Property page" button on the property window of "AxDBDeviceManager1". "Property"
dialog box comes up.

(3) Select communication management object (DBCommManager) to refer to a drop-down list of


"Communication Target". Select "AxDBDeviceManager1" here.

(4) Click "Device" tab.

(5) Click "Add" button. "Device setting" dialog box comes up..

2-24 - KV COM+ Library User’s Manual -


2-2 Program Creation on Visual Studio

Programming Technique
(6) Set values as shown below and click "OK" button.

Point Specify data memory for word processing.

Program Creation on Visual Studio


"Device setting" dialog box is closed and the device is added to the "Property" dialog box.

(7) Click "Trigger" tab.

(8) Select trigger setting at the time of read from a drop-down list of "Read Trigger". Select
"AxDBTriggerManager1.Trigger1" here.

(9) Click "Close" button to close "Property" dialog box.

- KV COM+ Library User’s Manual - 2-25


2-2 Program Creation on Visual Studio
Programming Technique

5 Allocate TextBox control.

(1) Allocate TextBox control on a form of the project to create "TextBox1".

2
Program Creation on Visual Studio

(2) Right-click on "TextBox1" to display the short cut menu.

(3) Select and click "Copy".


(4) Right-click the arbitrary point on the form to display the short cut menu.
(5) Select and Click "Paste"

(6) "TextBox2" is created.


(7) Repeat the procedures from 4 to 6 to create "TextBox3" and "TextBox4".

2-26 - KV COM+ Library User’s Manual -


2-2 Program Creation on Visual Studio

Programming Technique
6 Allocate Label control.

(1) Allocate Label control on a form of the project and change “Text” to “DM0”, “DM1”, “DM2”,
“DM3”.

Program Creation on Visual Studio


(2) Write the following code in "AxDBDeviceManager1_AfterRead" procedure.
Detail: To display the device values read from PLC in the text box.
"AfterRead"(4-59 page)
"ValueRead"(4-75 page)

Private Sub AxDBDeviceManager1_AfterRead(ByVal sender As Object, ByVal e As System.EventArgs) _


Handles AxDBDeviceManager1.AfterRead
TextBox1.Text = AxDBDeviceManager1.Devices(1).ValueRead
TextBox2.Text = AxDBDeviceManager1.Devices(2).ValueRead
TextBox3.Text = AxDBDeviceManager1.Devices(3).ValueRead
TextBox4.Text = AxDBDeviceManager1.Devices(4).ValueRead
End Sub

 Code
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _
MyBase.Load
AxDBCommManager1.Connect() ' Start communication.

AxDBTriggerManager1.Active = True ' Enable trigger.


End Sub

Private Sub AxDBDeviceManager1_AfterRead(ByVal sender As Object, ByVal e As System.EventArgs) _


Handles AxDBDeviceManager1.AfterRead
TextBox1.Text = AxDBDeviceManager1.Devices(1).ValueRead
TextBox2.Text = AxDBDeviceManager1.Devices(2).ValueRead
TextBox3.Text = AxDBDeviceManager1.Devices(3).ValueRead
TextBox4.Text = AxDBDeviceManager1.Devices(4).ValueRead
End Sub

- KV COM+ Library User’s Manual - 2-27


2-2 Program Creation on Visual Studio
Programming Technique

Program Example - Device Trigger

This program reads and displays device values while CR2006 (1 second clockpulse) of KV-5000 is ON.
The program does not read the values while CR2006 is OFF.

2
Device value display
Program Creation on Visual Studio

Displays device values.

2-28 - KV COM+ Library User’s Manual -


2-2 Program Creation on Visual Studio

Programming Technique
 Program Creation Procedure

1 Create a new project.


2 Allocate AxDBCommManager Class control.
3 Allocate AxDBTriggerManager Class control.
4
5
Allocate the first AxDBDeviceManager Class control.
Allocate TextBox control.
2
6 Allocate Label control.

Program Creation on Visual Studio


7 Allocate the second AxDBDeviceManager Class
control.

1 Create a new project.

(1) Create a new project and configure KV COM+ Library available.


"Use of KV COM+ Library (on Visual Basic 2005)"(2-6 page)

2 Allocate AxDBCommManager Class control.

(1) Allocate AxDBCommManager Class control on a form of the project and select the control to
create "AxDBCommManager1".

(2) Set "PLC" (Connection model) in the property window of "AxDBCommManager1".


Select "KV-5500/5000/3000".
"PLC"(4-19 page)

- KV COM+ Library User’s Manual - 2-29


2-2 Program Creation on Visual Studio
Programming Technique

(3) Click "Property page" button in the property window of "AxDBCommManager1". "Property"
dialog box comes up.

(4) Click "Setup" button to display "Communication setting" dialog box.


2
Program Creation on Visual Studio

(5) Set communication setting. Select "USB" here.


"Comm Settings"(3-3 page)

(6) To edit the configuration of the form, select "View (V)" -> "Code (C)" from the menu.
Other procedure
Double-click the form to open the code window.

(7) Write the following code in "Form_Load" procedure.


Details: To start communication with the connected device while running the program.
"Connect"(4-26 page)

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _


Handles MyBase.Load
AxDBCommManager1.Connect() ' Start communication.
End Sub

2-30 - KV COM+ Library User’s Manual -


2-2 Program Creation on Visual Studio

Programming Technique
3 Allocate AxDBTriggerManager Class control.

(1) Allocate AxDBTriggerManager Class control on a form of the project and select the control to
create "AxDBTriggerManager1".

Program Creation on Visual Studio


(2) Click "Property page" button on the property window of "AxDBTriggerManager1"."Property"
dialog box comes up..

(3) Click "Add" button to display "Trigger setting" dialog box.

(4) Set a trigger as shown below and click "Finish" button.


"Trigger setting for period"(3-10 page)

→ →

(5) Click "Add" button to display "Trigger setting" dialog box.

(6) Set a trigger as shown below and click "Finish" button.


"Set any trigger"(3-20 page)

- KV COM+ Library User’s Manual - 2-31


2-2 Program Creation on Visual Studio
Programming Technique

→ →

"Trigger setting" dialog box is closed and go back to "Property" dialog box. The trigger is displayed in
2 the list.
Program Creation on Visual Studio

(7) Click "Close" button to close "Property" dialog box.


(8) Write the following code in "Form_Load" procedure.
Details: To enable trigger while running the program.
「DBCommManager.Active」(4-24 page)

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _


Handles MyBase.Load
AxDBCommManager1.Connect() ' Start communication.
AxDBTriggerManager1.Active = True ' Enable trigger.
End Sub

2-32 - KV COM+ Library User’s Manual -


2-2 Program Creation on Visual Studio

Programming Technique
4 Allocate the first AxDBDeviceManager Class control.

(1) Allocate AxDBDeviceManager Class control on a form of the project and select the control to
create "AxDBDeviceManager1".

Program Creation on Visual Studio


(2) Click "Property page" button on the property window of "AxDBDeviceManager1". "Property"
dialog box comes up.

(3) Select communication management object (DBCommManager) to refer to "Communication


Target" list. Select "AxDBCommManager1" here.

(4) Click "Device" tab.

(5) Click "Add" button. "Device setting" dialog box comes up.

(6) Set values as shown below and click "OK" button.

Point Specify data memory for word processing.

- KV COM+ Library User’s Manual - 2-33


2-2 Program Creation on Visual Studio
Programming Technique

"Device setting" dialog box is closed and the device is added to the list on the "Property" dialog box.

2
Program Creation on Visual Studio

(7) Click "Trigger" tab.

(8) Select trigger setting at the time of reading from "Read Trigger" list. Select
"AxDBTriggerManager1.Trigger2" here.

(9) Click "Close" button to close "Property" dialog box.

5 Allocate TextBox control.

(1) Allocte TextBox control on a form of the project to create "TextBox1".

(2) Right-click "TextBox1" to display the short cut menu.


(3) Select and click "Copy".

(4) Right-click the arbitrary point on the form to display the short cut menu.

2-34 - KV COM+ Library User’s Manual -


2-2 Program Creation on Visual Studio

Programming Technique
(5) Select and click "Paste".

Program Creation on Visual Studio


(6) Click "Yes" button to create "TextBox2".
(7) Repeat the procedure from 4 to 6 to create "TextBox3" and "TextBox4".

6 Allocate Label control.

(1) Allocate Label control on the form and change “Text” to “DM0”, “DM1”, “DM2”, “DM3”.

(2) Write the following code in "AxDBDeviceManager1_AfterRead" procedure.


Details: To display device values read from PLC in the text box.
"AfterRead"(4-59 page)
"ValueRead"(4-75 page)

Private Sub AxDBDeviceManager1_AfterRead(ByVal sender As Object, ByVal e As System.EventArgs) _


Handles AxDBDeviceManager1.AfterRead
TextBox1.Text = AxDBDeviceManager1.Devices(1).ValueRead
TextBox2.Text = AxDBDeviceManager1.Devices(2).ValueRead
TextBox3.Text = AxDBDeviceManager1.Devices(3).ValueRead
TextBox4.Text = AxDBDeviceManager1.Devices(4).ValueRead
End Sub

- KV COM+ Library User’s Manual - 2-35


2-2 Program Creation on Visual Studio
Programming Technique

7 Allocate the second AxDBDeviceManager Class control.

(1) Allocate AxDBDeviceManager Class control on a form of the project and select the control to
create "AxDBDeviceManager2".

2
Program Creation on Visual Studio

(2) Click "Property page" button on the property window of "AxDBDeviceManager2" to display
"Property" dialog box.

(3) Select communication management object (DBCommManager) to refer to "Communication


Target" list.
Select "AxDBCommManager1" here.

(4) Click "Device" tab.

(5) Click "Add" button to display "Device setting" dialog box.

(6) Set values as shown below and click "OK" button.

2-36 - KV COM+ Library User’s Manual -


2-2 Program Creation on Visual Studio

Programming Technique
"Device setting" dialog box is closed and the device is added to the list on "Property" dialog box.

2
(7) Double-click "Trigger" tab.

Program Creation on Visual Studio


(8) Select a read trigger from "Read Trigger" list.
Select "AxDBTriggerManager1.Trigger1" here.

(9) Click "Close" button to close "Property" dialog box.


(10) Write the following code in "AxDBDeviceManager2_AfterRead" procedure.
Details: When the device value read from PLC is ON, set custom trigger ON.
"SetState"(4-120 page)

Private Sub DBDeviceManager2_AfterRead(ByVal sender As Object, ByVal e As System.EventArgs) _


Handles AxDBDeviceManager2.AfterRead
If AxDBDeviceManager2.Devices(1).ValueRead = 1 Then
AxDBTriggerManager1.Triggers(2).AsCustom.SetState(True)
End If
End Sub

 Code
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _
MyBase.Load
AxDBCommManager1.Connect() ' Start communication.
AxDBTriggerManager1.Active = True ' Enable trigger.
End Sub

Private Sub AxDBDeviceManager1_AfterRead(ByVal sender As Object, ByVal e As System.EventArgs) _


Handles AxDBDeviceManager1.AfterRead
TextBox1.Text = AxDBDeviceManager1.Devices(1).ValueRead
TextBox2.Text = AxDBDeviceManager1.Devices(2).ValueRead
TextBox3.Text = AxDBDeviceManager1.Devices(3).ValueRead
TextBox4.Text = AxDBDeviceManager1.Devices(4).ValueRead
End Sub

Private Sub DBDeviceManager2_AfterRead(ByVal sender As Object, ByVal e As System.EventArgs) _


Handles AxDBDeviceManager2.AfterRead
If AxDBDeviceManager2.Devices(1).ValueRead = 1 Then
AxDBTriggerManager1.Triggers(2).AsCustom.SetState(True)
End If
End Sub

- KV COM+ Library User’s Manual - 2-37


2-2 Program Creation on Visual Studio
Programming Technique

Use of KV COM+ Library (When Using Visual C++)

This section describes the procedures to make KV COM+ Library available on Visual C++.

1 Start up Visual C++.

2 2 Select "File (F)" -> "New project (P)" from the menu bar. "New project" dialog box comes up.
Program Creation on Visual Studio

3 Select "Windows Form Application" and click "OK" button to Create a new project.

4 Select "View (V)" -> "Toolbox (X)" to display "Toolbox window".

2-38 - KV COM+ Library User’s Manual -


2-2 Program Creation on Visual Studio

Programming Technique
Right-click component of Toolbox window and select "Choose item (I)". "Selection of toolbox item"
dialog box comes up.

Program Creation on Visual Studio


5 Select "COM component" tab to display "Browse" dialog box.

6 Check the following items from COM component as necessary and click "OK" button.

• DBCommManager Class (Library)


• DBDeviceManager Class (Library)
• DBTriggerManager Class (Library)
• DBRTLoggingManager Class (Library)
• DBCommandButton Control (Library)
• DBBarMeter Control (Library)
• DBFanMeter Control (Library)

When items are successfully added, component is shown in the toolbox window.

7 Select control of KV COM+ Library to be used.

- KV COM+ Library User’s Manual - 2-39


2-2 Program Creation on Visual Studio
Programming Technique

8 Drag the control on the form to create control of KV COM+ Library.

2
Program Creation on Visual Studio

Point Visual C++ does not enable you to associate property connection targets and triggers. Use
code to set an association.

//Associate DBCommManager1 with DBDeviceManager1


IUnknown* pUnk = DBCommManager1.GetControlUnknown();
LPDISPATCH pCommManager = NULL;
pUnk->QueryInterface(IID_IDispatch, (void**)&pCommManager);
DBDeviceManager1.putref_CommManager(pCommManager);

2-40 - KV COM+ Library User’s Manual -


2-3 Use of KV COM+ Library on Excel

Programming Technique
This section describes how to use KV COM+ Library on Excel.

Use on a Worksheet

This section describes the procedure to make KV COM+ Library available on a worksheet of Excel.

1 Start up Microsoft Excel. 2

Use of KV COM+ Library on Excel


2 Select "Developer" -> "Insert" from the menu bar to display control toolbox.

3 Click "Select control" button ( ) to display the control list.

- KV COM+ Library User’s Manual - 2-41


2-3 Use of KV COM+ Library on Excel
Programming Technique

4 Select control of KV COM+ Library to be used and click "OK" button.

2
Use of KV COM+ Library on Excel

5 Drag the control on the sheet. The control of KV COM+ Library is created as shown below.

2-42 - KV COM+ Library User’s Manual -


2-3 Use of KV COM+ Library on Excel

Programming Technique
Use on User Form

This section describes the procedure to make KV COM+ Library available on a user form of Excel.

1 Start up Microsoft Excel.

2 Select "Developer" -> "Visual Basic" from the menu bar to open Microsoft Visual Basic Editor. 2

Use of KV COM+ Library on Excel


3 Select "Insert (I)" -> "User form (U)" from the menu bar to create a user form.

4 Select "Tool (T)" -> "Other control (A)" from the menu bar.
Other procedure
Right-click a toolbox and select "Additional control (A)" to display "Additional control" dialog box.

5 Check “DBCommManager Class”, “DBDeviceManager Class”, “DBRTLoggingManager Class”,


“DBTriggerManager Class”, “DBCommandButton Control”, “DBBarMeter Control” and
“DBFanMeter Control”.

- KV COM+ Library User’s Manual - 2-43


2-3 Use of KV COM+ Library on Excel
Programming Technique

6 Click “OK” button to add control of KV COM+ Library of “DBCommManager Class”,


“DBDeviceManager Class”, “DBRTLoggingManager Class”, “DBTriggerManager Class”,
“DBCommandButton Control”, “DBBarMeter Control”, “DBFanMeter Control" in the toolbox.

7 Click an icon for control of KV COM+ Library to be used.

2
Use of KV COM+ Library on Excel

8 Drag the control on the form to create control of KV COM+ Library on the form.

2-44 - KV COM+ Library User’s Manual -


2-4 Use of KV COM+ Library on Access

Programming Technique
This section describes how to use KV COM+ Library on Microsoft Access.
This section describes the procedure to make KV COM+ Library available on user form of Access.

1 Start up Microsoft Access.

2 Select "Design" -> "ActiveX control" from the menu bar to display "Insert ActiveX control"
2
dialog box.

Use of KV COM+ Library on Access


3 Select control of KV COM+ Library to be used and click "OK" button to create control of KV
COM+ Library on the form.

Access does not enable you to associate property connection targets and triggers. Use VBA code to
set an association.

'Example of association with CommManager of DBCommManager


Set DBDeviceManager1.CommManager = DBCommManager0.Object

- KV COM+ Library User’s Manual - 2-45


2-4 Use of KV COM+ Library on Access
Programming Technique

MEMO

2
Use of KV COM+ Library on Access

2-46 - KV COM+ Library User’s Manual -


3

Property Page Setting Method


Property Page Setting
Method 3

The chapter includes how to set property pages.


Set value of property can be easily set on property pages.

3-1 DBCommManager Control. . . . . . . . . . . . . . . . . . . . . .3-2


3-2 DBTriggerManager Control . . . . . . . . . . . . . . . . . . . . .3-8
3-3 DBDeviceManager Control . . . . . . . . . . . . . . . . . . . .3-22
3-4 DBRTLoggingManager Control . . . . . . . . . . . . . . . . .3-31
3-5 DBCommandButton Control . . . . . . . . . . . . . . . . . . .3-42
3-6 DBBarMeter Control . . . . . . . . . . . . . . . . . . . . . . . . . .3-44
3-7 DBFanMeter Control. . . . . . . . . . . . . . . . . . . . . . . . . .3-49

- KV COM+ Library User’s Manual - 3-1


3-1 DBCommManager Control
Property Page Setting Method

This section describes how to set the property page of DBCommManager control. The communication
with device to be connected is set in this section.

Communication setting is displayed. "Settings" button


"Communication setting" dialog box
is displayed. Connection method is
selected from serial, Ethernet,
Bluetooth, routing setting, USB for
specific communication setting.

3
DBCommManager Control

"Apply" button
Determines "Communication
setting".
"OK" button "Cancel" button
Determines "Communication Closes the dialog box without determining
setting" and closes the dialog box. "Communication setting".

Reference The following property can be set on the property page of DBCommManager object.

DBCommManager object
Property name Reference page
Peer 4-21

Point Set connection model setting (PLC property) in the "Property" window of
DBCommManager object.
"PLC"(4-19 page)

Reference When changing connection model with already set device existing, the device is
automatically changed to the model after the setting.

"Model Change"(A-9 page)

3-2 - KV COM+ Library User’s Manual -


3-1 DBCommManager Control

Property Page Setting Method


Comm Settings

This section describes how to operate "Comm settings" dialog box.

1 Click "Setup" button on "Property page" dialog box to display "Comm settings" dialog box.

2 Select a "PC comm port" from "USB", "Serial", "Ethernet", "Bluetooth".


Selected communication setting is displayed in the lower part of the dialog box.

DBCommManager Control
Point "Modem" mode cannot be used.

3 Configure "Communication setting".


When "Serial" is selected, items shown below are displayed in the communication setting area.
(To use KV-5500/5000, serial communication unit is required.)

- KV COM+ Library User’s Manual - 3-3


3-1 DBCommManager Control
Property Page Setting Method

Item Description
Selects a COM port for the connection cable. The default is "COM1". COM port is a
COM port serial port; communication is through RS-232C interface. The COM port Nos. are
displayed according to the PC model.
Selects baud rate. The selection range and default values for baud rate are shown
as follows.

Model Selection range Default


Baud rate
KV-5500*、KV-5000* 9600、19200、38400、57600、 115200
3 KV-3000、KV-1000
KV-700
115200
9600、19200、38400、57600 57600
DBCommManager Control

Unit No. “Unit No.” setting dialog box comes up when “Unit No.” setting button is clicked.

* Serial communication unit KV- L20V is required to connect KV-5500/5000 by serial connection.

• Unit No. setting


With KV STUDIO, you can specify multiple KV-L20V/R station Nos. in multi-station configuration; with
1 PC, you can transfer a ladder program to multiple KV-5500/3000/1000/700 PLCs and to monitor.

When selecting "Ethernet"


(Connecting KV-3000/1000/700 using Ethernet requires KV-LE21V/KV-LE20V/KV-EP21V separately.)

Item Description
IP Address Enters the IP address for connecting KV-5500/5000/3000/1000/700 PLC.
(Search destination) Searches for the KV-5500/5000/3000/1000/700 connected to Ethernet.
Port No. Enters the port No. for connecting KV-5500/5000/3000/1000/700 PLC.
Sends a Ping instruction to the port No. to which an IP address has been
(Connection test)
entered, and tests the connection status.

When selecting "USB"


Communication setting is not required.

3-4 - KV COM+ Library User’s Manual -


3-1 DBCommManager Control

Property Page Setting Method


When selecting "Bluetooth"

DBCommManager Control
Item Description
Enters identification name set to KV-BT1 of connection destination. Able to
register by connection destination search. Identification name is "(PLC
Identification name
name)(single-byte space)(identification name set by unit editor)".
Identification name can be also checked at the access window of PLC.
Enters BD address of KV-BT1 of connection destination. Able to register by
BD Address connection destination search. BD address can be also checked at the
access window of PLC.
Enters the passkey placed in KV-BT1 of connection destination.
Passkey
(Default value: 0000)
"Connection destination Displays "Connection destination search" dialog box. Executes search to
search" find connectable KV-BT1.
COM port No. Bluetooth adapter uses. Manual input of the port No. is
Port No.
possible.
Serial port manual Specifies COM port No. for Bluetooth communication when the checkbox is
allocation on.

- KV COM+ Library User’s Manual - 3-5


3-1 DBCommManager Control
Property Page Setting Method

• Routing setting

3
DBCommManager Control

Item Description
Communication destination Selects the PLC model to be routed to PC.
via VT/DT (2-port) Checks when VT/DT routing (2-port function) is used.
VT/DT model Selects the model to be routed.
Connection to KV Selects the model to be routed and PLC connection method.
Checks when connected through network routing and selects FL-net,
via network
EtherNet/IP.
Routing unit select Selects the unit to be routed.
(When selecting FL-net through network routing)
Communication destination
Specifies the node No. of connection equipment (KV-5000 or KV-
node No.
FL20V) to be routed.
(When selecting EtherNet/IP through network routing)
Communication destination
Specifies IP address of connection equipment (KV-5500 or KV-EP21V)
IP address
to be routed.
Communication route Displays the connection state of PLC connected to PC.
Selects the method of communication for the directly connected
(Communication method)
equipment to be routed to PC.
Tests the state of PLC and PC connection under current setting. If
"Connection test" connection fails, verify communication setting and cable connection
status.

4 Click "OK" button on "Communication setting" dialog box to complete setting.


Setting details is displayed in "Property" dialog box.

When checking "Connect to KV STUDIO simulator mode", communication with KV STUDIO starts.

3-6 - KV COM+ Library User’s Manual -


3-1 DBCommManager Control

Property Page Setting Method


5 Click "OK" button on "Property page" dialog box to change set value of property.

Reference KV COM+ Library and KV STUDIO are able to communicate simultaneously.


Operation on both KV STUDIO and KV COM+ Library is possible with a communication
cable such as USB cable because communication route is the same as PLC.
3

DBCommManager Control
KV STUDIO Communication COM server

PC
USB PLC

KV COM+

- KV COM+ Library User’s Manual - 3-7


3-2 DBTriggerManager Control
Property Page Setting Method

This section describes how to set the property page of DBTriggerManager control. A trigger that the
determines timing of each behavior is set in this section.

"Name" "Type" "Comments"


Displays trigger Displays trigger setting Displays trigger setting
setting name. type. comments.

"Add" button
Adds trigger setting.

3 Trigger list
Displays trigger
"Change" button
Changes selected trigger
setting. setting.
DBTriggerManager Control

"Delete" button
Deletes selected trigger
setting.

"OK" button "Apply" button


Saves the setting and "Cancel" button Determines "Trigger setting".
closes the dialog box. Closes dialog box without
determining "Trigger setting".
Reference The following property can be set on the property page of DBTriggerManager control.
DBTrigger object DBTriggerParamTimeAt object
Property name Reference page Property name Reference page
Name 4-93 Year 4-106
Type 4-94 Month 4-107
Description 4-95 Day 4-108
Param 4-97 Hour 4-109
AsInterval 4-98 Minute 4-110
AsTimeAt 4-99 Second 4-111
AsTimeSpan 4-100 DayOfWeek 4-112
AsLogical 4-101 Edge 4-113
AsCustom 4-102
AsDevice 4-103
DBTriggerParamInterval object DBTriggerParamTimeSpan object
Property name Reference page Property name Reference page
IntervalMSec 4-105 TimeFrom 4-114
TimeTo 4-115
DBTriggerParamCustom object DBTriggerParamLogical object
Property name Reference page Property name Reference page
OneShot 4-119 Type 4-116
Trigger1 4-117
Trigger2 4-118
DBTriggerParamDevice object
Property name Reference page
CommManager 4-121
DeviceKind 4-122
DeviceNo 4-123
DeviceCondition 4-124
TriggerBitReset 4-125
ErrorConnect 4-126

3-8 - KV COM+ Library User’s Manual -


3-2 DBTriggerManager Control

Property Page Setting Method


Addition of Trigger Setting

This section describes how to add trigger setting.

1 Click "Add" button on "Property" dialog box to display "Trigger setting" dialog box.

2 Click to select trigger type.

DBTriggerManager Control
• To set a trigger for period
"Trigger setting for period"(3-10 page)
• To set a trigger for time and time range
"Trigger Setting at time and time range"(3-11 page)
• To set a trigger for device
"Trigger Setting for device"(3-15 page)
• To set a trigger by combining already set trigger
"Trigger Setting to combine into already set trigger"(3-18 page)
• To set a random trigger
"Set any trigger"(3-20 page)

- KV COM+ Library User’s Manual - 3-9


3-2 DBTriggerManager Control
Property Page Setting Method

 Trigger setting for period


Executes a function once at every set time.

Example
To set a trigger at 100 milliseconds
Trigger ON

Trigger OFF
100 milliseconds 100 milliseconds 100 milliseconds

3 Starts communication

1
DBTriggerManager Control

Select "Period" from "Type" box.

2 Click "Next" button to proceed to the next step.

3 Input values in "Period" box.


Values from 0 to 2147483647 milliseconds can be set.
Reference Setting at 0 milliseconds results in a trigger occurs continuously.

4 Click "Next" button to proceed to the next step.

5 Enter "Name" and "Comment" as necessary.

6 Click "Finish" button.

3-10 - KV COM+ Library User’s Manual -


3-2 DBTriggerManager Control

Property Page Setting Method


 Trigger Setting at time and time range
Executes a function at every specified time or within the time range.

Time/ ↑ (Edge)
Executes a function once at every set time for each condition.

Example
To set a trigger at 12:30 (*Conditions for other items are ignored.)
Trigger ON

Trigger OFF
12:30
3

DBTriggerManager Control
Time/ ON (Level)
Executes a function continuously during the set time for each condition.

Example
To set a trigger at 12:30 (*Setting for other items are "Ignore conditions")
Trigger ON

Trigger OFF
12:30 12:31

Trigger occurs at 12:30 every day and continues for one minute.

Example
To set a trigger at 30 seconds (*Setting for other items are "Ignore conditions".)
Trigger ON

Trigger OFF
30 seconds 31 seconds 30 seconds 31 seconds

Trigger occurs at every 30 seconds and continues for one second..

Time range
Executes a function during the set time range.

Example
To set a trigger the time range from 9:00 to 17:00
Trigger ON

Trigger OFF
9:00 17:00

Point Use with other single trigger because PC becomes overloaded with continuous triggers
which occurs when time ON (level) and time range triggers are set separately for each
function.
"Trigger Setting to combine into already set trigger"(3-18 page)

- KV COM+ Library User’s Manual - 3-11


3-2 DBTriggerManager Control
Property Page Setting Method

Setting procedures

1 Select "Time" from "Type".

2 Click "Next" button to proceed to the next step.

3
DBTriggerManager Control

3 Select "Time" or "Time range" from "Type" drop-down list. The display changes according to
the selection.

3-12 - KV COM+ Library User’s Manual -


3-2 DBTriggerManager Control

Property Page Setting Method


4 Set each item.
Time

"Condition"
Selects trigger occurrence conditions.

"Up (Edge)"
Trigger occurs once every set time for each
condition.
"ON (Level)"

3
Trigger occurs continuously during the set time
for each condition.

"Ignore"

DBTriggerManager Control
Check to ignore items at the left of each check
box.

Sets time for trigger ON.

Example
To make a trigger occur at 15 min. To make triggers occur once at 12 o'clock
for 1 min. on week days.

- KV COM+ Library User’s Manual - 3-13


3-2 DBTriggerManager Control
Property Page Setting Method

Time range

Sets time range for trigger ON.

3
DBTriggerManager Control

Example
Setting for a continuous trigger from 9:00:00 to 17:00:00

Reference Time range including 24 o’clock (0:00 AM) such as 23:00:00~3:00:00 can be set.

5 Click "Next" button to proceed to the next step.

6 Enter "Name" and "Comment" as necessary.

7 Click "Finish" button.

3-14 - KV COM+ Library User’s Manual -


3-2 DBTriggerManager Control

Property Page Setting Method


Device Specification

 Trigger Setting for device


Executes any functions by trigger according to the conditions of specified device.

1 Click and select "Device" at "Type".

2 Click "Next" button to display the next setting dialog box. 3

DBTriggerManager Control
3 Select "Communication Target" and "Target Device".

Reference Only bit device (or bit-data compliant word device) can be selected.

4 Select "Condition".

↑ (Rising edge)
When the condition of specified device changes from OFF to ON, trigger occurs.

Device ON

Device OFF

Trigger ON

Trigger OFF
Trigger occurs. Trigger occurs.

Reference Since trigger bit changes when detecting trigger by resetting trigger bit, detection of
trigger can be confirmed on the side of PLC.
"↑" …When detecting trigger, trigger bit becomes OFF.
"↓" …When detecting trigger, trigger bit becomes ON.

- KV COM+ Library User’s Manual - 3-15


3-2 DBTriggerManager Control
Property Page Setting Method

↓ (Falling edge)
When the condition of specified bit device changes from ON to OFF, trigger occurs.

Device ON

Device OFF

Trigger ON

3 Trigger OFF
Trigger occurs. Trigger occurs.
DBTriggerManager Control

↑↓ (Both edges)
When the condition of specified bit device changes from OFF to ON or from ON to OFF,
trigger occurs.

Device ON

Device OFF

Trigger ON

Trigger OFF
Trigger occurs. Trigger occurs. Trigger occurs. Trigger occurs.

ON (Level)
Trigger occurs continuously while the condition of the specified bit device is ON.

Device ON

Device OFF

Trigger ON

Trigger OFF

OFF (Level)
Trigger occurs continuously while the condition of the specified bit device is OFF

Device ON

Device OFF

Trigger ON

Trigger OFF

3-16 - KV COM+ Library User’s Manual -


3-2 DBTriggerManager Control

Property Page Setting Method


5 Click "Next" button to display the next setting dialog box.

6 Enter characters in "Name" and "Comment" as necessary.

DBTriggerManager Control
7 Click "Finish" button.

- KV COM+ Library User’s Manual - 3-17


3-2 DBTriggerManager Control
Property Page Setting Method

 Trigger Setting to combine into already set trigger

Point Set triggers to be used beforehand.

1 Select "Combination" from "Type".

2 Click "Next" button to proceed to the next step.

3
DBTriggerManager Control

3 Select "Type" of combination

Setting
Description
name
AND Trigger occurs when both trigger conditions set for "Target 1" and "Target 2" are ON.
Trigger occurs when either or both of trigger conditions set for "Target 1" and "Target 2" are
OR
ON.
NOT Trigger occurs when trigger conditions set for "Target 1" is ON.

3-18 - KV COM+ Library User’s Manual -


3-2 DBTriggerManager Control

Property Page Setting Method


4 Select trigger conditions for "Target 1" and "Target 2" from each drop-down list.

5 Click "Next" button to proceed to the next step.

DBTriggerManager Control
6 Enter "Name" and "Comment" as necessary.

7 Click "Finish" button.

- KV COM+ Library User’s Manual - 3-19


3-2 DBTriggerManager Control
Property Page Setting Method

 Set any trigger


1 Click and select "Any" at "Type".
With the use of any trigger, user can set trigger that occurs at any timing by utilizing SetState method.

2 Click "Next" button to display the next setting dialog box.

3
DBTriggerManager Control

3 Set "Do OneShot".


When checking: When set SetState method to True and Trigger to ON, trigger becomes OFF
automatically. The use is recommended when making trigger occur at edge.
When not checking: Trigger does not become OFF automatically. To make trigger OFF, SetState
method needs to be made False. The use is recommended when making
trigger occur at level.
"SetState"(4-120 page)
4 Click "Next" button to display the next setting dialog box.

5 Enter characters in "Name" and "Comment" as necessary.

6 Click "Finish" button.

3-20 - KV COM+ Library User’s Manual -


3-2 DBTriggerManager Control

Property Page Setting Method


Change of Trigger Setting

This section describes how to change trigger setting.

1 Select trigger setting to be changed.

2 Click "Change" button to display "Trigger setting" dialog box.

3 Change trigger setting in the same way described in "Addition of Trigger Setting"(3-9 3
page).

DBTriggerManager Control
Deletion of Trigger Setting

This section describes how to delete trigger setting.

1 Select trigger setting to be deleted.

2 Click "Delete" button.


Message to confirm deletion is displayed.

3 Click "OK" button.

- KV COM+ Library User’s Manual - 3-21


3-3 DBDeviceManager Control
Property Page Setting Method

This section describes how to set the property page of DBDeviceManager control. After selecting
DBCommManager to refer, device is registered in this section. Trigger for read and write can be also
selected.

"Communication manager "Device" tab


object" tab Sets device.
Selects DBCommManager "Trigger" tab
control to refer. Selects read triggers and
write triggers.
3
DBDeviceManager Control

"Apply" button
Applies the setting.
"OK" button
"Cancel" button
Saves the setting and closes
Closes the dialog box without
the dialog box.
saving the setting.

Reference The following property can be set on the property page of DBDeviceManager control.
DBDeviceManager object
Property name Reference page
CommManager 4-50
TriggerRead 4-52
TriggerWrite 4-53

DBDevices object
Property name Reference page
Count 4-63
Item 4-64

DBDevice object
Property name Reference page
Kind 4-73
No 4-74
Name 4-74

3-22 - KV COM+ Library User’s Manual -


3-3 DBDeviceManager Control

Property Page Setting Method


Communication manager Object

This section describes how to operate the dialog box of "Communication manager object".

Point Allocate DBCommManager control on the same form beforehand.


"3-1 DBCommManager Control"(3-2 page)

1 Click "Commanagement object" tab to display "Communication manager" dialog box.


3

DBDeviceManager Control
"Target"
Selects DBCommManager control of Target.

2 Select DBCommManager control for "Target".


Reference Changes in connection model to already set device are automatically reflected to the
setting.
"Model Change"(A-9 page)

Point Specify controls on the CommManager property of DBDeviceManager object when


DBCommManager is allocated using control array. Each controls allocated using control
array are not distinguished in selection.
"CommManager"(4-50 page)

- KV COM+ Library User’s Manual - 3-23


3-3 DBDeviceManager Control
Property Page Setting Method

Device

This section describes how to operate "Device" dialog box.

1 Click "Device" tab to display "Device" dialog box.

"Add" button
Adds devices.

3 Device list
Displays a device
"Modify" button
Changes the selected device
list.
DBDeviceManager Control

"Delete" button
Deletes the selected device.

"All Delete" button


Deletes all devices.

• To add devices
"Addition of device"(3-25 page)
• To change selected device
"Change of device"(3-27 page)
• To delete selected device
"Deletion of device"(3-28 page)
• To delete all devices
"Deletion of all devices"(3-28 page)

3-24 - KV COM+ Library User’s Manual -


3-3 DBDeviceManager Control

Property Page Setting Method


 Addition of device

Point Select com management object (DBCommManager) to refer before adding devices.
"3-1 DBCommManager Control"(3-2 page)

1 Click "Add" button on "Device" dialog box to display "Device setting" dialog box.

DBDeviceManager Control
Device Device No.
Selects device type. Inputs device No.
Data count
Inputs quantity of devices to
be created with serial
numbers beginning from
the input device No.
Description
Displays description for
each device.

"OK" button "Cancel" button


Saves the "Device setting" and Closes dialog box without saving the "Device
closes dialog box. setting".

2 Select "Device" from the drop-down menu.


"Device List"(A-4 page)

3 Input device number within input range presented in "Description".

4 Input "Data count".

- KV COM+ Library User’s Manual - 3-25


3-3 DBDeviceManager Control
Property Page Setting Method

5 Click "OK" button.


The same number of devices input in the "Data count" are shown with serial numbers starting from the
device Nos.

3
DBDeviceManager Control

3-26 - KV COM+ Library User’s Manual -


3-3 DBDeviceManager Control

Property Page Setting Method


 Change of device
1 Click to select device to be changed from the device list.

2 Click "Modify" button to display "Device setting" dialog box.

DBDeviceManager Control
Device Device No.
Selects device type. Inputs device No.

Data count
Cannot enter the quantity
when changing.

Description
Displays description of
each device.

"OK" button "Cancel" button


Saves the "Device setting" and Closes dialog box without saving the "Device
closes dialog box. setting".

3 Select "Device".

4 Input device No. within the range presented in "Description".

5 Click "OK" button to save device setting change.

- KV COM+ Library User’s Manual - 3-27


3-3 DBDeviceManager Control
Property Page Setting Method

 Deletion of device
1 Click a device to be deleted from the device list.

3
DBDeviceManager Control

2 Click "Delete" button.


A message to confirm the deletion is displayed.

3 Click "OK" button to delete the selected device.

 Deletion of all devices


1 Click "All Delete" button.
A message to confirm the deletion is displayed.

2 Click "OK" button to delete all devices.

3-28 - KV COM+ Library User’s Manual -


3-3 DBDeviceManager Control

Property Page Setting Method


Trigger

This section describes how to operate "Trigger" dialog box.

Point Allocate DBTriggerManager control on the same form and configure for triggers
beforehand.
"3-2 DBTriggerManager Control"(3-8 page)

1 Click "Trigger" tab to display "Trigger" dialog box. 3

DBDeviceManager Control
Read trigger
Selects a trigger setting for reading
data.
Sets triggers on the property page of
DBTriggerManager control.

Write trigger
Selects a trigger setting for writing
data.
Sets triggers on the property page of
DBTriggerManager control.

2 Select a trigger to read data at "Read trigger".

- KV COM+ Library User’s Manual - 3-29


3-3 DBDeviceManager Control
Property Page Setting Method

3 Select a trigger to write data at "Write trigger".

3
DBDeviceManager Control

3-30 - KV COM+ Library User’s Manual -


3-4 DBRTLoggingManager Control

Property Page Setting Method


This section describes how to set the property page of DBRTLoggingManager control.
After selecting DBRTLoggingManager to refer, device is registered in this section. Start trigger and a
stop trigger for logging/trace can also be selected.

"PLC trigger" tab


"Device" tab Sets trigger conditions.
Sets device.
"Communication "Trigger" tab
manager object" tab Selects start trigger and stop
Selects DBCommManager
control to refer.
trigger for logging/trace. 3

DBRTLoggingManager Control
"Apply" button
Applies the setting.
"Cancel" button
"OK" button Closes the dialog box without saving the setting.
Saves the setting and closes the dialog box.

Reference The following property can be set on the property page of DBRTLoggingManager control

Property name Reference page


CommManager 4-130
Devices 4-132
TriggerStart 4-133
TriggerStop 4-134
SamplingCycle 4-135
LastID 4-136
TopID 4-137
TriggerID 4-138
LoggingDataCollection 4-139
TriggerDataRatio 4-140
TrgParamBitEnable 4-141
TrgParamBitIndex 4-142
TrgParamBitOn 4-143
TrgParamBitLogicOperator 4-144
TrgParamWordLogicOperator 4-145
TrgParamWordEnable 4-146
TrgParamWordIndex 4-147
TrgParamWordCmpOperator 4-148
TrgParamWordCmpValue 4-149

- KV COM+ Library User’s Manual - 3-31


3-4 DBRTLoggingManager Control
Property Page Setting Method

Commanagement Object

This section describes how to operate the dialog box of "Commanagement object".

Point Allocate DBCommManager control on the same form beforehand.


"3-1 DBCommManager Control"(3-2 page)

1 Click "Communication manager object" tab to display "Commanagement object" dialog box.
3
DBRTLoggingManager Control

"Target"
Selects DBCommManager control of Target.

2 Select DBCommManager control for "Target".


Reference Changes in connection target to already set device are automatically reflected to the
setting.
"Model Change"(A-9 page)

Point Specify controls on the CommManager property of DBLoggingManager object when


DBCommManager is allocated using control array. Each control allocated using control
array is not distinguished in selection.
"CommManager"(4-130 page)

3-32 - KV COM+ Library User’s Manual -


3-4 DBRTLoggingManager Control

Property Page Setting Method


Device

This section describes how to operate "Device" dialog box.

1 Click "Device" tab to display "Device" dialog box.

"Add" button
Adds devices.

Device list
Displays device
"Modify" button
Changes the selected 3
list. device.

DBRTLoggingManager Control
"Delete" button
Deletes the selected
device.

"All Delete" button


Deletes all devices.

• To add devices
"Addition of device"(3-25 page)
• To change selected device
"Change of device"(3-27 page)
• To delete selected device
"Deletion of device"(3-28 page)
• To delete all devices
"Deletion of all devices"(3-28 page)

- KV COM+ Library User’s Manual - 3-33


3-4 DBRTLoggingManager Control
Property Page Setting Method

 Addition of device

Point Select Communication manager object to add in this process before adding devices.
"3-1 DBCommManager Control"(3-2 page)

1 Click "Add" button on "Device" dialog box to display "Device setting" dialog box.

3
DBRTLoggingManager Control

Device Device No.


Selects device type. Inputs device No.
Data count
Inputs quantity of devices to
be created with serial
number beginning the input
device No.
Description
Displays description of
each device.

"OK" button "Cancel" button


Saves the "Device setting" and Closes dialog box without saving the "Device
closes dialog box. setting".

2 Select "Device" from the drop-down menu.


"Device List"(A-4 page)

3 Input device No. within the range displayed in "Description".

4 Input values in "Data count" box.

3-34 - KV COM+ Library User’s Manual -


3-4 DBRTLoggingManager Control

Property Page Setting Method


5 Click "OK" button.
The same number of devices as the value inputted in created quantity box are created having serial
number starting from the inputted device No.

DBRTLoggingManager Control

- KV COM+ Library User’s Manual - 3-35


3-4 DBRTLoggingManager Control
Property Page Setting Method

 Change of device
1 Click device to be changed from the device list.

2 Click "Modify" button to display "Device setting" dialog box.

3
DBRTLoggingManager Control

Device Device No.


Selects device type. Inputs device No.

Data count
Not able to enter the
quantity for changing.

Description
Displays description of
each device.

"OK" button "Cancel" button


Saves the "Device setting" and Closes dialog box without saving the "Device
closes dialog box. setting".

3 Select "Device" from the drop-down menu.

4 Input device No. within the range displayed in "Description".

5 Click "OK" button to save device setting change.

3-36 - KV COM+ Library User’s Manual -


3-4 DBRTLoggingManager Control

Property Page Setting Method


 Deletion of device
1 Click device to be deleted from the device list.

DBRTLoggingManager Control
2 Click "Delete" button.
A message to confirm the deletion is displayed.

3 Click "OK" button to delete the selected device.

 Deletion of all devices


1 Click "All Delete" button.
A message to confirm the deletion is displayed.

2 Click "OK" button to delete all devices.

- KV COM+ Library User’s Manual - 3-37


3-4 DBRTLoggingManager Control
Property Page Setting Method

PLC Trigger

This section describes how to operate "PLC trigger" dialog box.

1 Click "PLC trigger" tab to display "PLC trigger" dialog box.

Sets trigger position. Sets trigger conditions for a


bit device.

3 Sets combination of trigger


conditions for a bit device
and for a word device
DBRTLoggingManager Control

Sets sampling period.


Sets trigger conditions for a
word device.

2 Set trigger position.


Set data size after the trigger (The unit is %).

3 Set sampling period.

4 Select a trigger condition.

Set bit device.

3-38 - KV COM+ Library User’s Manual -


3-4 DBRTLoggingManager Control

Property Page Setting Method


Select a trigger condition for a bit device from ON/OFF

To set multiple trigger condition, select a combination type.

DBRTLoggingManager Control
Select a word device.

Select the relation between word device values and trigger condition values.

Input trigger condition values for a word device.

Select combination type of trigger conditions of a bit device and a word device.

5 Click "OK" button to save PLC trigger setting.

- KV COM+ Library User’s Manual - 3-39


3-4 DBRTLoggingManager Control
Property Page Setting Method

Trigger

This section describes how to operate "Trigger" dialog box.

Point Allocate DBTriggerManager control on the same form and configure for triggers
beforehand.
"3-2 DBTriggerManager Control"(3-8 page)

3 1 Click "Trigger" tab to display "Trigger" dialog box.


DBRTLoggingManager Control

Start trigger
Select a trigger setting to start
logging.
Configure triggers on the property
page of DBTriggerManager control
before starting this procedure.

Stop trigger
Select a trigger setting to stop
logging.
Configure triggers on the property
page of DBTriggerManager control
before starting this procedure.

2 Select a trigger to start logging from "Start trigger" drop-down list.

3-40 - KV COM+ Library User’s Manual -


3-4 DBRTLoggingManager Control

Property Page Setting Method


3 Select trigger to stop logging from "Stop trigger" drop-down list.

DBRTLoggingManager Control

- KV COM+ Library User’s Manual - 3-41


3-5 DBCommandButton Control
Property Page Setting Method

This section describes how to set the property page of DBCommandButton control.

Displays style.

"Select style" button


Displays "Style setting"
dialog box. To change the

3 display style..
DBCommandButton Control

"Cancel" button
Closes the dialog box
without saving the style.
Sets preview conditions. "OK" button
Saves the style and closes the
dialog box.

Reference The following property can be set on the property page of DBCommandButton object.

DBCommandButton object

Property name Reference page


Status 4-171

3-42 - KV COM+ Library User’s Manual -


3-5 DBCommandButton Control

Property Page Setting Method


Basic

This section describes how to operate "Basic" dialog box.

DBCommandButton Control
1 Click "Select style" button to display "Style setting" dialog box.

2 Select "Style" from the drop-down menu.

3 Click "OK" button to save the selected style.


Returns to "Property" dialog box
Confirm the setting on a preview.

4 Click "OK" button to save the selected setting.

- KV COM+ Library User’s Manual - 3-43


3-6 DBBarMeter Control
Property Page Setting Method

This section describes how to set the property page of DBBarMeter control.

"Display" tab
"Basic" tab Sets display.
Selects upper and "Scale" tab
lower limits of range Sets scale.
values such as input
range.

3
DBBarMeter Control

"OK" button "Cancel" button


Saves the setting and closes Closes dialog box without saving
the dialog box. the setting.

Reference The following property can be set on the property page of DBBarMeterobject.

DBBarMeter object

Reference
Property name
page
InputValue 4-172
InputRangeLowerLimit 4-173
InputRangeUpperLimit 4-173
DisplayRangeLowerLimit 4-175
DisplayRangeUpperLimit 4-175
AlarmRangeLowerLimit 4-176
AlarmRangeUpperLimit 4-176
ShowOptimumValue 4-179
OptimumValue 4-177
ShowLowerAlarm 4-178
ShowUpperAlarm 4-178
ScaleMarkingColor 4-180
ScaleMarkingLowerAlarmColor 4-181
ScaleMarkingUpperAlarmColor 4-181

3-44 - KV COM+ Library User’s Manual -


3-6 DBBarMeter Control

Property Page Setting Method


Basic

This section describes how to operate "Basic" dialog box.

1 Click "Basic" tab to display "Basic" dialog box.

"Select style" button


Sets preview Displays "Select style" dialog box to
conditions change the style.

Sets lower and upper limits.


3

DBBarMeter Control
Sets ideal values.

"Ideal line"
Check the box to set values for ideal
line.

"Alarm range"
Check the box to set upper and lower
limits for alarm range.

"Display range"
"Draw again" "Auto draw"
Check the box to set upper and lower
For manual drawing of Check the box to make a preview
limits for display range.
the preview when automatically drawn.
"Auto draw" function is
not used.

2 Click "Select style" button to display "Style setting" dialog box.

3 Select "Style" from the drop-down menu.

4 Click "OK" button to save the selected style.

5 Input values in each range and ideal value boxes.


Confirm the setting by preview.
Return to "Property" dialogue

6 Click "OK" button to save the selected setting.

- KV COM+ Library User’s Manual - 3-45


3-6 DBBarMeter Control
Property Page Setting Method

Display

This section describes how to operate "Display" dialog box.

1 Click "Display" tab to display "Display" dialog box.

Sets displacement direction.


Selects needle line type.

3 Selects needle shape.

Selects data
DBBarMeter Control

Sets preview display


conditions pattern.
"Image Frame"
Check the box to apply desired style for
an image frame.

Selects image frame style.

Opens color setting window.

Selects border line type.


"Background" "Alarm upper limit"
"Draw again"
Check the box to Check the box to display the alarm
For manual drawing
apply desired upper limit line.
of the preview when
color for "Alarm lower limit"
"Auto draw" function
background. Check the box to display the alarm
is not used.
lower limit line.
"Auto draw" "Alarm"
Check the box to make a Check the box to display the alarm
preview automatically lines.
drawn.

2 Select displacement direction from the drop-down menu.

3 Select display method of data from the drop-down menu.

3-46 - KV COM+ Library User’s Manual -


3-6 DBBarMeter Control

Property Page Setting Method


4 Select image frame from the drop-down menu.

5 Select properties for alarm/ideal lines.

DBBarMeter Control
Confirm the setting by preview.

6 Click "OK" button to save the selected setting.

- KV COM+ Library User’s Manual - 3-47


3-6 DBBarMeter Control
Property Page Setting Method

Scale

This section describes how to operate "Scale" dialog box.

1 Click "Scale" tab to display "Scale" dialog box.

Check the box to display the scales.


Check the box to display the scales with
data.
3 Sets preview
Selects scale
position.
Opens color setting
window.
conditions
DBBarMeter Control

Sets spaces for main scales.


Sets spaces for auxiliary scales.
Sets number of display digits.
Sets decimal points.
Sets display font.

"Draw again" Check the box to apply desired value to the scales.
For manual drawing Check the box to apply desired value to the auxiliary
of the preview when scales.
"Auto draw" function Check the box to display the main scale.
is not used. "Auto draw"
Check the box to make a
preview automatically
drawn.

2 Select properties for the scales.

3 Input scale values for each box.

Confirm the setting by preview.

4 Click "OK" button to save the selected setting.

3-48 - KV COM+ Library User’s Manual -


3-7 DBFanMeter Control

Property Page Setting Method


This section describes how to set the property page of DBFanMeter control.

"Display" tab
"Basic" tab Sets display.
Selects upper and "Scale" tab
lower limits of range Sets a scale.
values.

DBFanMeter Control
"OK" button "Cancel" button
Saves the setting and closes Closes dialog box without saving
the dialog box. the setting.

Reference The following property can be set on the property page of DBFanMeter object.

DBFanMeter object

Reference
Property name
page
InputValue 4-172
InputRangeLowerLimit 4-173
InputRangeUpperLimit 4-173
DisplayRangeLowerLimit 4-175
DisplayRangeUpperLimit 4-175
AlarmRangeLowerLimit 4-176
AlarmRangeUpperLimit 4-176
ShowOptimumValue 4-179
OptimumValue 4-177
ShowLowerAlarm 4-178
ShowUpperAlarm 4-178
ScaleMarkingColor 4-180
ScaleMarkingLowerAlarmColor 4-181
ScaleMarkingUpperAlarmColor 4-181

- KV COM+ Library User’s Manual - 3-49


3-7 DBFanMeter Control
Property Page Setting Method

Basic

This section describes how to operate "Basic" dialog box.

1 Click "Basic" tab to display "Basic" dialog box.

"Select style" button


Sets preview Displays "Select style" dialog box to
conditions change the style.

3 Sets lower and upper limits.


DBFanMeter Control

Sets ideal values.

"Ideal line"
Check the box to set values for ideal
line.
"Alarm range"
Check the box to set upper and lower
limits for alarm range.

"Draw again" "Auto draw"


"Display range"
For manual drawing of Check the box to make a preview
Check the box to set upper and lower
the preview when automatically drawn.
limits for display range.
"Auto draw" function is
not used.

2 Click "Select style" button to display "Style setting" dialog box.

3 Select "Style" from the drop-down menu.

4 Click "OK" button to save the selected style.


Return to "Property" dialog box.

5 Input values in each range and ideal value style.


Confirm the setting on the preview.

6 Click "OK" button to save the selected setting.

3-50 - KV COM+ Library User’s Manual -


3-7 DBFanMeter Control

Property Page Setting Method


Display

This section describes how to operate "Display" dialog box.

1 Click "Display" tab to display "Display" dialog box.

Sets displacement direction.

Selects data display pattern.

Sets preview
conditions
Selects needle shape.
3
"Image Frame"

DBFanMeter Control
Check the box to apply desired style for
an image frame.

Selects image frame style.

Opens color setting


window.

Selects alarm and ideal lines type.


"Draw again" "Background"
"Alarm upper limit"
For manual drawing Check the box to
Check the box to display the alarm
of the preview when apply desired
upper limit line.
"Auto draw" function color for
"Alarm lower limit"
is not used. background.
Check the box to display the alarm
lower limit line.
"Auto draw" "Alarm"
Check the box to make a Check the box to display the alarm
preview automatically lines.
drawn.

2 Select displacement direction from the drop-down menu.

3 Select display method of data.

- KV COM+ Library User’s Manual - 3-51


3-7 DBFanMeter Control
Property Page Setting Method

4 Select image frame from the drop-down menu.

5 Select alarm/ideal lines.

3
DBFanMeter Control

Confirm the setting by preview.

6 Click "OK" button to save the selected setting.

3-52 - KV COM+ Library User’s Manual -


3-7 DBFanMeter Control

Property Page Setting Method


Scale

This section describes how to operate "Scale" dialog box.

1 Click "Scale" tab to display "Scale" dialog box.

Check the box to display the scales.

Selects scale
3
Opens color setting
Sets preview position. window.
conditions

DBFanMeter Control
Sets spaces for main scales.
Sets spaces for auxiliary scales.

Sets number of display digits.


Sets decimal points.
Sets display font.

Check the box to apply desired value to the scales.


"Draw again"
For manual drawing Check the box to apply desired value to the auxiliary scales.
of the preview when
"Auto draw" function Check the box to display the main scale.
is not used.
"Auto draw"
Check the box to make a
preview automatically
drawn.

2 Select properties for the scales.

3 Input scale values for each box.

Confirm the setting by preview.

4 Click "OK" button to save the selected setting.

- KV COM+ Library User’s Manual - 3-53


3-7 DBFanMeter Control
Property Page Setting Method

MEMO

3
DBFanMeter Control

3-54 - KV COM+ Library User’s Manual -


4

Property Method Event


Property Method Event 4

This chapter includes properties, methods and events of KV COM+ Library.

4-1 Lists of Properties/Methods/Events . . . . . . . . . . . . . .4-2


4-2 Details of Properties/Methods/Events . . . . . . . . . . .4-19
4-3 ActiveX Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-168

- KV COM+ Library User’s Manual - 4-1


4-1 Lists of Properties/Methods/Events
This section briefly introduces what properties, methods and events are of each object.

DBCommManager Object
Property Method Event

This is a control (object) to manage communication with connected device.


One DBCommManager object is placed for each device.
This control can read and write synchronously; but cannot go to the next process until one process
completes.
(References) DBDeviceManager, DBTriggerManager

4  Properties
Property Value
Description Value setting Reference
Lists of Properties/Methods/Events

name acquisition
Obtains or sets connected
PLC Yes Yes 4-19
equipment type.
Obtains or configures
Peer Yes Yes 4-21
communication setting.
Obtains communication status
Active Yes No 4-24
with connected devices.

 Method
Method name Description Reference
Displays the dialog box to change communication route to
CommPeer 4-25
connected devices.
Connect Starts communication with connected devices. 4-26
Disconnect Terminates communication with connected devices. 4-27
GetMode Obtains operation mode/status of connected devices. 4-28
SetMode Sets operation mode/status of connected devices. 4-29
GetErrorNumber Gets error number retained by connected devices. 4-30
ClearError Clears error retained by connected devices. 4-31
ReadDevice Reads value of any one devices. 4-32
WriteDevice Writes any value into any one device. 4-36
Reads string with a specified number of characters from the
ReadText 4-37
specified first device of the connected equipment.
Writes string with a specified number of characters to the specified
WriteText 4-38
first device of the connected equipment.

4-2 - KV COM+ Library User’s Manual -


4-1 Lists of Properties/Methods/Events

DBCommManager DBMemcardAccess

DBMemcardAccess Object

This object provides the access function to a memory card.

Property Method Event


DBMemcardAccess object methods access to a memory card.
Access to a memory card uses connection route to DBCommManager object.
DBMemcardAccess access to a memory card as one of DBCommManager object properties.
* DBMemCardAccess object can be used only when the connected device is KV-5500/5000/3000.
* DBMemcardAccess object cannot be used when the connected device is a simulator.

 Methods
Method name
FileCopyFrom
Description
Copies files on a memory card to path on PC.
Reference
4-39
4
FileCopyTo Copies files on PC to path on a memory card. 4-41

Lists of Properties/Methods/Events
FileState Obtains file status on a memory card. 4-42
FileDelete Deletes files on a memory card. 4-43
Rename Renames files on a memory card. 4-44
MakeDirectory Creates directory on a memory card. 4-45
RemoveDirectory Deletes directory on a memory card 4-46
Obtains the number of files and file names in directory of a
RefleshFileListInDirectory 4-47
memory card and updates file list.
FileNamesInDirectory Obtains file names in directory on a memory card. 4-48
Space Obtains free space in a memory card. 4-49

- KV COM+ Library User’s Manual - 4-3


4-1 Lists of Properties/Methods/Events

DBDeviceManager

DBDeviceManager Object

This object allows bulk read and write with multiple devices asynchronously.
Property Method Event

It retains DBDevices collection and connects to the device specified with CommManager property.
Reads and writes asynchronously into the retained device collection with ReadAll and WriteAll
methods.
AfterRead and AfterWrite events notify the completion of asynchronous read/write process.
Setting TriggerRead and TriggerWrite properties also enable to read/write when each trigger occurs.
(References) DBDevices, DBDevice

 Properties
4 Property
Description
Value Value
Reference
name acquisition setting
Lists of Properties/Methods/Events

Obtains or set referred Com


CommManager Yes Yes 4-50
management object.
Devices Obtains DBDevices collection. Yes No 4-51
TriggerRead Obtains or sets triggers at reading. Yes Yes 4-52
TriggerWrite Obtains or sets triggers at writing. Yes Yes 4-53

 Methods
Method name Description Reference
IsReading Obtains asynchronous reading status of an object. 4-54
IsWriting Obtains asynchronous writing status of an object. 4-55
Reads the value of the registered device from the connected
ReadAll 4-56
equipment.
Writes the value specified with ValueWrite property into the
WriteAll 4-57
registered device of the connected equipment.

 Events
Event name Description Reference
Occurs at the occurrence of read triggers and execution of ReadAll
BeforeRead method, and before actual execution of the read process to the 4-58
connected equipment.
Occurs after reading a value of the registered device from the
AfterRead 4-59
connected equipment.
Occurs at the occurrence of write triggers and execution of WriteAll
BeforeWrite method, and before actual execution of the write process to the 4-60
connected equipment.
Occurs after writing a value to the registered device of the
AfterWrite 4-61
connected equipment.
Occurs at occurrence of an error during the asynchronous write
Error 4-62
process with the connected equipment.

4-4 - KV COM+ Library User’s Manual -


4-1 Lists of Properties/Methods/Events

DBDeviceManager DBDevices
DBRTLoggingManager DBDevices

DBDevices Object

This object represents DBDevices collection.

Property Method Event


This is retained by DBDeviceManager or DBRTLoggingManager, and obtained by Devices property.
(References) DBDeviceManager, DBDevice, DBRTLoggingManager

 Properties
Value Value
Property name Description Reference
acquisition setting
Obtains the number of devices
Count Yes No 4-63
included in the collection.
Obtains the device registered in
4
Item Yes No 4-64
the specified index.

Lists of Properties/Methods/Events
 Methods
Method name Description Reference
Add Adds new device to the collection. 4-65
Insert Inserts a device into the specified index in the collection. 4-66
Remove Removes the specified device from the collection. 4-67
Clear Clears all devices in the collection. 4-68
AddRTL Adds a device for real-time logging to the collection. 4-69
InsertRTL Inserts a device for real-time logging to the collection. 4-71

- KV COM+ Library User’s Manual - 4-5


4-1 Lists of Properties/Methods/Events

DBDeviceManager DBDevices DBDevice


DBRTLoggingManager DBDevices DBDevice

DBDevice Object

This object indicates devices for asynchronously reading and writing.


Property Method Event

This is generated by Add method or AddRTL method of DBDevices object retained by


DBDeviceManager or DBRTLoggingManager.
(References) DBDeviceManager, DBRTLoggingManager

 Properties
Value
Value Refere
Property name Description acquisitio
setting nce
n
4 Kind Obtains device type. Yes No 4-73
No Obtains device number. Yes No 4-74
Lists of Properties/Methods/Events

Obtains strings consisting of the string


Name Yes No 4-74
of device type and device number.
Obtains a value of device read from the
ValueRead Yes No 4-75
connected equipment.
Obtains or set a value written into the
ValueWrite Yes Yes 4-76
device.
Obtains whether the value is actually
IsValueReadValid read from the equipment by ValueRead Yes No 4-77
property.
Allows/prohibits the read from the
ReadEnabled Yes Yes 4-78
connected device.
Allows/prohibits the write into the
WriteEnabled Yes Yes 4-79
connected device.
Obtains or sets the data size of real-
RTLDataSize Yes Yes 4-80
time logging device.
Obtains or sets the data type of real-
RTLDataType Yes Yes 4-81
time logging device.
Obtains or sets the display format of
RTLDispType Yes Yes 4-82
real-time logging device.
Obtains or sets the management
RTLManageIndex identification number of real-time Yes Yes 4-83
logging device.

4-6 - KV COM+ Library User’s Manual -


4-1 Lists of Properties/Methods/Events

DBTriggerManager

DBTriggerManager Object

This control (object) manages triggers that determine timings for DBDeviceManager to read/write, and

Property Method Event


for DBRTLoggingManager to start/stop. This can be used independently.
This control contains DBTriggers collection.
(References) DBTriggers, DBTrigger

 Properties
Property Value Value
Description Reference
name acquisition setting

Active
Obtains or sets whether trigger is
valid or invalid.
Yes Yes 4-84 4
Triggers Obtains DBTriggers collection. Yes No 4-85

Lists of Properties/Methods/Events
 Events
Event name Description Reference
Occurs every time trigger condition within DBTriggers collection is
Fire 4-86
established.

DBTriggers Object

This object represents DBTriggers collection.


This is retained by DBTriggerManager and obtained with Triggers properties.
(References) DBTriggerManager, DBTrigger

 Properties
Value Value
Property name Description Reference
acquisition setting
Obtains the number of triggers
Count Yes No 4-87
included in the collection.
Obtains the trigger of the specified
Item Yes No 4-88
index.

 Methods
Method name Description Reference
Add Adds new triggers to the collection. 4-89
Remove Removes the specified trigger from the collection. 4-90
Clear Removes all triggers from the collection. 4-91
FindByName Searches for the trigger within the collection by name. 4-92

- KV COM+ Library User’s Manual - 4-7


4-1 Lists of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger

DBTrigger Object

This object represents triggers.


Property Method Event

This is generated by Add method of DBTriggers object retained by DBTriggerManager.


Each trigger can be obtained/set with the property of object obtained with Param or As- property.
Fire event occurs as long as the conditions are met.
(References) DBTriggerManager, DBTriggers

 Properties
Property Value Value
Description Reference
name acquisition setting
4 Name Obtains or sets trigger name. Yes Yes 4-93
Type Obtains or sets trigger types. Yes Yes 4-94
Lists of Properties/Methods/Events

Description Obtains or sets trigger comments. Yes Yes 4-95


Obtains trigger status. Sets to True
IsOn Yes No 4-96
when the trigger conditions are met.
Param Obtains trigger object. Yes No 4-97
AsInterval Obtains interval trigger object. Yes No 4-98
AsTimeAt Obtains time trigger object. Yes No 4-99
AsTimeSpan Obtains time range trigger object. Yes No 4-100
AsLogical Obtains combination trigger object. Yes No 4-101
AsCustom Obtains any trigger object. Yes No 4-102
AsDevice Obtains device trigger object. Yes No 4-103

 Events
Event name Description Reference
Fire Occurs every time trigger condition is established. 4-104
Error Occurs when a communication error occurs in a device trigger. 4-129

4-8 - KV COM+ Library User’s Manual -


4-1 Lists of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamInterval


DBTriggerParamTimeAt

DBTriggerParamInterval Object

This is interval trigger object.

Property Method Event


A trigger occurs at specified interval.
This can be obtained by Param or AsInterval property when DBTrigger object type is an interval trigger.
(Reference) DBTrigger

 Properties
Value Value
Property name Description Reference
acquisition setting

IntervalMSec
Obtains or sets interval of trigger
occurrence by millisecond.
Yes Yes 4-105 4

Lists of Properties/Methods/Events
DBTriggerParamTimeAt Object

This is a time trigger object.


A trigger occurs at the edge or level for each specified time based on the computer clock.
This can be obtained with Param or AsTimeAt property when DBTrigger object type is a time trigger.
(Reference) DBTrigger

 Properties
Property Value Value
Description Reference
name acquisition setting
Year Obtains or sets the year condition. Yes Yes 4-106
Month Obtains or sets the month condition. Yes Yes 4-107
Day Obtains or sets the day condition. Yes Yes 4-108
Hour Obtains or sets the hour condition. Yes Yes 4-109
Minute Obtains or sets the minute condition. Yes Yes 4-110
Second Obtains or sets the second condition. Yes Yes 4-111
Obtains or sets the day-of-week
DayOfWeek Yes Yes 4-112
condition.
Obtains or sets the condition that
Edge Yes Yes 4-113
trigger occurs (edge or level).

- KV COM+ Library User’s Manual - 4-9


4-1 Lists of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamTimeSpan


DBTriggerParamLogical

DBTriggerParamTimeSpan Object

This is a time range trigger object.


Property Method Event

A trigger occurs from the start time to the end time based on the time of computer.
This can be obtained by Param or AsTimeSpan property when DBTrigger object type is a time range
trigger.
(Reference) DBTrigger

 Properties
Property Value Value
Description Reference
name acquisition setting
4 TimeFrom
Obtains or sets the start time of trigger
Yes Yes 4-114
occurrence.
Lists of Properties/Methods/Events

Obtains or sets the end time of trigger


TimeTo Yes Yes 4-115
occurrence.

DBTriggerParamLogical Object

This is a combination trigger object.


A trigger occurs when the trigger status of one or two trigger objects referred meets logical condition
specified for the object.
This can be obtained with Param or AsLogical property when DBTrigger object type is a combination
trigger.
(Reference) DBTrigger

 Properties
Property Value Value
Description Reference
name acquisition setting
Obtains or sets the logical condition of
Type Yes Yes 4-116
combination.
Obtains or sets trigger1 to be
Trigger1 Yes Yes 4-117
combined.
Obtains or sets trigger2 to be
Trigger2 Yes Yes 4-118
combined.

4-10 - KV COM+ Library User’s Manual -


4-1 Lists of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamCustom

DBTriggerParamCustom Object

This is an any trigger object.

Property Method Event


This can be obtained with Param or AsCustom property when DBTrigger object type is an any trigger.
(Reference) DBTrigger

 Properties
Property Value Value
Description Reference
name acquisition setting
Obtains or sets the automatic OFF
OneShot Yes Yes 4-119
setting of any trigger.
4
 Methods

Lists of Properties/Methods/Events
Method name Description Reference
SetState Sets any trigger to ON. 4-120

- KV COM+ Library User’s Manual - 4-11


4-1 Lists of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamDevice

DBTriggerParamDevice Object

This is a device trigger object.


Property Method Event

This can be obtained with Param or AsDevice property when DBTrigger object type is a device trigger.
(Reference) DBTrigger

 Properties
Property Value Value
Description Reference
name acquisition setting
Obtains or sets the Commanagement

4 CommManager object "to be connected" used for a


device trigger.
Yes Yes 4-121

Obtains or sets the type of "target


DeviceKind Yes Yes 4-122
Lists of Properties/Methods/Events

device" used for a device trigger.


Obtains or sets the "target device
DeviceNo Yes Yes 4-123
number" used for a device trigger.
Obtains or sets the "condition" of
DeviceCondition Yes Yes 4-124
trigger used for a device trigger.
Obtains or sets the "trigger bit reset"
TriggerBitReset Yes Yes 4-125
used for a device trigger.
Obtains the error information of the
ErrorConnect Commanagement object used for a Yes No 4-126
device trigger.

 Methods
Method name Description Reference
ClearError Clears communication error status of a device trigger. 4-127
SetDevice Sets the "target device" used for a device trigger. 4-128

4-12 - KV COM+ Library User’s Manual -


4-1 Lists of Properties/Methods/Events

DBRTLoggingManager

DBRTLoggingManager Object

This is an object to ensure real-time logging function to log within PLC of KV series.

Property Method Event


It contains DBRTLoggingDataCollection collection.
It communicates with the connected equipment specified with CommManager property and performs
logging into the device registered for the real-time logging in DBDevice object. Logging is performed at
every sampling interval specified within PLC, and AfterRead event notifies the completion of the
reading of obtained logging data.
Trigger conditions to start and stop logging must be set up. The device set by DBTriggerManager or
any timing can be specified as a trigger.
* DBRTLoggingManager object can be used only when the connected equipment is KV-5500/5000/3000.
* DBRTLoggingManager object cannot be used when the connected equipment is a simulator.
(References) DBRTLoggingDataCollection, DBDeviceManager
4

Lists of Properties/Methods/Events
 Properties
Value Value
Property name Description Reference
acquisition setting
Obtains or sets the referred Com
CommManager Yes No 4-130
management object.
Obtains or sets the DBDevices
Devices Yes Yes 4-132
collection.
TriggerStart Obtains or sets the start trigger. Yes Yes 4-133
TriggerStop Obtains or sets the stop trigger. Yes Yes 4-134
Obtains or sets the sampling
SamplingCycle Yes Yes 4-135
cycle.
LastID Obtains the obtained data ID. Yes No 4-136
Obtains the latest sampled data
TopID Yes No 4-137
ID.
Obtains the data ID with PLC
TriggerID Yes No 4-138
trigger.
LoggingDataCollec Obtains the DBRTLoggingData
Yes No 4-139
tion collection.
Obtains or sets the data amount
TriggerDataRatio Yes Yes 4-140
(%) after trigger.
TrgParamBitEnabl Obtains or sets the trigger
Yes Yes 4-141
e1 - 4 condition of bit device 1-4.
Obtains or sets the index number
TrgParamBitIndex1 of DBDevices collection which
Yes Yes 4-142
-4 stores bit device specified as
trigger condition (bit device 1-4).
TrgParamBitOn1 - Obtains or sets ON/OFF of bit
Yes Yes 4-143
4 device 1-4.
TrgParamBitLogic Obtains or sets the bit device
Yes Yes 4-144
Operator condition (AND/OR).
TrgParamWordLog Obtains or sets the logic operator
Yes Yes 4-145
icOperator of word device.
TrgParamWordEna Obtains or sets the trigger
Yes Yes 4-146
ble condition of word device.

- KV COM+ Library User’s Manual - 4-13


4-1 Lists of Properties/Methods/Events

DBRTLoggingManager

Value Value
Property name Description Reference
acquisition setting
Obtains or sets the index number
TrgParamWordInd of DBDevices collection which
Property Method Event

Yes Yes 4-147


ex stores word device specified as
trigger condition (word device).
TrgParamWordCm Obtains or sets the comparison
Yes Yes 4-148
pOperator operator of word device.
TrgParamWordCm Obtains or sets the comparison
Yes Yes 4-149
pValue value of word device.

 Methods
4
Method name Description Reference
Lists of Properties/Methods/Events

GetStatus Obtains the status of real-time logging. 4-150


ReadData Obtains the specified data. 4-151
RTLoggingStart Starts real-time logging. 4-152
RTLoggingStop Stops real-time logging. 4-153
GetTrgParamBit Obtains the trigger condition of PLC trigger (bit device). 4-154
SetTrgParamBit Sets the trigger condition of PLC trigger (bit device). 4-155
GetTrgParamWord Obtains the trigger condition of PLC trigger (word device). 4-156
SetTrgParamWord Sets the trigger condition of PLC trigger (word device). 4-157

 Events
Event name Description Reference
Occurs before actual reading of data from the equipment after
BeforeRead 4-158
executing ReadData method.
AfterRead Occurs after reading values. 4-159

4-14 - KV COM+ Library User’s Manual -


4-1 Lists of Properties/Methods/Events

DBRTLoggingManager

DBRTLoggingDataCollection Structure

Reference When DBRTLoggingManager is used to execute real-time logging, data of multiple


registered devices is buffered into within PLC of KV series.

Property Method Event


Buffered data is read using ReadData method via communication. When ReadData
method is used to read logging data, ID and the number of data to be read are specified.
A read data block is treated as DBRTLoggingData collection.

Example) Among sampled data, data ID 5000 - 5499 are read with ReadData method.
IsSuccess=DBRTLogginManager.ReadData(5000,500)

Data ID
Devices.Item(1)
DM0
Devices.Item(2)
DM10
•••••
Devices.Item(10)
DM100
••••• 4
Data ID

Lists of Properties/Methods/Events
0 18543 14256 ••••• 35201 •••••
1 18546 14246 ••••• 35198 •••••
2 : : :
: : : :
5032 18556 14249 ••••• 35210 •••••
5033 18549 14251 ••••• 35206 •••••
5034 18550 14253 ••••• 35194 •••••
: : : :

This part becomes DBRTLoggingDataCollection.

Read data by ReadData is sorted beginning from the index 0 by each sampling device within
DBRTLoggingDataCollection.
Therefore, index and sampling device must be specified to read in order to obtain specific data.

Example) When 10th DM 100 data of sampling device with index 126 is read:
value=DBRTLoggingManager1.LoggingDataCollection.Item(126).DataValues(10).Value

Sampling device
Devices.Item(1) Devices.Item(2) Devices.Item(10)
••••• •••••
DM0 DM10 DM100
Data ID Index
5000 0 18541 14261 ••••• 35208 •••••
5001 1 18552 14244 ••••• 35192 •••••
5002 2 : : :
: : : :
5125 125 18562 14251 ••••• 35208 •••••
5126 126 18548 14256 ••••• 35201 •••••
127 18546 14249 ••••• 35195 •••••
: : : :
DBRTLoggingData
(DBRTLoggingManager1.LoggingDataCollection.Item(126))
DBRTLoggingDataValue
(DBRTLoggingManager1.LoggingDataCollection.Item(126).DataValues(10))

- KV COM+ Library User’s Manual - 4-15


4-1 Lists of Properties/Methods/Events

DBRTLoggingManager DBRTLoggingDataCollection

DBRTLoggingDataCollection Object

This object represents DBRTLoggingDataCollection collection.


Property Method Event

This is retained by DBRTLoggingManager and obtained by LoggingDataCollection property.


This retains DBRTLoggingData collection.
* DBRTLoggingDataCollection object can be used only when the connected equipment is KV-5500/5000/
3000.
* DBRTLoggingDataCollection object cannot be used when the connected equipment is a simulator.
(Reference) DBRTLoggingManager

 Properties
4 Property Value Value
Description Reference
name acquisition setting
Lists of Properties/Methods/Events

Obtains the number of


Count DBRTLoggingData included in the Yes No 4-160
collection.
Obtains DBRTLoggingData registered
Item Yes No 4-161
for the specified index.

4-16 - KV COM+ Library User’s Manual -


4-1 Lists of Properties/Methods/Events

DBRTLoggingManager DBRTLoggingDataCollection DBRTLoggingData

DBRTLoggingData Object

This object represents DBRTLoggingData collection.

Property Method Event


This is retained by DBRTLoggingDataCollection and obtained with Item property.
This contains DBRTLoggingDataValue collection.
* DBRTLoggingData object can be used only when the connected equipment is KV-5500/5000/3000.
* DBRTLoggingData object cannot be used when the connected equipment is a simulator.
(Reference) DBRTLoggingDataCollection

 Properties
Property
name
Description
Value
acquisition
Value
setting
Reference 4
Id Obtains data ID. Yes No 4-162

Lists of Properties/Methods/Events
DateTime Obtains date and time of sampling. Yes No 4-163
Stores whether data includes PLC
PLCTrigger Yes No 4-163
trigger or not.
Obtains the number of devices (up to
DeviceCount Yes No 4-164
128).
DeviceValues Obtains device data collection. Yes No 4-165

- KV COM+ Library User’s Manual - 4-17


4-1 Lists of Properties/Methods/Events

DBRTLoggingManager DBRTLoggingDataCollection DBRTLoggingData DBRTLoggingDataValue

DBRTLoggingDataValue Object

This object represents DBRTLoggingDataValue collection.


Property Method Event

This is retained by DBRTLoggingData and obtained with DeviceValues property.


* DBRTLoggingDataValue object can be used only when the connected equipment is KV-5500/5000/3000.
* DBRTLoggingDataValue object cannot be used when the connected equipment is a simulator.
(Reference) DBRTLoggingData

 Properties
Property Value Value
Description Reference
4 name
Obtains device type.
acquisition setting

DeviceType Yes No 4-166


dtBit: 0 / dtWord : 1 / dtDWord: 2
Lists of Properties/Methods/Events

Value Obtains sampled device data. Yes No 4-167

4-18 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events
This section describes what are properties, methods and events for each object.
Reference For more information on error details of each runtime, see "Error Message Lists"(A-
10 page).

Property Method Event


DBCommManager Object

Properties

 PLC Property 4
Obtains or sets the connected equipment type.

Details of Properties/Methods/Events
Reference This property can be set in the property window.

Communication Value
Value setting
status acquisition
Communication
Yes Yes
suspended
Communicating Yes No (Runtime error occurs)

● Syntax
When obtaining: value = DBCommManager. PLC
When setting: DBCommManager. PLC = value

Value Description Type


Constant or value to specify the
value DBPlcId or Long
connected equipment

Constant which can be set as value

Constant Value Description

DBPLC_DKV5000 515 Keyence KV-5500、KV-5000、KV-L20V、KV-LE21V、KV-


LE20V、KV-EP21V
DBPLC_DKV3000 515 Keyence KV-3000、KV-L2V、KV-LE21V、KV-LE20V
DBPLC_DKV1000 7 Keyence KV-1000、KV-L20(R)、KV-LE20
DBPLC_DKV700 7 Keyence KV-700、KV-L20(R)、KV-LE20

DBPLC_DKV5000_XYM 4611 Keyence KV-5500、KV-5000、KV-L20V、KV-LE21V、KV-


LE20V、KV-EP21V
DBPLC_DKV3000_XYM 4611 Keyence KV-3000、KV-L2V、KV-LE21V、KV-LE20V
DBPLC_DKV1000_XYM 4103 Keyence KV-1000、KV-L20(R)、KV-LE20

- KV COM+ Library User’s Manual - 4-19


4-2 Details of Properties/Methods/Events

DBCommManager

● Explanation
Obtains or sets a value to be set for the connected equipment type.
This property is set before starting communication.
Runtime error occurs when a value is set during communication.
Property Method Event

The connected equipment type is automatically changed to the device of the equipment type after the
change when the change is to already set devices.
"Model Change"(A-9 page)

● References
“DBCommManager.Active”(4-24 page)
"Connect"(4-26 page)

4
"Disconnect"(4-27 page)

● Usage Example
Details of Properties/Methods/Events

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


MyBase.Load
AxDBCommManager1.PLC = DATABUILDERAXLibLB.DBPlcId.DBPLC_DKV5000
AxDBCommManager1.Peer = "USB"
'AxDBCommManager1.Peer = "192.168.0.10:8500" ' If connecting to Ethernet
AxDBCommManager1.Connect()
End Sub

4-20 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBCommManager

 Peer Property

Obtains or sets configuration of communication with the connected equipment.


Reference This property can be set in property page or the communication configuration dialog box

Property Method Event


displayed using CommPeer method.
"3-1 DBCommManager Control"(3-2 page)
"CommPeer"(4-25 page)

Communication status Value acquisition Value setting


Communication suspended Yes Yes
Communicating Yes Yes*

* Configuration changed during communication becomes valid from the next communication.
4

Details of Properties/Methods/Events
● Syntax
When obtaining: text = DBCommManager. Peer
When setting: DBCommManager. Peer = text

Value Description Type


String to indicate configuration of communication with the
text String
connected equipment

Configuration example of text

Connection method Format Example


USB "USB" "USB"
RS-232C "(Communication port), (Communication speed)" "COM1, 9600"
Ethernet "(IP address) : (Port number)" "192.168.0.10:8500"
"1,1,0,KV-
"(P1),(P2),(P3),(P4),(P5),(P6)"
Bluetooth 5000,00:03:7A:C0:60,
* See "Bluetooth communication format" below
1111"
"(Basic information
setting);Via,(P01),(P02),(P03),(P04),(P05),(P06),(P07),( "USB;Via,,10,2,4,2,1,1
Route setting
P08),(P09),(P10),(P11)" ,2,1,0,0,192.168.0.10"
* See "Route setting communication format " below

Bluetooth communication format

Item Content Description


Configuration value Sets communication port number.
P1
of virtual COM port Parameter: 1-100
Sets protocol stuck type.
Parameter: 0
P2 Protocol stuck type
(* Driver provided by Bluetooth dongle manufacturer may not be able to
communicate with the parameter of 0. Contact your local sales representative.)
Sets whether to communicate automatically or manually.
Automatic/Manual Parameter:
P3
setting 0: COM automatic
1: Manual
P4 Identification name Sets identification name configured with <<KV STUDIO>>.
P5 BD address Sets BD address of KV-BT1.
P6 Path key Sets path key configured with <<KV STUDIO>>.

- KV COM+ Library User’s Manual - 4-21


4-2 Details of Properties/Methods/Events

DBCommManager

Route setting communication format

Item Content Description


Basic
Basic information
information Sets communication route between PC and connected equipment.
Property Method Event

setting
setting
Sets communication route.
Communicate with PLC connected with serial:
DLLTYPE_SERI (1)
Communicate with PLC connected with USB:
DLLTYPE_USB (2)
Communicate with PLC connected via Ethernet:
DLLTYPE_IP (4)

4 Configuration
Communicate via VT connected with serial:
DLLTYPE_VTSERI (7)
Communicate via VT connected with USB:
value of
Details of Properties/Methods/Events

P01 DLLTYPE_VTUSB (8)


communication
Communicate via VT connected with Ethernet:
port
DLLTYPE_VTIP (9)
Communicate via DT connected with USB:
DLLTYPE_DTUSB (10)
Communicate via KV connected with USB:
DLLTYPE_KVUSB (13)
Direct Bluetooth connection with PLC:
DLLTYPE_BLUETOOTH (15)
Communicate via KV connected with Bluetooth:
DLLTYPE_ACL_BLUETOOTH (16)
Sets the target equipment to communicate.
Communication Parameter:
P02
target 1: KV-1000/700
2: KV-5500/5000/3000
Sets communication port on the PC side.
Parameter:
PC
2: Ethernet
P03 communication
3: Serial
port
4: USB
5: Bluetooth
Sets whether to use via VT/DT.
Parameter:
P04 Via VT/DT
1: Use
2: Do not use
Sets device type when using via VT/DT.
Parameter:
P05 VT/DT device type 1: DT-100A
2: VT2
3: VT3
Sets communication method with VT/DT when setting to via VT/
DT.
Connection with
P06 Parameter:
KV
1: Serial
2: via LM20V
Sets whether to use via FL-net.
Parameter:
P07 Via FL-net
1: Use
2: Do not use

4-22 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBCommManager

Item Content Description


Sets whether to use via EtherNet/IP.
Parameter:
P08 Via EtherNet/IP
1: Use

Property Method Event


2: Do not use
Sets unit number to go through.
P09 Route unit number
Parameter: 0-48
P10 Route unit name Sets the same value as the route unit number.
Via FL-net: node number
Target unit
P11 Parameter: 1-254
address
Via EtherNet/IP: IP address

● Explanation 4
Obtains or sets strings to indicate the configuration of communication with the connected equipment.

Details of Properties/Methods/Events
This property is configured before starting communication.
If configuration is changed during connection, it is valid from the next connection.

● References
"PLC"(4-19 page)
"CommPeer"(4-25 page)
"Connect"(4-26 page)
"Disconnect"(4-27 page)

● Usage Example
See the Usage Example in "PLC"(4-19 page).

- KV COM+ Library User’s Manual - 4-23


4-2 Details of Properties/Methods/Events

DBCommManager

 Active Property

Obtains status of communication with the connected equipment but does not set.

Communication status Value acquisition Value setting


Property Method Event

Communication suspended Yes No


Communicating Yes No

● Syntax
value = DBCommManager. Active

Value Description Type

4 value
Boolean value to represent status of communication
with the connected equipment.
Boolean
Details of Properties/Methods/Events

Value for ’value’

Keyword Description
True Communicating
False Communication suspended

● Explanation
Obtains status of communication with the connected equipment but cannot set.
Returns "True" when "Connect" method is executed until "Disconnect" method is executed.
Also returns "True" when communication is not actually established yet or a communication error
occurs after "Connect" method is executed.

● References
"Connect"(4-26 page)
"Disconnect"(4-27 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
If AxDBCommManager1.Active Then
AxDBCommManager1.Disconnect()
Else
AxDBCommManager1.Connect()
End If
End Sub

4-24 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBCommManager

Methods

 CommPeer Method

Property Method Event


Displays dialog box to change configuration of communication with the connected equipment.

Communication status Operation


Communication suspended Yes
Communicating Yes*

* Configuration changed during communication becomes valid from the next communication.

● Syntax
DBCommManager.CommPeer()
4

Details of Properties/Methods/Events
● Description
Displays communication setting dialog box to change Peer property.

● References
"Peer"(4-21 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
AxDBCommManager1.CommPeer()
End Sub

- KV COM+ Library User’s Manual - 4-25


4-2 Details of Properties/Methods/Events

DBCommManager

 Connect Method

Starts communication with the connected equipment.

Communication status Operation


Property Method Event

Communication suspended Yes


Communicating No (Nothing is executed)

● Syntax
DBCommManager. Connect

● Explanation

4 Starts communication on communication configuration of “Peer” property to the connected equipment


configured with “PLC” property.
Nothing is executed if the communication is already started, so the communication continues.
Details of Properties/Methods/Events

An error at the time communication starts results in runtime error.

● References
"PLC"(4-19 page)
"Peer"(4-21 page)
"Disconnect"(4-27 page)
“DBCommManager.Active” (4-24 page)

● Usage Example
See Usage Example in "PLC"(4-19 page).

4-26 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBCommManager

 Disconnect Method

Disconnects communication with the connected equipment.

Communication status Operation

Property Method Event


Communication suspended No (Nothing is executed)
Communicating Yes

● Syntax
DBCommManager.Disconnect

● Explanation
Terminates communication when communicating with the connected equipment.
Nothing is executed when communication is suspended. 4
An error at the time communication stops results in runtime error.

Details of Properties/Methods/Events
● References
"PLC"(4-19 page)
"Peer"(4-21 page)
“DBCommManager.Active” (4-24 page)

● Usage Example
See Usage Example in “DBCommManager.Active” (4-24 page).

- KV COM+ Library User’s Manual - 4-27


4-2 Details of Properties/Methods/Events

DBCommManager

 GetMode Method

Obtains operation mode/status of the connected equipment.

Communication status Operation


Property Method Event

Communication suspended No (Runtime error occurs)


Communicating Yes

● Syntax
value = DBCommManager.GetMode

Value Description Type

4 value
Boolean value to represent operation
mode/status.
Boolean
Details of Properties/Methods/Events

Value for ’value’

Keyword Description
True Connected equipment: RUN mode
False Connected equipment: PROGRAM mode

● Explanation
Obtains operation mode/status of the connected equipment.
Works only during communication.
Execution while communication is suspended or a problem occurs at the time of execution results in
runtime error.

● References
“DBCommManager.Active” (4-24 page)
"Connect"(4-26 page)
"SetMode"(4-29 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
AxDBCommManager1.Connect()
If AxDBCommManager1.GetMode Then
AxDBCommManager1.SetMode(False)
Else
AxDBCommManager1.SetMode(True)
End If
End Sub

4-28 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBCommManager

 SetMode Method

Sets operation mode/status of the connected equipment.

Communication status Operation

Property Method Event


Communication suspended No (Runtime error occurs)
Communicating Yes

● Syntax
DBCommManager.SetMode (value)

Value Description Type

value
Boolean value to represent operation
mode/status.
Boolean
4

Details of Properties/Methods/Events
Keyword available for value

Keyword Description
True Connected equipment: RUN mode
False Connected equipment: PROGRAM mode

● Explanation
Sets operation mode/status of the connected equipment.
Works only during communication.
Execution while communication is suspended or a problem occurs at the time of execution results in
runtime error.

● References
“DBCommManager.Active” (4-24 page)
"Connect"(4-26 page)
"GetMode"(4-28 page)

● Usage Example
See Usage Example in "GetMode"(4-28 page).

- KV COM+ Library User’s Manual - 4-29


4-2 Details of Properties/Methods/Events

DBCommManager

 GetErrorNumber Method

Reads error number retained by the connected equipment.

Communication status Operation


Property Method Event

Communication suspended No (Runtime error occurs)


Communicating Yes

● Syntax
value= DBCommManager. GetErrorNumber

Value Description Type

4 value Error number Integer

● Explanation
Details of Properties/Methods/Events

Reads error numbers retained by the connected equipment.


Works only during communication.
Execution while communication is suspended or a problem occurs at the time of execution results in
runtime error.
For details on error numbers, see the user’s guide of the connected equipment.

● References
“DBCommManager.Active” (4-24 page)
"Connect"(4-26 page)
"ClearError"(4-31 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
AxDBCommManager1.Connect()
MsgBox("Error" & AxDBCommManager1.GetErrorNumber, vbOKOnly)
End Sub

4-30 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBCommManager

 ClearError Method

Clears error information held by the connected equipment.

Communication status Operation

Property Method Event


Communication suspended No (Runtime error occurs)
Communicating Yes

● Syntax
DBCommManager. ClearError

● Explanation
Clears error information held by the connected equipment.
Works only during communication. 4
Execution while communication is suspended or a problem occurs at the time of execution results in

Details of Properties/Methods/Events
runtime error.

● References
“DBCommManager.Active” (4-24 page)
"Connect"(4-26 page)
"GetErrorNumber"(4-30 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
AxDBCommManager1.Connect()
If AxDBCommManager1.GetErrorNumber <> 0 Then
AxDBCommManager1.ClearError()
End If
End Sub

- KV COM+ Library User’s Manual - 4-31


4-2 Details of Properties/Methods/Events

DBCommManager

 ReadDevice Method

Reads value of any one device of the connected model.

Communication status Operation


Property Method Event

Communication suspended No (Runtime error occurs)


Communicating Yes

● Syntax
value=DBCommManager.ReadDevice(device, strNo)

Value Description Type

4 value
device
Read value of device
Specifies device type
Long
DBPlcDevice or Long
strNo Specifies device number String
Details of Properties/Methods/Events

List of device type and device number


For KV-5000 (Use device type of KV-5000 for KV-5500):

Device type
Device number Description
Constant Value
00000 - 99915
DKV5000_RLY_B 0 Relay
(Last two digits are 0 - 15)
0000 - 3915
DKV5000_CR 10 Control relay
(Last two digits are 0 - 15)
Bit DKV5000_T 7 0000 - 3999 Timer (contact point)
DKV5000_C 8 0000 - 3999 Counter (contact point)
DKV5000_CTC 9 0-3 CTC (contact point)
0000000 - 6553415
DKV5000_DM_B 30 Data memory (treated as bit)
(Last two digits are 0 - 15)
DKV5000_DM 18 00000 - 65534 Data memory
00000 - 99900 Relay
DKV5000_RLY_W 25
(Last two digits are 00) (00000 - 99900)
0000 - 3900 Control relay
DKV5000_CR_W 100
(Last two digits are 00) (0000 - 3900)
DKV5000_TM 19 000 - 511 Temporary data
DKV5000_TRM 20 0 - 7 Trimmer
Word DKV5000_TS 21 0000 - 3999 Timer (configured value)
DKV5000_TC 22 0000 - 3999 Timer (current value)
DKV5000_CS 23 0000 - 3999 Counter (configured value)
DKV5000_CC 24 0000 - 3999 Counter (current value)
DKV5000_CTH 16 0-1 Hi-speed counter (current value)
DKV5000_CTC_W 17 0-3 CTC (configured value)
DKV5000_CM 29 00000 - 5999 Control memory

4-32 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBCommManager

For KV-3000:

Device type
Device number Description
Constant Value

Property Method Event


00000 - 99915
DKV3000_RLY_B 0 Relay
(Last two digits are 0 - 15)
0000 - 3915
DKV3000_CR 10 Control relay
(Last two digits are 0 - 15)
Bit DKV3000_T 7 0000 - 3999 Timer (contact point)
DKV3000_C 8 0000 - 3999 Counter (contact point)
DKV3000_CTC 9 0 -3 CTC (contact point)

DKV3000_DM_B 30
0000000 - 6553415
(Last two digits are 0 - 15)
Data memory (treated as bit) 4
DKV3000_DM 18 00000 - 65534 Data memory

Details of Properties/Methods/Events
00000 - 99900 Relay
DKV3000_RLY_W 25
(Last two digits are 00) (00000 - 99900)
0000 - 3900 Control relay
DKV3000_CR_W 100
(Last two digits are 00) (0000 - 3900)
DKV3000_TM 19 000 - 511 Temporary data
DKV3000_TRM 20 0 - 7 Trimmer
Word DKV3000_TS 21 0000 - 3999 Timer (configured value)
DKV3000_TC 22 0000 - 3999 Timer (current value)
DKV3000_CS 23 0000 - 3999 Counter (configured value)
DKV3000_CC 24 0000 - 3999 Counter (current value)
DKV3000_CTH 16 0-1 Hi-speed counter (current value)
DKV3000_CTC_W 17 0-3 CTC (configured value)
DKV3000_CM 29 00000 - 5999 Control memory

For KV-1000:

Device type
Device number Description
Constant Value
00000 - 59915
DKV1000_RLY_B 0 Relay
(Last two digits are 0 - 15)
0000 - 3915
DKV1000_CR 10 Control relay
(Last two digits are 0 - 15)
Bit DKV1000_T 7 0000 - 3999 Timer (contact point)
DKV1000_C 8 0000 - 3999 Counter (contact point)
DKV1000_CTC 9 0 -3 CTC (contact point)
0000000 - 6553415
DKV1000_DM_B 30 Data memory (treated as bit)
(Last two digits are 0 - 15)

- KV COM+ Library User’s Manual - 4-33


4-2 Details of Properties/Methods/Events

DBCommManager

Device type
Device number Description
Constant Value
DKV1000_DM 18 00000 - 65534 Data memory
Property Method Event

00000 - 59900 Relay


DKV1000_RLY_W 25
(Last two digits are 00) (00000 - 59900)
0000 - 3900 Control relay
DKV1000_CR_W 100
(Last two digits are 00) (0000 - 3900)
DKV1000_TM 19 000 - 511 Temporary data
DKV1000_TRM 20 0 - 7 Trimmer
Word DKV1000_TS 21 0000 - 3999 Timer (configured value)

4 DKV1000_TC
DKV1000_CS
22
23
0000 - 3999
0000 - 3999
Timer (current value)
Counter (configured value)
Details of Properties/Methods/Events

DKV1000_CC 24 0000 - 3999 Counter (current value)


DKV1000_CTH 16 0-1 Hi-speed counter (current value)
DKV1000_CTC_W 17 0-3 CTC (configured value)
DKV1000_CM 29 00000 - 11998 Control memory

For KV-700:

Device type
Device number Description
Constant Value
00000 - 59915
DKV700_RLY_B 0 Relay
(Last two digits are 0 - 15)
0000 - 3915
DKV700_CR 10 Control relay
(Last two digits are 0 - 15)

Bit DKV700_T 7 000 - 511 Timer (contact point)


DKV700_C 8 000 - 511 Counter (contact point)
DKV700_CTC 9 0-3 CTC (contact point)
0000000 - 3999915
DKV700_DM_B 30 Data memory (treated as bit)
(Last two digits are 0 - 15)
DKV700_DM 18 00000 - 39999 Data memory
00000 - 59900 Relay
DKV700_RLY_W 25
(Last two digits are 00) (00000 - 59900)
0000 - 3900 Control relay
DKV700_CR_W 100
(Last two digits are 00) (0000 - 3900)
DKV700_TM 19 000 - 511 Temporary data
DKV700_TRM 20 0-7 Trimmer
Word DKV700_TS 21 000 - 511 Timer (configured value)
DKV700_TC 22 000 - 511 Timer (current value)
DKV700_CS 23 000 - 511 Counter (configured value)
DKV700_CC 24 000 - 511 Counter (current value)
DKV700_CTH 16 0-1 Hi-speed counter (current value)
DKV700_CTC_W 17 0-3 CTC (configured value)
DKV700_CM 29 0000 - 3999 Control memory

● Explanation
Reads the device value specified as argument from the connected equipment.

4-34 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBCommManager

Works only during communication.


Runtime error occurs if reading when communication is suspended or if problem occurs when reading.

● References

Property Method Event


“DBCommManager.Active” (4-24 page)
"Connect"(4-26 page)
"WriteDevice"(4-36 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
MsgBox(AxDBCommManager1.ReadDevice(DATABUILDERAXLibLB.DBPlcDevice.DKV5000_DM, _
"0")) 4
End Sub

Details of Properties/Methods/Events

- KV COM+ Library User’s Manual - 4-35


4-2 Details of Properties/Methods/Events

DBCommManager

 WriteDevice Method

Write any value into any one device of connected equipment type.

Communication status Operation


Property Method Event

Communication suspended No (Runtime error occurs)


Communicating Yes

● Syntax
DBCommManager. WriteDevice (device, strNo, value)

Value Description Type

4 device
strNo
Specifies device type.
Specifies device number.
DBPlcDevice or Long
String
value Specifies device value to be written. Long
Details of Properties/Methods/Events

"List of device type and device number"(4-32 page)

● Explanation
Writes the value specified for one device specified with argument of the connected equipment.
Works only during communication.
Execution while communication is suspended or a problem occurs at the time of execution results in
runtime error.

● References
“DBCommManager.Active” (4-24 page)
"Connect"(4-26 page)
"ReadDevice"(4-32 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim a As Long
a = AxDBCommManager1.ReadDevice(DATABUILDERAXLibLB.DBPlcDevice.DKV5000_DM, "0")
AxDBCommManager1.WriteDevice(DATABUILDERAXLibLB.DBPlcDevice.DKV5000_DM, "10", a * 10)
End Sub

4-36 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBCommManager

 ReadText (EX) Method

Reads the specified number of strings from the starting device specified in the connected equipment.

Communication status Operation

Property Method Event


Communication suspended No (Runtime error occurs)
Communicating Yes

● Syntax
DBCommManager.ReadText(device,strNo,lMaxlen,strText)
(DBCommManager.ReadTextEx(device,strNo,lMaxlen,strText) (When using VBScript))
Value Description Type
device Specifies device type. DBPlcDevice 4
strNo Specifies device number. String

Details of Properties/Methods/Events
Specifies maximum string length (by
word) to be read.
Two ASCII characters can be stored for
lMaxlen Long
one word device.
Up to 128-word devices (256 characters)
can be specified.
String ("Variant" when using
strText Strings to be read
VBscript.)

● Explanation
Reads stored string data led by specified device type and device number. The number of strings can be
read to the maximum string length (word base) (two 1-byte characters for one word). Strings are read
until the first NULL from the beginning is detected and the read strings are stored. When there is no
NULL in the maximum string length (word base) a string with NULL is stored after the maximum length
of strings is read.
When there is a value which cannot be converted as a string, runtime error occurs.

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim strRText As String

AxDBCommManager1.Connect()
AxDBCommManager1.ReadText(DATABUILDERAXLibLB.DBPlcDevice.DKV5000_DM, "0", 1, _
strRText)
TextBox1.Text = strRText
AxDBCommManager1.Disconnect()
End Sub

- KV COM+ Library User’s Manual - 4-37


4-2 Details of Properties/Methods/Events

DBCommManager

 WriteText Method

Reads strings containing a specified number of characters from the first device of the connected
equipment.
Property Method Event

Communication status Operation


Communication suspended No (Runtime error occurs)
Communicating Yes

● Syntax
DBCommManager.WriteText(device,strNo,lMaxlen,strText)

Value Description Type


4 device Specifies device type. DBPlcDevice
strNo Specifies device number. String
Details of Properties/Methods/Events

Specifies the maximum string length


(word base) to be written.
One word device can store two ASCII
characters.
lMaxlen Long
Storage for NULL written in the ending of
string is also necessary.
Available maximum value is 128-word
devices (256 characters).
strText Strings to be written String

● Explanation
Reads stored string data led by specified device type and device number.
The number of strings that can be written is the maximum string length (word base) or less including
trailing NULL (one byte). (Two 1-byte characters can be written for one word.)
If written data contains no NULL before reaching the maximum string length, NULL is attached to the
(maximum string length x 2-1)th character from the beginning when the data is written.
In addition, runtime error occurs if there is any value that cannot be converted as a string.

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim strWText As String

AxDBCommManager1.Connect()
strWText = TextBox1.Text
AxDBCommManager1.WriteText(DATABUILDERAXLibLB.DBPlcDevice.DKV5000_DM, "0", 10, _
strWText)
AxDBCommManager1.Disconnect()
End Sub

4-38 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBCommManager DBMemcardAccess

DBMemcardAccess Object

DBMemCardAccess object is available only when the connected equipment is KV-5500/5000/3000.

Property Method Event


Methods

 FileCopyFrom Method

Copies file on a memory card to path of PC.

Communication status Operation


Communication suspended No 4
Communicating Yes

Details of Properties/Methods/Events
Reference Up to 256 MB can be copied for one file.

● Syntax
ret = FileCopyFrom(strPathMemcard, strPathLocal, Flag)

Value Description Type


ret See "Error Message Lists"(A-10 page). lAxError
Specifies path within a memory card to copy to.
strPathMemcard String
* Specifies after (IP address) /MMC.
strPathLocal Specifies path of copy source. String
Flag Specifies operation condition. DBMemFlag

Keyword available for Flag

Keyword Value Description


Restricts overwrite when a file with the same name in the copy
mfOverWriteProtect 0
destination.
Allows overwrite when a file with the same name in the copy
mfOverWriteArrow 1
destination.
-- (Others) - Invalid parameter error occurs.

● Explanation
Copies file stored in a memory card within PLC to path of PC.
Works only during communication.
Execution while communication is suspended or a problem occurs at the time of execution results in
runtime error.
(* Only available when the connected PLC is KV-5500/5000/3000)

● References
“DBCommManager.Active” (4-24 page)
"Connect"(4-26 page)
"FileCopyTo"(4-41 page)

- KV COM+ Library User’s Manual - 4-39


4-2 Details of Properties/Methods/Events

DBCommManager DBMemcardAccess

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim PLCFileName As String
Property Method Event

Dim PCFileName As String


Dim err As Long

PLCFileName ="Test.csv"
PCFileName = " C:\Users\Public\Documents\Sample\Test.csv"
err = AxDBCommManager1.MemcardAccess.FileCopyFrom(PLCFileName, PCFileName, _
DATABUILDERAXLibLB.DBMemFlag.mfOverWriteProtect)
End Sub

4
Details of Properties/Methods/Events

4-40 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBCommManager DBMemcardAccess

 FileCopyTo Method

Copies file on PC to path on a memory card.

Communication status Operation

Property Method Event


Communication suspended No
Communicating Yes

Reference Up to 256 MB can be copied for one file.

● Syntax
ret = FileCopyTo(strPathLocal, strPathMemcard, Flag)

Value Description Type 4


ret See "Error Message Lists"(A-10 page). lAxError

Details of Properties/Methods/Events
strPathLocal Specifies path of copy source. String
Specifies path in a memory card of copy
strPathMemcard destination. String
* Specifies after (IP address) /MMC.
Flag Specifies operation condition. DBMemFlag

Keyword available for Flag

Keyword Value Description


mfOverWriteProtect 0 Restricts overwrite when a file with the same name in the copy destination.
mfOverWriteArrow 1 Allows overwrite when a file with the same name in the copy destination.
-- (Others) - Invalid parameter error occurs.

● Explanation
Copies file on PC to a memory card within PLC.
Works only during communication.
Execution while communication is suspended or a problem occurs at the time of execution results in
runtime error.
(* Only available when the connected PLC is KV-5500/5000/3000)

● References
“DBCommManager.Active” (4-24 page)
"Connect"(4-26 page)
"FileCopyFrom"(4-39 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim PLCFileName As String
Dim PCFileName As String
Dim err As Long

PLCFileName = "Sample"
PCFileName = " C:\Users\Public\Documents\Sample\Test.csv"
err = AxDBCommManager1.MemcardAccess.FileCopyTo(PCFileName, PLCFileName, _
DATABUILDERAXLibLB.DBMemFlag.mfOverWriteArrow)
End Sub

- KV COM+ Library User’s Manual - 4-41


4-2 Details of Properties/Methods/Events

DBCommManager DBMemcardAccess

 FileState (EX) Method

Obtains file status on a memory card

Communication status Operation


Property Method Event

Communication suspended No
Communicating Yes

● Syntax
ret = FileState(strPathMemcard, pvLastAccessTime, pvCreationTime, pvLastWriteTime, plFileSize,
plIsDirectory)
(ret = FileStateEx(strPathMemcard, pvLastAccessTime, pvCreationTime, pvLastWriteTime,

4 plFileSize,plIsDirectory)(When using VBScript))


Value Description Type
ret See "Error Message Lists"(A-10 page). lAxError
Details of Properties/Methods/Events

Specifies file path to obtain status.


* Specifies after (IP address) /MMC. String ("Variant" when
strPathMemcard
When specifying a root directory, specify it in using VBscript.)
double quotation marks ("").
pvLastAccessTime Specifies the last access date/time. Variant
pvCreationTime Specifies created date. Variant
pvLastWriteTime Specifies the last update date. Variant
plFileSize Specifies file size (bytes). Long
Specifies whether to be directory or file (0: file,
plIsDirectory Long
1: directory).

● Explanation
Obtains file status on a memory card within PLC.
Works only during communication.
Execution while communication is suspended or a problem occurs at the time of execution results in
runtime error.
(* Only available when the connected PLC is KV-5500/5000/3000)

● References
“DBCommManager.Active” (4-24 page)
"Connect"(4-26 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim err As Long
Dim FileName As String
Dim LastAccessTime
Dim CreationTime
Dim LastWriteTime
Dim FileSize As Long
Dim f As Long

FileName = TextBox5.Text
err = AxDBCommManager1.MemcardAccess.FileState(FileName, LastAccessTime, CreationTime, _
LastWriteTime, FileSize, f)
TextBox1.Text = LastAccessTime
TextBox2.Text = CreationTime
TextBox3.Text = LastWriteTime
TextBox4.Text = FileSize
End Sub

4-42 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBCommManager DBMemcardAccess

 FileDelete Method

Deletes file on a memory card.

Communication status Operation

Property Method Event


Communication suspended No
Communicating Yes

● Syntax
ret = FileDelete(strPathMemcard, Flag)

Value Description Type


ret

strPathMemcard
See "Error Message Lists"(A-10 page).
Specifies file in a memory card to be deleted.
lAxError

String
4
* Specifies after (IP address) /MMC.

Details of Properties/Methods/Events
Flag Specifies operation condition. DBMemFlag

Keyword available for Flag

Keyword Value
mfDeleteExceptReadOnly 3 Restricts deleting when a deleted file is ReadOnly.
mfDeleteForce 2 Allows deleting when a deleted file is ReadOnly.
-- (Others) - Invalid parameter error occurs.

● Explanation
Deletes files on a memory card within PLC.
Works only during communication.
Execution while communication is suspended or a problem occurs at the time of execution results in
runtime error.
(* Only available when the connected PLC is KV-5500/5000/3000)

● References
“DBCommManager.Active” (4-24 page)
"Connect"(4-26 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim err As Long
Dim FileName As String
FileName = "Test.csv"
err = AxDBCommManager1.MemcardAccess.FileDelete(FileName, _
DATABUILDERAXLibLB.DBMemFlag.mfDeleteForce)
End Sub

- KV COM+ Library User’s Manual - 4-43


4-2 Details of Properties/Methods/Events

DBCommManager DBMemcardAccess

 Rename Method

Rename file name on a memory card.

Communication status Operation


Property Method Event

Communication suspended No
Communicating Yes

● Syntax
ret = Rename(strFileName, strNewFileName)

Value Description Type

4 ret

strFileName
See "Error Message Lists"(A-10 page).
Specifies the current file name.
lAxError

String
* Specifies after (IP address) /MMC.
Details of Properties/Methods/Events

Specifies a file name after modification.


strNewFileName String
* Specifies after (IP address) /MMC.

● Explanation
Rename file on a memory card within PLC.
Works only during communication.
Execution while communication is suspended or a problem occurs at the time of execution results in
runtime error.
(* Only available when the connected PLC is KV-5500/5000/3000)

● References
“DBCommManager.Active” (4-24 page)
"Connect"(4-26 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim err As Long
Dim OldFileName As String
Dim NewFileName As String

OldFileName = "Test.csv"
NewFileName = "Test0614.csv"
err = AxDBCommManager1.MemcardAccess.Rename(OldFileName, NewFileName)
End Sub

4-44 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBCommManager DBMemcardAccess

 MakeDirectory Method

Creates directory on a memory card.

Communication status Operation

Property Method Event


Communication suspended No
Communicating Yes

● Syntax
ret = MakeDirectory(strPathDirectory)

Value Description Type


ret

strPathDirectory
See "Error Message Lists"(A-10 page).
Specifies directory path to be created.
lAxError

String
4
* Specifies after (IP address) /MMC.

Details of Properties/Methods/Events
● Explanation
Creates directory on a memory card within PLC.
Works only during communication.
Execution while communication is suspended or a problem occurs at the time of execution results in
runtime error.
(* Only available when the connected PLC is KV-5500/5000/3000)

● References
“DBCommManager.Active” (4-24 page)
"Connect"(4-26 page)
"RemoveDirectory"(4-46 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim err As Long

err = AxDBCommManager1.MemcardAccess.MakeDirectory("Sample")
End Sub

- KV COM+ Library User’s Manual - 4-45


4-2 Details of Properties/Methods/Events

DBCommManager DBMemcardAccess

 RemoveDirectory Method

Removes directory on a memory card.

Communication status Operation


Property Method Event

Communication suspended No
Communicating Yes

● Syntax
ret = RemoveDirectory(strPathDirectory, Flag)

Value Description Type

4 ret See "Error Message Lists"(A-10 page).


Specifies directory path to be removed.
lAxError

* Specifies after (IP address) /MMC.


strPathDirectory String
Details of Properties/Methods/Events

When specifying a root directory, specify it in


double quotation marks ("").
Flag Specifies operation condition. DBMemFlag

Keyword available for Flag

Keyword Value Description


mfDeleteEmpty 4 Deletes if directory to be deleted is empty.
Deletes if there is no ReadOnly file or folder in directory to be
mfDeleteExceptReadOnly 3
deleted.
Deletes if there is or not ReadOnly file or folder in directory to
mfDeleteForce 2
be deleted.
-- (Others) - Invalid parameter error occurs.

● Explanation
Removes directory on a memory card within PLC.
Works only during communication.
Execution while communication is suspended or a problem occurs at the time of execution results in
runtime error.
(* Only available when the connected PLC is KV-5500/5000/3000)

● References
“DBCommManager.Active” (4-24 page)
"Connect"(4-26 page)
"MakeDirectory"(4-45 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim err As Long

err = AxDBCommManager1.MemcardAccess.RemoveDirectory _
("Sample",DATABUILDERAXLibLB.DBMemFlag.mfDeleteEmpty)
End Sub

4-46 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBCommManager DBMemcardAccess

 RefleshFileListInDirectory (EX) Method

Obtains the number of files and file name included in directory of a memory card and updates the file
list.

Property Method Event


Communication status Operation
Communication suspended No
Communicating Yes

● Syntax
ret = RefleshFileListInDirectory(strPathDirectory, lCount)
(ret = RefleshFileListInDirectoryEx(strPathDirectory, lCount)(When using VBScript))

Value Description Type 4


ret See "Error Message Lists"(A-10 page). lAxError

Details of Properties/Methods/Events
Specifies directory path on a memory card.
* Specifies after (IP address) /MMC. String ("Variant" when
strPathDirectory
When specifying a root directory, specify it in using VBscript.)
double quotation marks ("").
lCount Specifies the number of files. Long

● Explanation
Obtains the number of files and file name included in directory of a memory card within PLC and
updates the file list. Use FileNamesInDirectory method to actually obtain file name from the updated file
list.
Works only during communication.
Execution while communication is suspended or a problem occurs at the time of execution results in
runtime error.
(* Only available when the connected PLC is KV-5500/5000/3000)

● References
“DBCommManager.Active” (4-24 page)
"Connect"(4-26 page)
"FileNamesInDirectory (EX)"(4-48 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim err As Long
Dim FileCount As Long
Dim FileName As String

err = AxDBCommManager1.MemcardAccess.RefleshFileListInDirectory("Sample", FileCount)


err = AxDBCommManager1.MemcardAccess.FileNamesInDirectory("Sample", 1, FileName)
End Sub

- KV COM+ Library User’s Manual - 4-47


4-2 Details of Properties/Methods/Events

DBCommManager DBMemcardAccess

 FileNamesInDirectory (EX) Method

Obtains file name included in directory on a memory card.

Communication status Operation


Property Method Event

Communication suspended No
Communicating Yes

● Syntax
ret = FileNamesInDirectory(strPathDirectory, lIndex, strFileName)
(ret = FileNamesInDirectoryEx(strPathDirectory, lIndex, strFileName)(When using VBScript))

Value Description Type


4 ret See "Error Message Lists"(A-10 page). lAxError
Specifies directory path on memory card.
Details of Properties/Methods/Events

* Specifies after (IP address) /MMC. String ("Variant" when using


strPathDirectory
When specifying a root directory, specify it in VBscript.)
double quotation marks ("").
lIndex Specifies index of files. Long
String ("Variant" when using
strFileName Sets file name.
VBscript.)

● Explanation
Obtains file name included in directory on a memory card within PLC. Because
RefleshFileListInDirectory is used to obtain file name from the updated file list, execute
RefleshFileListInDirectory method before executing FileNamesInDirectory method.
Works only during communication.
Execution while communication is suspended or a problem occurs at the time of execution results in
runtime error.
(* Only available when the connected PLC is KV-5500/5000/3000)

● References
“DBCommManager.Active” (4-24 page)
"Connect"(4-26 page)
"RefleshFileListInDirectory (EX)"(4-47 page)

● Usage Example
See usage example of "RefleshFileListInDirectory (EX)"(4-47 page).

4-48 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBCommManager DBMemcardAccess

 Space Method

Obtains free space of a memory card.

Communication status Operation

Property Method Event


Communication suspended No
Communicating Yes

● Syntax
ret = Space(lHiTotalSize, lLowTotalSize, lHiFreeSize, lLowFreeSize)

Value Description Type

ret
See
page).
"Error Message Lists"(A-10
lAxError
4
lHiTotalSize Specifies total space (high 32 bit). Long

Details of Properties/Methods/Events
lLowTotalSize Specifies total space (low 32 bit). Long
lHiFreeSize Specifies free space (high 32 bit). Long
lLowFreeSize Specifies free space (low 32 bit). Long

● Explanation
Obtains total and free space of a memory card within PLC by byte.
Works only during communication.
Execution while communication is suspended or a problem occurs at the time of execution results in
runtime error.
(* Only available when the connected PLC is KV-5500/5000/3000)

● References
“DBCommManager.Active” (4-24 page)
"Connect"(4-26 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim err As Long
Dim a As Long
Dim b As Long
Dim c As Long
Dim d As Long

AxDBCommManager1.Connect()
err = AxDBCommManager1.MemcardAccess.Space(a, b, c, d)
TextBox1.Text = b / 1024 / 1024
TextBox2.Text = d / 1024 / 1024
AxDBCommManager1.Disconnect()
End Sub

- KV COM+ Library User’s Manual - 4-49


4-2 Details of Properties/Methods/Events

DBDeviceManager

DBDeviceManager Object

Properties
Property Method Event

 CommManager Property

Obtains or sets referred Commanagement object (DBCommManager).


Reference This property can also set in the property page.
"Communication manager Object"(3-23 page)

4 Communication status
Communication suspended
Value acquisition
Yes
Value setting
Yes
Details of Properties/Methods/Events

Communicating Yes Yes

● Syntax
When obtaining: Set dbcomm=DBDeviceManager. CommManager
When setting: Set DBDeviceManager. CommManager = dbcomm

Value Description Type


dbcomm Commanagement object Object

● Explanation
Obtains or sets referred Commanagement object.
ReadAll and WriteAll methods are executed to the connected equipment that object specified with this
property communicate with.
Use GetOcx* method when referring to control object.
Device is converted when configuration is changed.
For more information, see "Model Change"(A-9 page).
* Use object property if you use Visual Basic 6.0.

● References
“DBCommManager.Active” (4-24 page)
"Peer"(4-21 page)
"Connect"(4-26 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim dbcomm As Object

dbcomm = AxDBDeviceManager1.CommManager
'If communicating with the connected equipment of DBCommManager1, connection determination is
changed to
‘ the connected equipment of DBCommManager2.
If dbcomm Is AxDBCommManager1.GetOcx Then
AxDBDeviceManager1.CommManager = AxDBCommManager2.GetOcx
ElseIf dbcomm Is AxDBCommManager2.GetOcx Then
AxDBDeviceManager1.CommManager = AxDBCommManager1.GetOcx
End If
End Sub

4-50 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBDeviceManager

 Devices Property

Obtains DBDevices collection but does not set them.

Communication status Value acquisition Value setting

Property Method Event


Communication suspended Yes No
Communicating Yes No

● Syntax
Set devices=DBDeviceManager.Devices

Value Description Type


devices DBDevice collection DBDevices
4
● Explanation

Details of Properties/Methods/Events
Obtains DBDevices collection but does not set them.

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim Devices As DATABUILDERAXLibLB.DBDevices
Dim Device As DATABUILDERAXLibLB.DBDevice
'Add DBDevices collection.
Devices = AxDBDeviceManager1.Devices
Device = Devices.Add(DATABUILDERAXLibLB.DBPlcDevice.DKV5000_DM, "0")
End Sub

- KV COM+ Library User’s Manual - 4-51


4-2 Details of Properties/Methods/Events

DBDeviceManager

 TriggerRead Property

Obtains or sets a trigger when reading.


Reference This property can also be set in the property page.
Property Method Event

"Trigger"(3-29 page)

Communication status Value acquisition Value setting


Communication suspended Yes Yes
Communicating Yes Yes

● Syntax

4 When obtaining: Set trigger= DBDeviceManager.TriggerRead


When setting: Set DBDeviceManager.TriggerRead = trigger

Value Description Type


Details of Properties/Methods/Events

trigger DBTrigger object for reading DBTrigger

● Explanation
Obtains or sets DBTrigger object as a read trigger.
If conditions of the specified trigger are met, device value is read accordingly.

● References
"BeforeRead"(4-58 page)
"AfterRead"(4-59 page)
"Param"(4-97 page)
“DBTrigger.Fire” (4-104 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click


Dim Trigger As DATABUILDERAXLibLB.DBTrigger

Trigger = AxDBDeviceManager1.TriggerRead
If Trigger Is Nothing Then
Call MsgBox("TriggerRead is empty")
Exit Sub
End If
If Trigger.Type = DATABUILDERAXLibLB.DBAxTriggerType.ttInterval Then
Call MsgBox("TriggerRead is Interval Trigger")
Else
Call MsgBox("TriggerRead is not Interval Trigger")
End If
End Sub

4-52 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBDeviceManager

 TriggerWrite Property

Obtains or sets a trigger when writing.


Reference This property can also be set in the property page.

Property Method Event


"Trigger"(3-29 page)

Communication status Value acquisition Value setting


Communication suspended Yes Yes
Communicating Yes Yes

● Syntax
When obtaining: Set trigger = DBDeviceManager.TriggerWrite
When setting: Set DBDeviceManager.TriggerWrite = trigger 4
Value Description Type

Details of Properties/Methods/Events
trigger DBTrigger object for writing DBTrigger

● Explanation
Obtains or sets DBTrigger object as a write trigger.
If conditions of the specified trigger is met, device value is written accordingly.

● References
"BeforeRead"(4-58 page)
"AfterRead"(4-59 page)
"Param"(4-97 page)
“DBTrigger.Fire” (4-104 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click


Dim Trigger As DATABUILDERAXLibLB.DBTrigger
Trigger = AxDBDeviceManager1.TriggerWrite
If Trigger Is Nothing Then
Call MsgBox("TriggerWrite is empty")
Exit Sub
End If
If Trigger.Type = DATABUILDERAXLibLB.DBAxTriggerType.ttInterval Then
Call MsgBox("TriggerWrite is Interval Trigger")
Else
Call MsgBox("TriggerWrite is not Interval Trigger")
End If
End Sub

- KV COM+ Library User’s Manual - 4-53


4-2 Details of Properties/Methods/Events

DBDeviceManager

Methods

 IsReading Methods
Property Method Event

Obtains whether object is being read asynchronously.

Communication status Operation


Communication suspended Yes (always False)
Communicating Yes

● Syntax

4 value = DBDeviceManager.IsReading

Value Description Type


Details of Properties/Methods/Events

Boolean value to indicate asynchronous


value Boolean
read

Value for ‘value’

Keyword Description
True Reading asynchronously
False Not reading asynchronously

● Explanation
Indicates whether object is being read asynchronously.

● Usage Example

Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click


If AxDBDeviceManager1.IsReading = True Then
Call MsgBox(" Reading")
Else
Call MsgBox(" Not reading")
End If
End Sub

4-54 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBDeviceManager

 IsWriting Method

Obtains whether object is being written asynchronously.

Communication status Operation

Property Method Event


Communication suspended Yes (always False)
Communicating Yes

● Syntax
value = DBDeviceManager.IsWriting

Value Description Type

value
Boolean value to indicate asynchronous
writing
Boolean
4

Details of Properties/Methods/Events
Value for ‘value’

Keyword Description
True Writing asynchronously
False Not writing asynchronously

● Explanation
Indicates whether object is being written asynchronously.

● Usage Example

Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click


If AxDBDeviceManager1.IsWriting = True Then
Call MsgBox(" Writing")
Else
Call MsgBox("not writing")
End If
End Sub

- KV COM+ Library User’s Manual - 4-55


4-2 Details of Properties/Methods/Events

DBDeviceManager

 ReadAll Method

Reads values of registered device from the connected equipment.

Communication status Operation


Property Method Event

Communication suspended No (Runtime error occurs)


Communicating Yes

● Syntax
DBDeviceManager.ReadAll

● Explanation

4 Reads values of device from the connected equipment.


Works only during communication.
Execution while communication is suspended, Commanagement object (CommManager) is not
Details of Properties/Methods/Events

registered, or a problem occurs at the time of execution results in runtime error.


No "Error" event occurs when runtime error occurs.

● References
"CommManager"(4-50 page)
"WriteAll"(4-57 page)
"BeforeRead"(4-58 page)
"AfterRead"(4-59 page)
"Error"(4-62 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click


AxDBDeviceManager1.ReadAll()
End Sub

4-56 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBDeviceManager

 WriteAll Methods

Writes specified values into each registered device of the connected equipment.

Communication status Operation

Property Method Event


Communication suspended No (Runtime error occurs)
Communicating Yes

● Syntax
DBDeviceManager.WriteAll

● Explanation
Writes values of device into the connected equipment.
Works only during communication. 4
Execution while communication is suspended, Commanagement object (CommManager) is not

Details of Properties/Methods/Events
registered, or a problem occurs at the time of execution results in runtime error.
No "Error" event occurs if runtime error occurs.
Use ValueWrite method of DBDevice object to specify device value.

● References
"CommManager"(4-50 page)
"ReadAll"(4-56 page)
“DBDevice.BeforeWrite” (4-60 page)
"AfterWrite"(4-61 page)
"Error"(4-62 page)
“DBDevice.ValueWrite” (4-76 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click


AxDBDeviceManager1.WriteAll()
End Sub

- KV COM+ Library User’s Manual - 4-57


4-2 Details of Properties/Methods/Events

DBDeviceManager

Events

 BeforeRead Event
Property Method Event

Occurs at the occurrence of a read trigger and execution of ReadAll method before performing actual
read process to the connected equipment.

● Syntax
Sub DBDeviceManager_BeforeRead()

● Explanation
Occurs at the occurrence of a read trigger and execution of ReadAll method before performing actual
4 read process to the connected equipment.

● References
Details of Properties/Methods/Events

"AfterRead"(4-59 page)
"ReadAll"(4-56 page)
"TriggerRead"(4-52 page)

● Usage Example

Private Sub AxDBDeviceManager1_BeforeRead(ByVal sender As Object, ByVal e As System.EventArgs) _


Handles AxDBDeviceManager1.BeforeRead
If (AxDBDeviceManager1.Devices.Count > 500) Then
MsgBox(" Communication cycle becomes long due to too many registered devices. ", _
MsgBoxStyle.OkOnly)
End If
End Sub

4-58 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBDeviceManager

 AfterRead Event

Occurs after reading values of registered device from the connected equipment.

● Syntax

Property Method Event


Sub DBDeviceManager_AfterRead()

● Explanation
Occurs after reading values of registered device from the connected equipment.
DBDeviceManager.Error event occurs when a device not contained in the connected equipment is
included as the device to be read.

● References
"BeforeRead"(4-58 page) 4
"ReadAll"(4-56 page)

Details of Properties/Methods/Events
"TriggerRead"(4-52 page)
"Error"(4-62 page)

● Usage Example

Private Sub AxDBDeviceManager1_AfterRead(ByVal sender As Object, ByVal e As System.EventArgs) _


Handles AxDBDeviceManager1.AfterRead
MsgBox(AxDBDeviceManager1.Devices.Item(1).ValueRead)
End Sub

- KV COM+ Library User’s Manual - 4-59


4-2 Details of Properties/Methods/Events

DBDeviceManager

 BeforeWrite Event

Occurs at the occurrence of a write trigger and execution of WriteAll method before performing actual
read process to the connected equipment.
Property Method Event

● Syntax
Sub DBDeviceManager_BeforeWrite()

● Explanation
Occurs at the occurrence of a write trigger and execution of WriteAll method before performing actual
read process to the connected equipment.

● References
4 "AfterWrite"(4-61 page)
"WriteAll"(4-57 page)
Details of Properties/Methods/Events

"TriggerWrite"(4-53 page)

● Usage Example

Private Sub AxDBDeviceManager1_BeforeWrite(ByVal sender As Object, ByVal e As System.EventArgs) _


Handles AxDBDeviceManager1.BeforeWrite
AxDBDeviceManager1.Devices.Item(1).ValueWrite = 1000
End Sub

Private Sub AxDBDeviceManager1_AfterWrite(ByVal sender As Object, ByVal e As System.EventArgs) _


Handles AxDBDeviceManager1.AfterWrite
MsgBox(" Writing completed")
End Sub

4-60 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBDeviceManager

 AfterWrite Events

Occurs after writing values to registered device of the connected equipment.

● Syntax

Property Method Event


Sub DBDeviceManager_AfterWrite()

● Explanation
Occurs after writing device values from the connected equipment.
DBDeviceManager.Error event occurs when device not contained in the connected equipment is
included as the device to be written.

● References
“DBDevice.BeforeWrite” (4-60 page) 4
"WriteAll"(4-57 page)

Details of Properties/Methods/Events
"TriggerWrite"(4-53 page)
"Error"(4-62 page)

● Usage Example
See usage example of “DBDevice.BeforeWrite” (4-60 page).

- KV COM+ Library User’s Manual - 4-61


4-2 Details of Properties/Methods/Events

DBDeviceManager

 Error Event

Occurs when error occurs during process of asynchronous read/write with the connected equipment.

● Syntax
Property Method Event

Sub DBDeviceManager_Error(lErrkind,lErrcode)

Value Description Type


lErrkind Error type lAxErr
lErrcode Error number Long

Value for lAxErr

4 Constant Value Description


aeDericeManagerRead 1 Read process error
Details of Properties/Methods/Events

aeDericeManagerWrite 2 Write process error

● Explanation
Occurs when error occurs during process of asynchronous read/write with the connected equipment.
For details on error number and description, see "Error Message Lists"(A-10 page).

● References
"ReadAll"(4-56 page)
"WriteAll"(4-57 page)

● Usage Example

Private Sub AxDBDeviceManager1_Error(ByVal sender As Object, ByVal e As _


AxDATABUILDERAXLibLB._IDBDeviceManagerEvents_ErrorEvent) Handles _
AxDBDeviceManager1.Error
If sender = 1 Then
MsgBox(" Error during read process. Error number: " & e.ToString)
Else
MsgBox(" Error during write process. Error number: " & e.ToString)
End If
End Sub

4-62 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBDeviceManager DBDevices

DBDevices Object

Properties

Property Method Event


 Count Property

Obtains the number of devices included in collection but cannot set.

Communication status Value acquisition Value setting


Communication suspended Yes No
Communicating Yes No
4
● Syntax

Details of Properties/Methods/Events
value = DBDevices.Count

Value Description Type


value The number of devices Long

● Explanation
Obtains the number of devices included in collection but cannot set.

● Usage Example
See usage example in “DBDevice.BeforeWrite” (4-60 page).

- KV COM+ Library User’s Manual - 4-63


4-2 Details of Properties/Methods/Events

DBDeviceManager DBDevices

 Item Property

Obtains device registered for the specified index.

Communication status Value acquisition Value setting


Property Method Event

Communication suspended Yes No


Communicating Yes No

● Syntax
Set device = Item(index)
or
Set device = DBDevices(index)

4 Value Description Type


device DBDevice object DBDevice
Details of Properties/Methods/Events

index Index Long

● Explanation
Obtains device where index identifies.
The beginning of index is 1.
Runtime error occurs if index out of range is specified or if device is not registered.

● Usage Example

Function DBDevicesGetSetting(ByVal Devices As DATABUILDERAXLibLB.DBDevices) As String


Dim DeviceNum As Integer
Dim iCounter As Integer
Dim Device As DATABUILDERAXLibLB.DBDevice
Dim strDevices As String

DeviceNum = Devices.Count
strDevices = "DBDevices information= " + Str(DeviceNum) + vbCrLf
For iCounter = 1 To DeviceNum
strDevices = strDevices + "Index = " + Str(iCounter) + vbCrLf
Device = Devices.Item(iCounter)
strDevices = strDevices + Device.Name + vbCrLf
Next
DBDevicesGetSetting = strDevices
End Function

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim corDev As DATABUILDERAXLibLB.DBDevices

corDev = AxDBDeviceManager1.Devices
MsgBox(DBDevicesGetSetting(corDev).ToString)
End Sub

4-64 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBDeviceManager DBDevices

Methods

 Add Methods

Property Method Event


Adds a new device.
Reference This method can be executed during designing in the property page.
"Addition of device"(3-25 page)

Communication status Operation


Communication suspended Yes
Communicating Yes
4
● Syntax

Details of Properties/Methods/Events
Set device = DBDevices.Add(kind, no)

Value Description Type


Device object for asynchronously
device DBDevice
reading/writing
kind Device type DBPlcDevice
no Device number String

"List of device type and device number"(4-32 page)

● Explanation
Generates a device.
Can only generate a device of the connected equipment identified by PLC property of
Commanagement object referred by CommManager property of DBDeviceManager object.
Runtime error occurs if CommManager property is not set or if device type or number not contained in
the connected equipment is specified.
* Add method cannot be used for DBDevice object of DBRTLoggingManager. Use AddRTL method instead.

● References
"CommManager"(4-50 page)
"PLC"(4-19 page)
“DBDevices.Remove” (4-67 page)
"Insert"(4-66 page)
“DBDevices.Item” (4-64 page)
“DBDevices.Count” (4-63 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim Device As DATABUILDERAXLibLB.DBDevice

Device = AxDBDeviceManager1.Devices.Add(DATABUILDERAXLibLB.DBPlcDevice.DKV5000_DM, _
"0")
Device.ReadEnabled = True
Device.WriteEnabled = False
End Sub

- KV COM+ Library User’s Manual - 4-65


4-2 Details of Properties/Methods/Events

DBDeviceManager DBDevices

 Insert Method

Inserts a device into specified index.

Communication status Operation


Property Method Event

Communication suspended Yes


Communicating Yes

● Syntax
Set device = DBDevices.Insert(index, kind, no)

Value Description Type

4 device
Device object for asynchronously
reading/writing
DBDevice

index Index Long


Details of Properties/Methods/Events

kind Device type DBPlcDevice


no Device number String

"List of device type and device number"(4-32 page)

● Explanation
Generates and inserts a device into the place identified by index.
Beginning of index is 1. If index is 1 or smaller, the device is inserted at the beginning. If index is larger
than the number of devices (obtained by Count property), it is inserted at the end.
Can only generate a device of the connected equipment identified by PLC property of
Commanagement object referred by CommManager property of DBDeviceManager object.
Runtime error occurs if CommManager property is not set or if device type or number not contained in
the connected equipment is specified.
* Insert method cannot be used for DBDevice object of DBRTLoggingManager. Use InsertRTL method
instead.

● References
"CommManager"(4-50 page)
"PLC"(4-19 page)
“DBDevices.Add” (4-65 page)
“DBDevices.Remove” (4-67 page)
“DBDevices.Item” (4-64 page)
“DBDevices.Count” (4-63 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim Device As DATABUILDERAXLibLB.DBDevice
Device = AxDBDeviceManager1.Devices.Insert(0, _
DATABUILDERAXLibLB.DBPlcDevice.DKV5000_DM, "0")
End Sub

4-66 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBDeviceManager DBDevices

 Remove Method

Removes the specified device.


Reference This method can be executed during designing in the property page.

Property Method Event


"Deletion of device"(3-28 page)

Communication status Operation


Communication suspended Yes
Communicating Yes

● Syntax
Remove device
4
Value Description Type

Details of Properties/Methods/Events
Device object for asynchronous reading/
device DBDevice
writing

● Explanation
Removes the specified device.
Runtime error occurs if device created by other DBDevices object is specified.

● References
“DBDevices.Add” (4-65 page)
"Insert"(4-66 page)
“DBDevices.Clear” (4-68 page)
“DBDevices.Item” (4-64 page)
“DBDevices.Count” (4-63 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim Devices As DATABUILDERAXLibLB.DBDevices
Dim Device As DATABUILDERAXLibLB.DBDevice
Devices = AxDBDeviceManager1.Devices
Device = Devices.Item(1)
Call Devices.Remove(Device)
End Sub

- KV COM+ Library User’s Manual - 4-67


4-2 Details of Properties/Methods/Events

DBDeviceManager DBDevices

 Clear Method

Removes all devices.


Reference This method can be executed during designing in the property page.
Property Method Event

"Deletion of all devices"(3-28 page)

Communication status Operation


Communication suspended Yes
Communicating Yes

● Syntax

4 Clear

● Explanation
Details of Properties/Methods/Events

Removes all devices.

● References
“DBDevices.Add” (4-65 page)
"Insert"(4-66 page)
“DBDevices.Remove” (4-67 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
AxDBDeviceManager1.Devices.Clear()
End Sub

4-68 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBDeviceManager DBDevices

 AddRTL Method

Adds a new device used for real time logging.


Reference This method can be executed during designing in the property page.

Property Method Event


"Addition of device"(3-34 page)

Communication status Operation


Communication suspended Yes
Communicating Yes

● Syntax
Set device=DBDevices.AddRTL(PlcDevice,strNo,RTLDataSize,DeviceType,DispType,Reserved)

Value Description Type


4

Details of Properties/Methods/Events
device Device object DBDevice
PlcDevice Device type DBPlcDevice or Long
strNo Device number String
RTLDataSize Device length Integer
DeviceType Device type Integer
DispType Display type Integer
Reserved System reservation (0) Long

"List of device type and device number"(4-32 page)


Value for DeviceType

Constant Value Description


dtBit 0 Bit device
dtWord 1 Word device
dtDWord 2 Double word device

Value for DispType

Constant Value Description


dtBitVal 1 Bit (0/1)
dtSigned 11 Binary with sign
dtUnsigned 12 Binary without sign
dtHEX 13 HEX
dtFloat 16 Floating point real number

● Explanation
Generates a device used for real time logging.
Can only generate a device of the connected equipment identified by PLC property of
Commanagement object referred by CommManager property of DBRTLoggingManager object.
Runtime error occurs if CommManager property is not set or if device type or number not contained in
the connected equipment is specified.
* AddRTL method cannot be used for DBDevice object of DBDeviceManager. Use Add method instead.

- KV COM+ Library User’s Manual - 4-69


4-2 Details of Properties/Methods/Events

DBDeviceManager DBDevices

● References
"CommManager"(4-50 page)
"PLC"(4-19 page)
Property Method Event

“DBDevices.Remove” (4-67 page)


“DBDevices.InsertRTL” (4-71 page)
“DBDevices.Item” (4-64 page)
“DBDevices.Count” (4-63 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


4 Button1.Click
Dim Device As DATABUILDERAXLibLB.DBDevice
Device = AxDBRTLoggingManager1.Devices.AddRTL _
Details of Properties/Methods/Events

(DATABUILDERAXLibLB.DBPlcDevice.DKV5000_DM, "0",1,1,11,0)
End Sub

4-70 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBDeviceManager DBDevices

 InsertRTL Method

Inserts a device used for real time logging into the specified index.
Reference This method can be executed during designing in the property page.

Property Method Event


"Addition of device"(3-34 page)

Communication status Operation


Communication suspended Yes
Communicating Yes

● Syntax
Set device=DBDevices.InsertRTL(Idx,PlcDevice,strNo,RTLDataSize,DeviceType,DispType,Reserved)

Value Description Type


4

Details of Properties/Methods/Events
device Device object DBDevice
Idx Index Long
PlcDevice Device type DBPlcDevice or Long
strNo Device number String
RTLDataSize Device length Integer
DeviceType Device type Integer
DispType Display type Integer
Reserved System reservation Long

"List of device type and device number"(4-32 page)


Value for DeviceType

Constant Value Description


dtBit 0 Bit device
dtWord 1 Word device
dtDWord 2 Double word device

Value for DispType

Constant Value Description


dtBitVal 1 Bit (0/1)
dtSigned 11 Binary with sign
dtUnsigned 12 Binary without sign
dtHEX 13 HEX
dtFloat 16 Floating point real number

- KV COM+ Library User’s Manual - 4-71


4-2 Details of Properties/Methods/Events

DBDeviceManager DB Devices

● Explanation
Generates and inserts a device used for real time logging into the place identified by index.
Beginning of index is 1. If index is 1 or smaller, the device is inserted at the beginning. If index is larger
than the number of devices (obtained by Count property), it is inserted at the end.
Property Method Event

Can only generate a device of the connected equipment identified by PLC property of
Commanagement object referred by CommManager property of DBRTLoggingManager object.
Runtime error occurs if CommManager property is not set or if device type or number not contained in
the connected equipment is specified.
* InsertRTL method cannot be used for DBDevice object of DBDeviceManager. Use Insert method instead.

● References
"CommManager"(4-50 page)

4 "PLC"(4-19 page)
“DBDevices.Remove” (4-67 page)
Details of Properties/Methods/Events

“DBDevices.AddRTL” (4-69 page)


“DBDevices.Item” (4-64 page)
“DBDevices.Count” (4-63 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim Device As DATABUILDERAXLibLB.DBDevice
Device = AxDBRTLoggingManager1.Devices.InsertRTL _
(0,DATABUILDERAXLibLB.DBPlcDevice.DKV5000_DM, "0",1,1,11,0)
End Sub

4-72 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBDeviceManager DB Devices DBDevice

DBDevice Object

Properties

Property Method Event


 Kind Property

Obtains device type but cannot set.

Communication status Value acquisition Value setting


Communication suspended Yes No
Communicating Yes No
4
● Syntax

Details of Properties/Methods/Events
value = DBDevice.Kind

Value Description Type


value Device type DBPlcDevice or Long

● Explanation
Obtains device type but cannot set.
"List of device type and device number"(4-32 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim Device As DATABUILDERAXLibLB.DBDevice
Dim DevKind As DATABUILDERAXLibLB.DBPlcDevice
Dim strDevNo As String
Dim strDevName As String
Dim strResult As String

Device = AxDBDeviceManager1.Devices.Item(1)
'Read device type.
DevKind = Device.Kind
'Read device.
strDevNo = Device.No
'Read device type and device.
strDevName = Device.Name
strResult = Str(DevKind) + " " + strDevNo + " " + strDevName
Call MsgBox(strResult)
End Sub

- KV COM+ Library User’s Manual - 4-73


4-2 Details of Properties/Methods/Events

DBDeviceManager DB Devices DBDevice

 No Property

Obtains device number but cannot set it.

Communication status Value acquisition Value setting


Property Method Event

Communication suspended Yes No


Communicating Yes No

● Syntax
text = DBDevice.No

Value Description Type

4 text Device number String

● Explanation
Details of Properties/Methods/Events

Obtains device number but cannot set it.

● References
"Kind"(4-73 page)

 Name Property

Obtains a string consisting of the one indicating device type and device number but cannot set it.

Communication status Value acquisition Value setting


Communication suspended Yes No
Communicating Yes No

● Syntax
text = DBDevice.Name

Value Description Type


text Device type + number String

● Explanation
Obtains a string consisting of the one indicating device type and device number but cannot set it.

● References
"Kind"(4-73 page)

● Usage Example
See usage example described in "Kind"(4-73 page).

4-74 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBDeviceManager DBDevices DBDevice

 ValueRead Property

Obtains device value read from the connected equipment.

Communication status Value acquisition Value setting

Property Method Event


Communication suspended Yes No
Communicating Yes No

● Syntax
value = DBDevice. ValueRead

Value Description Type


value Value which is read Long
4
● Explanation

Details of Properties/Methods/Events
Obtains device value read from the connected equipment but cannot set it.

● References
"ReadAll"(4-56 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim Device As DATABUILDERAXLibLB.DBDevice
Dim strReadValue As String
Dim strWriteValue As String
Dim strIsValueReadValid As String
'Obtain device set as device manager.
Device = AxDBDeviceManager1.Devices.Item(1)
'Check read value.
strReadValue = Str(Device.ValueRead)
'Check written value.
strWriteValue = Str(Device.ValueWrite)
'Check whether it is read data or not.
If (Device.IsValueReadValid = True) Then
strIsValueReadValid = "ReadValue is Valid"
Else
strIsValueReadValid = "ReadValue is Invalid"
End If
Call MsgBox(strReadValue + vbCrLf + strWriteValue + vbCrLf + strIsValueReadValid)
End Sub

- KV COM+ Library User’s Manual - 4-75


4-2 Details of Properties/Methods/Events

DBDeviceManager DBDevices DBDevice

 ValueWrite Property

Obtains or sets values written into device.

Communication status Value acquisition Value setting


Property Method Event

Communication suspended Yes Yes


Communicating Yes Yes

● Syntax
When obtaining: value = DBDevice. ValueWrite
When setting: DBDevice. ValueWrite = value

Value Description Type


4 value Written value Long
Details of Properties/Methods/Events

● Explanation
Obtains or sets values written into device.
Configured value is not immediately reflected on the connected equipment, but is written when a write
trigger occurs and WriteAll method of DBDeviceManager object is executed.

● References
"WriteAll"(4-57 page)

● Usage Example
See usage example of "ValueRead"(4-75 page).

4-76 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBDeviceManager DBDevices DBDevice

 IsValueReadValid Property

Obtains whether the value of ValueRead is actually read from the connected equipment, but cannot set
it.

Property Method Event


Communication status Value acquisition Value setting
Communication suspended Yes No
Communicating Yes No

● Syntax
value = DBDevice. IsValueReadValid

Value Description Type

value
Boolean value to indicate whether it is actually
Boolean
4
read

Details of Properties/Methods/Events
Value for ‘value’

Keyword Description
True Actually read from the connected equipment
False Not actually read from the connected equipment

● Explanation
Identify the validity of ValueRead property. The value is True if it is actually read from the connected
equipment, and it is False if it is the initial value, but cannot set it.

● References
"ValueRead"(4-75 page)
"ReadAll"(4-56 page)

● Usage Example
See usage example in "ValueRead"(4-75 page).

- KV COM+ Library User’s Manual - 4-77


4-2 Details of Properties/Methods/Events

DBDeviceManager DBDevices DBDevice

 ReadEnabled Property

Enables and disables reading from the connected equipment.

Communication status Value acquisition Value setting


Property Method Event

Communication suspended Yes Yes


Communicating Yes Yes

● Syntax
When obtaining: value = DBDevice. ReadEnabled
When setting: DBDevice. ReadEnabled = value

Value Description Type


4 value
Boolean value to indicate whether
Boolean
reading is enabled or disabled
Details of Properties/Methods/Events

Keyword available for value

Keyword Description
True Enabled
False Disabled

● Explanation
In the reading process of DBDeviceManager, the value is read from the connected equipment if this
value is True, but not if it is False. Only some values of registered device can be read because read
processing of this object can be disabled temporarily by specifying value to False.

● References
"ValueRead"(4-75 page)
"ReadAll"(4-56 page)

● Usage Example

Private Function Device_IsReadEnable(ByVal iItemNo As Integer) As String


Dim Device As DATABUILDERAXLibLB.DBDevice
Dim strReadEnable As String

Device = AxDBDeviceManager1.Devices.Item(iItemNo)
If (Device.ReadEnabled = True) Then
strReadEnable = "ReadEnable"
Else
strReadEnable = "ReadDisable"
End If
Device_IsReadEnable = strReadEnable
End Function

Private Sub RadioButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles _


RadioButton1.Click
TextBox1.Text = Device_IsReadEnable(1)
End Sub

4-78 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBDeviceManager DBDevices DBDevice

 WriteEnabled Property

Enables and disables writing into the connected equipment.

Communication status Value acquisition Value setting

Property Method Event


Communication suspended Yes Yes
Communicating Yes Yes

● Syntax
When obtaining: value = DBDevice.WriteEnabled
When setting: DBDevice.WriteEnabled = value

Value Description Type

value
Boolean value to indicate whether writing
Boolean
4
is enabled or disabled

Details of Properties/Methods/Events
Keyword available for value

Keyword Description
True Enabled
False Disabled

● Explanation
In the writing process of DBDeviceManager, value is written into the connected equipment if this value
is True, but not if it is False. Only some values of registered device can be written because writing
process of this object can be disabled temporarily by specifying value to False.

● References
“DBDevice.ValueWrite” (4-76 page)
"WriteAll"(4-57 page)

● Usage Example

Private Function Device_IsWriteEnable(ByVal iItemNo As Integer) As String


Dim Device As DATABUILDERAXLibLB.DBDevice
Dim strWriteEnable As String

Device = AxDBDeviceManager1.Devices.Item(iItemNo)
If (Device.WriteEnabled = True) Then
strWriteEnable = "WriteEnable"
Else
strWriteEnable = "WriteDisable"
End If
Device_IsWriteEnable = strWriteEnable
End Function

Private Sub RadioButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles _


RadioButton1.Click
TextBox1.Text = Device_IsWriteEnable(1)
End Sub

- KV COM+ Library User’s Manual - 4-79


4-2 Details of Properties/Methods/Events

DBDeviceManager DBDevices DBDevice

 RTLDataSize Property

Obtains data size of the device used for real time logging.

Communication status Value acquisition Value setting


Property Method Event

Communication suspended Yes No


Communicating Yes No

● Syntax
When obtaining: value=DBDevice.RTLDataSize

Value Description Type

4 value Value to indicate data size Integer

Value for ‘value’


Details of Properties/Methods/Events

Value Description
1 One word
2 Two words

● Explanation
Obtains data size of the device but cannot set it.

● References
“DBDevices.AddRTL” (4-69 page)
“DBDevices.InsertRTL” (4-71 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim sDataSize As Short
Dim sDataType As Integer
Dim sDispType As integer
Dim sRTLManagerIdx As Integer
sDataSize = AxDBRTLoggingManager1.Devices.Item(1).RTLDataSize
sDataType = AxDBRTLoggingManager1.Devices.Item(1).RTLDataType
sDispType = AxDBRTLoggingManager1.Devices.Item(1).RTLDispType
sRTLManagerIdx = AxDBRTLoggingManager1.Devices.Item(1).RTLManageIndex
End Sub

4-80 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBDeviceManager DBDevices DBDevice

 RTLDataType Property

Obtains data type of the device used for real time logging.

Communication status Value acquisition Value setting

Property Method Event


Communication suspended Yes No
Communicating Yes No

● Syntax
When obtaining: value=DBDevice.RTLDataType

Value Description Type


value Value to indicate data type Integer
4
Value for ‘value’

Details of Properties/Methods/Events
Constant Value Description
dtBit 0 Bit device
dtWord 1 Word device (16-bit)
dtDWord 2 Device (32-bit)

● Explanation
Obtains data type of the device but cannot set it.

● References
“DBDevices.AddRTL” (4-69 page)
“DBDevices.InsertRTL” (4-71 page)

● Usage Example
See usage example of "RTLDataSize"(4-80 page).

- KV COM+ Library User’s Manual - 4-81


4-2 Details of Properties/Methods/Events

DBDeviceManager DBDevices DBDevice

 RTLDispType Property

Obtains display type of the device used for real time logging.

Communication status Value acquisition Value setting


Property Method Event

Communication suspended Yes No


Communicating Yes No

● Syntax
When obtaining: value=DBDevice.RTLDispType

Value Description Type

4 value Value to indicate display type Integer

Value for ‘value’


Details of Properties/Methods/Events

Constant Value Description


dtBitVal 1 Bit(0/1)
dtSigned 11 Decimal number with sign
dtUnsigned 12 Decimal number without sign
dtHEX 13 Hexadecimal number
dtFloat 16 Floating point real number

● Explanation
Obtains display type of the device but cannot set it.

● References
“DBDevices.AddRTL” (4-69 page)
“DBDevices.InsertRTL” (4-71 page)

● Usage Example
See usage example of "RTLDataSize"(4-80 page).

4-82 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBDeviceManager DBDevices DBDevice

 RTLManageIndex Property

Obtains the management ID number used for real time logging.

Communication status Value acquisition Value setting

Property Method Event


Communication suspended Yes No
Communicating Yes No

● Syntax
When obtaining: value=DBDevice.RTLManageIndex

Value Description Type


value Management ID Integer
4
● Explanation

Details of Properties/Methods/Events
Obtains the management ID number of device but cannot set it.

● References
“DBDevices.AddRTL” (4-69 page)
“DBDevices.InsertRTL” (4-71 page)

● Usage Example
See usage example of "RTLDataSize"(4-80 page).

- KV COM+ Library User’s Manual - 4-83


4-2 Details of Properties/Methods/Events

DBTriggerManager

DBTriggerManager Object

Properties
Property Method Event

 Active Property

Obtains or sets whether a trigger is active/inactive.

Active Value acquisition Value setting


True (a trigger is active) Yes Yes

4 False (a trigger is inactive) Yes Yes

● Syntax
Details of Properties/Methods/Events

When obtaining: value = DBTriggerManager.Active


When setting: DBTriggerManager.Active = value

Value Description Type


value Whether a trigger is active/inactive Boolean

Keyword available for value

Keyword Description
True Active
False Inactive

● Explanation
Obtains or sets whether a trigger is active/inactive.
If “True,”a trigger occurs when trigger conditions are met.
If “False,”a trigger does not occur even when trigger conditions are met.
Whether a trigger is active/inactive can be set for entire Triggers collection.

● Usage Example

Private Sub RadioButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles _


RadioButton1.Click
If AxDBTriggerManager1.Active Then
AxDBTriggerManager1.Active = False
Else
AxDBTriggerManager1.Active = True
End If
End Sub

4-84 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager

 Triggers Property

Obtains DBTriggers collection but cannot set it.

Active Value acquisition Value setting

Property Method Event


True (active trigger) Yes No
False (inactive trigger) Yes No

● Syntax
Set triggers = DBTriggerManager.Triggers

Value Description Type


triggers Object to identify DBTriggers collection DBTriggers
4
● Explanation

Details of Properties/Methods/Events
Obtains DBTriggers collection. Cannot set it.
DBTriggers collection (object) is a collection of all triggers (DBTrigger) of DBTriggerManager.

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim a As DATABUILDERAXLibLB.DBTriggers

a = AxDBTriggerManager1.Triggers
MsgBox(a.Count)
End Sub

- KV COM+ Library User’s Manual - 4-85


4-2 Details of Properties/Methods/Events

DBTriggerManager

Events

 Fire Event
Property Method Event

Occurs every time when each trigger condition in DBTriggers collection is met.

● Syntax
Sub DBTriggerManager_Fire( )

Value Description Type


pTrigger Trigger object which trigger occurred DBTrigger

4 ● Explanation
Occurs every time when each trigger condition in DBTrigger collection is met.
Can obtain trigger object which trigger occurred.
Details of Properties/Methods/Events

● References
“DBTrigger.Type” (4-94 page)
“DBTrigger.Fire” (4-104 page)

● Usage Example

Private Sub AxDBTriggerManager1_Fire(ByVal sender As Object, ByVal e As _


AxDATABUILDERAXLibLB._IDBTriggerEvents_FireEvent) Handles AxDBTriggerManager1.Fire
'Display name and comment of specified trigger.
MsgBox(e.pTrigger.Name + " " + e.pTrigger.Description)
End Sub

4-86 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers

DBTriggers Object

Properties

Property Method Event


 Count Property

Obtains the number of triggers included in collection but cannot set it.

Active Value acquisition Value setting


True (active trigger) Yes No
False (inactive trigger) Yes No
4
● Syntax

Details of Properties/Methods/Events
value = Count

Value Description Type


value The number of triggers Long

● Explanation
Obtains the number of triggers included in collection but cannot set it.

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim a As DATABUILDERAXLibLB.DBTriggers

a = AxDBTriggerManager1.Triggers
MsgBox(a.Count)
End Sub

- KV COM+ Library User’s Manual - 4-87


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers

 Item Property

Obtains a trigger of specified index.

Active Value acquisition Value setting


Property Method Event

True (active trigger) Yes No


False (inactive trigger) Yes No

● Syntax
Set trigger = DBTriggers.Item(index)
or
Set trigger = DBTriggers(index)

4 Value Description Type


trigger Trigger object DBTrigger
Details of Properties/Methods/Events

index Index of each trigger Long

● Explanation
Obtains a trigger in the place identified by index.
The beginning of index is 1.
Runtime error occurs if index out of range is specified.

● References
“DBTriggers.Add” (4-89 page)
“DBTriggers.Remove” (4-90 page)
“DBTriggers.Count” (4-87 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim iCounter As Integer
Dim Triggers As DATABUILDERAXLibLB.DBTriggers
Dim Trigger As DATABUILDERAXLibLB.DBTrigger

Triggers = AxDBTriggerManager1.Triggers
For iCounter = 1 To Triggers.Count
Trigger = Triggers.Item(iCounter)
'Display name and comment of trigger.
MsgBox(Trigger.Name + " " + Trigger.Description + vbCrLf)
Next
End Sub

4-88 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers

Methods

 Add Method

Property Method Event


Adds a new trigger.
Reference This method can be executed during designing in the property page.
"Addition of Trigger Setting"(3-9 page)

Active Operation
True (active trigger) Yes
False (inactive trigger) Yes
4
● Syntax

Details of Properties/Methods/Events
Set trigger = Add(value)

Value Description Type


value Trigger type DBAxTriggerType or Long
trigger Trigger object DBTrigger

Trigger type

Constant Value Description


ttInterval 0 Cycle trigger
ttTimeAt 1 Time trigger
ttTimeSpan 2 Time range trigger
ttLogical 3 Combination trigger
ttCustom 4 Any trigger
ttDevice 5 Device trigger

● Explanation
Adds a new trigger.

● References
“DBTriggers.Remove” (4-90 page)
“DBTriggers.Clear” (4-91 page)
“DBTriggers.Item” (4-88 page)
“DBTriggers.Count” (4-87 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim NewTrigger As DATABUILDERAXLibLB.DBTrigger

NewTrigger = AxDBTriggerManager1.Triggers.Add _
(DATABUILDERAXLibLB.DBAxTriggerType.ttInterval)
NewTrigger.Name = "trgInterval"
NewTrigger.Description = "New cycle trigger"
NewTrigger.AsInterval.IntervalMSec = 3500
End Sub

- KV COM+ Library User’s Manual - 4-89


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers

 Remove Method

Removes a trigger.
Reference This method can be executed during designing in the property page.
Property Method Event

"Deletion of Trigger Setting"(3-21 page)

Active Operation
True (active trigger) Yes
False (inactive trigger) Yes

● Syntax

4 Remove(trigger)

Value Description Type


Details of Properties/Methods/Events

trigger Trigger object DBTrigger

● Explanation
Removes a trigger.
Runtime error occurs if a trigger created by other DBTriggers object is specified.

● References
“DBTriggers.Add” (4-89 page)
“DBTriggers.Clear” (4-91 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim RemoveTrigger As DATABUILDERAXLibLB.DBTrigger

RemoveTrigger = AxDBTriggerManager1.Triggers.Item(4)
Call AxDBTriggerManager1.Triggers.Remove(RemoveTrigger)
End Sub

4-90 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers

 Clear Method

Removes all triggers.

Active Operation

Property Method Event


True (active trigger) Yes
False (inactive trigger) Yes

● Syntax
DBTriggers.Clear

● Explanation
Removes all triggers.
4
● References

Details of Properties/Methods/Events
“DBTriggers.Add” (4-89 page)
“DBTriggers.Remove” (4-90 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim Answer As Long

Answer = MsgBox(" Do you want to clear all triggers? ", MsgBoxStyle.YesNo)


Select Case Answer
Case vbYes
AxDBTriggerManager1.Triggers.Clear()
Case vbNo
MsgBox("Trigger removal was canceled.")
End Select
End Sub

- KV COM+ Library User’s Manual - 4-91


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers

 FindByName Method

Finds a trigger by name.

Active Operation
Property Method Event

True (active trigger) Yes


False (inactive trigger) Yes

● Syntax
Set trigger = DBTriggers.FindByName(name)

Value Description Type

4 name
trigger
Name of searched trigger
Trigger object. Nothing is returned if name does not match.
String
DBTrigger
Details of Properties/Methods/Events

● Explanation
Finds a trigger by name.
Nothing is returned if the name does not match.

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim FindTrigger As DATABUILDERAXLibLB.DBTrigger

FindTrigger = AxDBTriggerManager1.Triggers.FindByName(TextBox1.Text)
If FindTrigger Is Nothing Then
Exit Sub
End If
Call MsgBox(" Trigger is found." + FindTrigger.Name)
End Sub

4-92 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger

DBTrigger Object

Properties

Property Method Event


 Name Property

Obtains or sets trigger name.


Reference This property can also be set in the property page
"Trigger setting for period"(3-10 page)
"Trigger Setting at time and time range"(3-11 page)
"Trigger Setting for device"(3-15 page) 4
"Trigger Setting to combine into already set trigger"(3-18 page)

Details of Properties/Methods/Events
"Set any trigger"(3-20 page)

Active Value acquisition Value setting


True (active trigger) Yes Yes
False (inactive trigger) Yes Yes

● Syntax
When obtaining: text = DBTrigger.Name
When setting: DBTrigger.Name = text

● Explanation
Obtains or sets trigger name.
Duplicated name cannot be specified in a single DBTriggerManager.

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim NewTrigger As DATABUILDERAXLibLB.DBTrigger

NewTrigger = AxDBTriggerManager1.Triggers.Add _
(DATABUILDERAXLibLB.DBAxTriggerType.ttInterval)
NewTrigger.Name = "trgInterval"
NewTrigger.Description = " New Cycle Trigger"
NewTrigger.AsInterval.IntervalMSec = 3500
End Sub

- KV COM+ Library User’s Manual - 4-93


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger

 Type Property

Obtains or sets a trigger type.


Reference This property can also be set in the property page
Property Method Event

"Addition of Trigger Setting"(3-9 page)

Active Value acquisition Value setting


True (active trigger) Yes Yes
False (inactive trigger) Yes Yes

● Syntax
4 When obtaining: value = Type
When setting: Type =value
Details of Properties/Methods/Events

Value Description Type


trigger Trigger type DBAxTriggerType or Long

"Trigger type"(4-89 page)

● Explanation
Obtains and sets a trigger type.
All trigger conditions set are removed if different type till then is specified.

● References
“DBTrigger.Fire” (4-104 page)
"Param"(4-97 page)
“DBTrigger.AsInterval” (4-98 page)
"AsTimeAt"(4-99 page)
"AsTimeSpan"(4-100 page)
"AsLogical"(4-101 page)
"AsCustom"(4-102 page)
"AsDevice"(4-103 page)

● Usage Example

Private Sub Trigger_Type(ByVal Index As Integer)


Dim trigger As DATABUILDERAXLibLB.DBTrigger
Dim strTrgType As String
trigger = AxDBTriggerManager1.Triggers.Item(Index)
If (trigger.Type = DATABUILDERAXLibLB.DBAxTriggerType.ttInterval) Then
strTrgType = " Cycle"
Else
sstrTrgType = " Others"
End If
MsgBox(" Trigger type:" + strTrgType)
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Trigger_Type(1)
End Sub

4-94 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger

 Description Property

Obtains or sets a trigger comment.


Reference This property can also be set in the property page

Property Method Event


"Trigger setting for period"(3-10 page)
"Trigger Setting at time and time range"(3-11 page)
"Trigger Setting for device"(3-15 page)
"Trigger Setting to combine into already set trigger"(3-18 page)
"Set any trigger"(3-20 page)

Active Value acquisition Value setting


True (active trigger)
False (inactive trigger)
Yes
Yes
Yes
Yes
4

Details of Properties/Methods/Events
● Syntax
When obtaining: text = DBTrigger.Description
When setting: DBTrigger.Description = text

Value Description Type


text Trigger comment String

● Explanation
Obtains or sets a trigger comment.

● Usage Example
See usage example of "Name"(4-93 page).

- KV COM+ Library User’s Manual - 4-95


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger

 IsOn Property

Obtains trigger status but cannot set it.

Active Value acquisition Value setting


Property Method Event

True (active trigger) Yes No


False (inactive trigger) Yes No

● Syntax
value = DBTrigger.IsOn

Value Description Type

4 value Trigger status Boolean

Value for ‘value’


Details of Properties/Methods/Events

Keyword Description
True Trigger condition is met.
False Trigger condition is not met.

● Explanation
Obtains trigger status. Value is True if trigger condition is met, but cannot set it.

● References
“DBTrigger.Fire” (4-104 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim strMsg As String

If AxDBTriggerManager1.Triggers.Item(1).IsOn = True Then


strMsg = "ON"
Else
strMsg = "OFF"
End If
MsgBox(" Trigger" + strMsg + vbCrLf)
End Sub

4-96 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger

 Param Property

Obtains trigger object but cannot set it.

Active Value acquisition Value setting

Property Method Event


True (active trigger) Yes No
False (inactive trigger) Yes No

● Syntax
Set trigger = DBTrigger.Param

Value Description Type


DBTriggerParamInterval
DBTriggerParamTimeAt 4
DBTriggerParamTimeSpan
trigger Trigger object

Details of Properties/Methods/Events
DBTriggerParamLogical
DBTriggerParamCustom
DBTriggerParamDevice

● Explanation
Obtains trigger object but cannot set it.
Type of trigger object depends on Type property value of DBTrigger object.
Trigger object can also be obtained by using AsInterval, AsTimeAt, AsTimeSpan, AsLogical, AsCustom,
or AsDevice property.

● References
“DBTrigger.Type” (4-94 page)
“DBTrigger.AsInterval” (4-98 page)
"AsTimeAt"(4-99 page)
"AsTimeSpan"(4-100 page)
"AsLogical"(4-101 page)
"AsCustom"(4-102 page)
"AsDevice"(4-103 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim SetMs As Integer
Dim trgInterval As DATABUILDERAXLibLB.DBTriggerParamInterval

trgInterval = AxDBTriggerManager1.Triggers.Item(1).Param
SetMs = Integer.Parse(TextBox1.Text)
trgInterval.IntervalMSec = SetMs
End Sub

- KV COM+ Library User’s Manual - 4-97


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger

 AsInterval Property

Obtains cyclic trigger object but cannot set it.

Active Value acquisition Value setting


Property Method Event

True (active trigger) Yes No


False (inactive trigger) Yes No

● Syntax
Set trigger = AsInterval

● Explanation

4 Obtains cyclic trigger object but cannot set it.


If trigger type is not cyclic, runtime error occurs.

● References
Details of Properties/Methods/Events

“DBTrigger.Type” (4-94 page)


"Param"(4-97 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim NewTrigger As DATABUILDERAXLibLB.DBTrigger
Dim trgInterval As DATABUILDERAXLibLB.DBTriggerParamInterval

NewTrigger = AxDBTriggerManager1.Triggers.Add _
(DATABUILDERAXLibLB.DBAxTriggerType.ttInterval)
NewTrigger.Name = "trgInterval"
NewTrigger.Description = " New cyclic trigger"
trgInterval = NewTrigger.AsInterval
trgInterval.IntervalMSec = 3500
End Sub

4-98 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger

 AsTimeAt Property

Obtains time trigger object but cannot set it.

Active Value acquisition Value setting

Property Method Event


True (active trigger) Yes No
False (inactive trigger) Yes No

● Syntax
Set trigger= DBTrigger.AsTimeAt

● Explanation
Obtains time trigger object but cannot set it.
If trigger type is not time trigger, runtime error occurs. 4
● References

Details of Properties/Methods/Events
“DBTrigger.Type” (4-94 page)
"Param"(4-97 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim NewTrigger As DATABUILDERAXLibLB.DBTrigger
Dim trgTimeAt As DATABUILDERAXLibLB.DBTriggerParamTimeAt

NewTrigger = AxDBTriggerManager1.Triggers.Add _
(DATABUILDERAXLibLB.DBAxTriggerType.ttTimeAt)
NewTrigger.Name = "trgTimeAt"
NewTrigger.Description = " New time trigger"
trgTimeAt = NewTrigger.AsTimeAt
trgTimeAt.Year = 2010
trgTimeAt.Month = 6
trgTimeAt.Day = 10
trgTimeAt.Hour = 12
trgTimeAt.Minute = 30
trgTimeAt.Second = 0
trgTimeAt.DayOfWeek = &H8
trgTimeAt.Edge = False
End Sub

- KV COM+ Library User’s Manual - 4-99


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger

 AsTimeSpan Property

Obtains time range trigger object but cannot set it.

Active Value acquisition Value setting


Property Method Event

True (active trigger) Yes No


False (inactive trigger) Yes No

● Syntax
Set trigger = DBTrigger.AsTimeSpan

Value Description Type

4 trigger Time range trigger object DBTriggerParamTimeSpan

● Explanation
Details of Properties/Methods/Events

Obtains time range trigger object but cannot set.


If trigger type is not time range trigger, runtime error occurs.

● References
“DBTrigger.Type” (4-94 page)
"Param"(4-97 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim NewTrigger As DATABUILDERAXLibLB.DBTrigger
Dim trgTimeSpan As DATABUILDERAXLibLB.DBTriggerParamTimeSpan

NewTrigger = AxDBTriggerManager1.Triggers.Add _
(DATABUILDERAXLibLB.DBAxTriggerType.ttInterval)
NewTrigger.Name = "trgTimeSpan"
NewTrigger.Description = " New time range trigger"
trgTimeSpan = NewTrigger.AsTimeSpan
trgTimeSpan.TimeFrom = #8:00:00 AM#
trgTimeSpan.TimeTo = #9:45:15 AM#
End Sub

4-100 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger

 AsLogical Property

Obtains combination trigger object but cannot set it.

Active Value acquisition Value setting

Property Method Event


True (active trigger) Yes No
False (inactive trigger) Yes No

● Syntax
Set trigger = DBTrigger.AsLogical

Value Description Type


trigger Combination trigger object DBTriggerParamLogical
4
● Explanation

Details of Properties/Methods/Events
Obtains combination trigger object but cannot set it.
If trigger type is not combination trigger, runtime error occurs.

● References
“DBTrigger.Type” (4-94 page)
"Param"(4-97 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim NewTrigger As DATABUILDERAXLibLB.DBTrigger
Dim trgLogical As DATABUILDERAXLibLB.DBTriggerParamLogical

NewTrigger = AxDBTriggerManager1.Triggers.Add _
(DATABUILDERAXLibLB.DBAxTriggerType.ttLogical)
NewTrigger.Name = "trgLogical"
NewTrigger.Description = " New combination trigger"
trgLogical = NewTrigger.AsLogical
trgLogical.Type = DATABUILDERAXLibLB.DBTriggerLogicType.ltAnd
trgLogical.Trigger1 = AxDBTriggerManager1.Triggers.Item(1)
trgLogical.Trigger2 = AxDBTriggerManager1.Triggers.Item(2)
End Sub

- KV COM+ Library User’s Manual - 4-101


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger

 AsCustom Property

Obtains any trigger object but cannot set it.

Active Value acquisition Value setting


Property Method Event

True (active trigger) Yes No


False (inactive trigger) Yes No

● Syntax
Set trigger = DBTrigger.AsCustom

Value Description Type

4 trigger Any trigger object DBTriggerParamCustom

● Explanation
Details of Properties/Methods/Events

Obtains any trigger object but cannot set it.


If trigger type is not any trigger, runtime error occurs.

● References
“DBTrigger.Type” (4-94 page)
"Param"(4-97 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim NewTrigger As DATABUILDERAXLibLB.DBTrigger
Dim trgCustom As DATABUILDERAXLibLB.DBTriggerParamCustom

NewTrigger = AxDBTriggerManager1.Triggers.Add _
(DATABUILDERAXLibLB.DBAxTriggerType.ttCustom)
NewTrigger.Name = "trgCustom"
NewTrigger.Description = " New custom trigger"
trgCustom = NewTrigger.AsCustom
trgCustom.OneShot = True
End Sub

4-102 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger

 AsDevice Property

Obtains device trigger object but cannot set it.

Active Value acquisition Value setting

Property Method Event


True (active trigger) Yes No
False (inactive trigger) Yes No

● Syntax
Set trigger=DBTrigger.AsDevice

Value Description Type


trigger Device trigger object DBTriggerParamDevice
4
● Explanation

Details of Properties/Methods/Events
Obtains device trigger object but cannot set it.
If trigger type is not device, runtime error occurs.

● References
“DBTrigger.Type” (4-94 page)
"Param"(4-97 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button1.Click
Dim NewTrigger As DATABUILDERAXLibLB.DBTrigger
Dim trgDevice As DATABUILDERAXLibLB.DBTriggerParamDevice
NewTrigger = AxDBTriggerManager1.Triggers.Add _
(DATABUILDERAXLibLB.DBAxTriggerType.ttDevice)
NewTrigger.Name = "trgDevice"
NewTrigger.Description = "New device trigger"
trgDevice = NewTrigger.AsDevice
trgDevice.CommManager = AxDBCommManager1.GetOcx
'To use the SetDevice method
trgDevice.SetDevice(DATABUILDERAXLibLB.DBPlcDevice.KV5000_MR, "100")
'To use DeviceKind and properties
'trgDevice.DeviceKind = DATABUILDERAXLibLB.DBPlcDevice.KV5000_MR
'trgDevice.DeviceNo = "100"
trgDevice.DeviceCondition = 1
trgDevice.TriggerBitReset = True
End Sub

- KV COM+ Library User’s Manual - 4-103


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger

Events

 Fire Events
Property Method Event

Occurs when trigger condition is met.

● Syntax
Sub DBTrigger_Fire(ByVal pTrigger As DBTrigger)

Value Description
pTrigger Trigger object which issues event

4 ● Explanation
Occurs every time when trigger condition is met.
Details of Properties/Methods/Events

● References
“DBTrigger.Type” (4-94 page)
"Param"(4-97 page)
“DBTrigger.AsInterval” (4-98 page)
"AsTimeAt"(4-99 page)
"AsTimeSpan"(4-100 page)
"AsLogical"(4-101 page)
"AsCustom"(4-102 page)
"AsDevice"(4-103 page)

● Usage Example

Private WithEvents MyTrigger As DATABUILDERAXLibLB.DBTrigger

Private Sub AddMyTrigger()


With AxDBTriggerManager1
MyTrigger = .Triggers.Add(DATABUILDERAXLibLB.DBAxTriggerType.ttInterval)
MyTrigger.AsInterval.IntervalMSec = 2000
.Active = True
End With
AxDBTriggerManager1.Active = True
End Sub

Private Sub MyTrigger_Fire(ByVal pTrigger As DATABUILDERAXLibLB.DBTrigger) Handles _


MyTrigger.Fire
MsgBox("MyTrigger")
End Sub

4-104 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamTimeAt

DBTriggerParamInterval Object

Properties

Property Method Event


 IntervalMSec Property

Obtains or sets cycle of trigger occurrence by millisecond.


Reference This property can also be set in the property page
"Trigger setting for period"(3-10 page)

Active
True (active trigger)
Value acquisition
Yes
Value setting
Yes
4

Details of Properties/Methods/Events
False (inactive trigger) Yes Yes

● Syntax
When obtaining: value = DBTriggerParamInterval.IntervalMSec
When setting: DBTriggerParamInterval.IntervalMSec = value

Value Description Type


Cycle of trigger occurrence (by
value Long
millisecond)

● Explanation
Obtains or sets cycle of trigger occurrence by millisecond.
When specifying to 0, triggers occur consecutively.
When specifying less than 0, runtime error occurs.

● Usage Example
See usage example of “DBTrigger.AsInterval” (4-98 page).

- KV COM+ Library User’s Manual - 4-105


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamTimeAt

DBTriggerParamTimeAt Object

Properties
Property Method Event

 Year Property

Obtains or sets year condition.


Reference This property can also be set in the property page.
"Trigger Setting at time and time range"(3-11 page)

4 Active
True (active trigger)
Value acquisition
Yes
Value setting
Yes
Details of Properties/Methods/Events

False (inactive trigger) Yes Yes

● Syntax
When obtaining: value = DBTriggerParamTimeAt.Year
When setting: DBTriggerParamTimeAt.Year = value

Value Description Type


Year condition. When excluding from
value Integer
condition, set to -1.

● Explanation
Obtains or sets year condition.
2000 - 2037 or - 1 can be set.
When setting to -1, this condition is ignored.
Runtime error occurs when value out of range is specified.

● Usage Example
See usage example of “DBTrigger.AsTimeAt” (4-99 page).

4-106 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamTimeAt

 Month Property

Obtains or sets month condition.


Reference This property can also be set in the property page.

Property Method Event


"Trigger Setting at time and time range"(3-11 page)

Active Value acquisition Value setting


True (active trigger) Yes Yes
False (inactive trigger) Yes Yes

● Syntax
When obtaining: value = DBTriggerParamTimeAt.Month
When setting: DBTriggerParamTimeAt.Month = value 4
Value Description Type

Details of Properties/Methods/Events
Month condition. When excluding from
value Integer
condition, set to -1.

● Explanation
Obtains or sets month condition.
1 - 12 or - 1 can be set.
When setting to -1, this condition is ignored.
Runtime error occurs when value out of range is specified.

● Usage Example
See usage example of “DBTrigger.AsTimeAt” (4-99 page).

- KV COM+ Library User’s Manual - 4-107


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamTimeAt

 Day Property

Obtains or sets day condition.


Reference This property can also be set in the property page.
Property Method Event

"Trigger Setting at time and time range"(3-11 page)

Active Value acquisition Value setting


True (active trigger) Yes Yes
False (inactive trigger) Yes Yes

● Syntax

4 When obtaining: value = DBTriggerParamTimeAt.Day


When setting: DBTriggerParamTimeAt.Day = value

Value Description Type


Details of Properties/Methods/Events

Day condition. When excluding from


value Integer
condition, set to -1.

● Explanation
Obtains or sets day condition.
1 - 31 or - 1 can be set.
When setting to -1, this condition is ignored.
Runtime error occurs when value out of range is specified.

● Usage Example
See usage example of "AsTimeAt"(4-99 page).

4-108 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamTimeAt

 Hour Property

Obtains or sets hour condition.


Reference This property can also be set in the property page.

Property Method Event


"Trigger Setting at time and time range"(3-11 page)

Active Value acquisition Value setting


True (active trigger) Yes Yes
False (inactive trigger) Yes Yes

● Syntax
When obtaining: value = DBTriggerParamTimeAt.Hour
When setting: DBTriggerParamTimeAt.Hour = value 4
Value Description Type

Details of Properties/Methods/Events
Hour condition. When excluding from
value Integer
condition, set to -1.

● Explanation
Obtains or sets hour condition.
0 - 23 or - 1 can be set.
When setting to -1, this condition is ignored.
Runtime error occurs when value out of range is specified.

● Usage Example
See usage example of “DBTrigger.AsTimeAt” (4-99 page).

- KV COM+ Library User’s Manual - 4-109


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamTimeAt

 Minute Property

Obtains or sets minute condition.


Reference This property can also be set in the property page.
Property Method Event

"Trigger Setting at time and time range"(3-11 page)

Active Value acquisition Value setting


True (active trigger) Yes Yes
False (inactive trigger) Yes Yes

● Syntax

4 When obtaining: value = DBTriggerParamTimeAt.Minute


When setting: DBTriggerParamTimeAt.Minute = value

Value Description Type


Details of Properties/Methods/Events

Minute condition. When excluding from


value Integer
condition, set to -1.

● Explanation
Obtains or sets minute condition.
0 - 59 or - 1 can be set.
When setting to -1, this condition is ignored.
Runtime error occurs when value out of range is specified.

● Usage Example
See usage example of “DBTrigger.AsTimeAt” (4-99 page).

4-110 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamTimeAt

 Second Property

Obtains or sets second condition.


Reference This property can also be set in the property page.

Property Method Event


"Trigger Setting at time and time range"(3-11 page)

Active Value acquisition Value setting


True (active trigger) Yes Yes
False (inactive trigger) Yes Yes

● Syntax
When obtaining: value = DBTriggerParamTimeAt.Second
When setting: DBTriggerParamTimeAt.Second = value 4
Value Description Type

Details of Properties/Methods/Events
Second condition. When excluding from
value Integer
condition, set to -1.

● Explanation
Obtains or sets second condition.
0 - 59 or - 1 can be set.
When setting to -1, this condition is ignored.
Runtime error occurs when value out of range is specified.

● Usage Example
See usage example of “DBTrigger.AsTimeAt” (4-99 page).

- KV COM+ Library User’s Manual - 4-111


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamTimeAt

 DayOfWeek Property

Obtains or sets day of week condition.


Reference This property can also be set in the property page.
Property Method Event

"Trigger Setting at time and time range"(3-11 page)

Active Value acquisition Value setting


True (active trigger) Yes Yes
False (inactive trigger) Yes Yes

● Syntax

4 When obtaining: value = DBTriggerParamTimeAt.DayOfWeek


When setting: DBTriggerParamTimeAt.DayOfWeek = value

Value Description Type


Details of Properties/Methods/Events

Day of week condition. If excluding from


value DBDayOfWeek or Long
condition, set to -1.

● Explanation
Obtains or sets day of week condition.
Values are the combinations below (OR specification):

Constant Value Day of week


dowSun &H1 Sunday
dowMon &H2 Monday
dowTue &H4 Tuesday
dowWed &H8 Wednesday
dowThu &H10 Thursday
dowFri &H20 Friday
dowSat &H40 Saturday

When setting to -1, this condition is ignored.


Runtime error occurs when value out of range is specified.

● Usage Example
See usage example of “DBTrigger.AsTimeAt” (4-99 page).

4-112 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamTimeAt

 Edge Property

Obtains or sets condition of trigger occurrence (edge or level).


Reference This property can also be set in the property page.

Property Method Event


"Trigger Setting at time and time range"(3-11 page)

Active Value acquisition Value setting


True (active trigger) Yes Yes
False (inactive trigger) Yes Yes

● Syntax
When obtaining: value = DBTriggerParamTimeAt.Edge
When setting: DBTriggerParamTimeAt.Edge = value 4
Value Description Type

Details of Properties/Methods/Events
value Condition of trigger occurrence (edge or level) Boolean

Keyword available for value

Keyword Description
True Trigger occurs only once when specified time condition is met.
Triggers occur consecutively as long as specified time
False
condition is met.

● Explanation
Obtains or sets condition of trigger occurrence (edge or level).
In True, trigger occurs only once when specified time condition is met (edge).
In False, triggers occur consecutively as long as specified time condition is met (level).

● Usage Example
See usage example of “DBTrigger.AsTimeAt” (4-99 page).

- KV COM+ Library User’s Manual - 4-113


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamTimeSpan

DBTriggerParamTimeSpan Object

Properties
Property Method Event

 TimeFrom Property

Specifies start time of trigger occurrence.


Reference This property can also be set in the property page.
"Trigger Setting at time and time range"(3-11 page)

4 Active
True (active trigger)
Value acquisition
Yes
Value setting
Yes
Details of Properties/Methods/Events

False (inactive trigger) Yes Yes

● Syntax
When obtaining: time = DBTriggerParamTimeSpan.TimeFrom
When setting: DBTriggerParamTimeSpan.TimeFrom = time

Value Description Type


time Start time of trigger occurrence Variant

Format of time
For Date: #a:b:c#
For String: "a:b:c"
a - Hour (0 - 23)
b - Minute (0 - 59)
c - Second (0 - 59)

● Explanation
Specifies start time of trigger occurrence.
Start time of trigger occurrence includes time specified with TimeFrom property.
When time after TimeTo is specified, trigger occurs until TimeTo time of the next day is reached.
Runtime error occurs when invalid value as time specification is specified.

● References
"TimeTo"(4-115 page)

● Usage Example
See usage example of “DBTrigger.AsTimeAt” (4-99 page).

4-114 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamTimeSpan

 TimeTo Property

Specifies end time of trigger occurrence.


Reference This property can also be set in the property page.

Property Method Event


"Trigger Setting at time and time range"(3-11 page)

Active Value acquisition Value setting


True (active trigger) Yes Yes
False (inactive trigger) Yes Yes

● Syntax
When obtaining: time = DBTriggerParamTimeSpan.TimeTo
When setting: DBTriggerParamTimeSpan.TimeTo = time 4
Value Description Type

Details of Properties/Methods/Events
time End time of trigger occurrence Variant

Format of time
For Date: #a:b:c#
For String: "a:b:c"
a - Hour (0 - 23)
b - Minute (0 - 59)
c - Second (0 - 59)

● Explanation
Specifies end time of trigger occurrence.
End time of trigger occurrence includes time specified with TimeTo property.
When time before TimeFrom is specified, trigger occurs until TimeFrom time of the next day is reached.
Runtime error occurs when invalid value as time specification is specified.

● References
"TimeFrom"(4-114 page)

● Usage Example
See usage example of “DBTrigger.AsTimeAt” (4-99 page).

- KV COM+ Library User’s Manual - 4-115


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamLogical

DBTriggerParamLogical Object

Properties
Property Method Event

 Type Property

Specifies logic condition of combination


Reference This property can also be set in the property page.
"Trigger Setting to combine into already set trigger"(3-18 page)

4 Active
True (active trigger)
Value acquisition
Yes
Value setting
Yes
Details of Properties/Methods/Events

False (inactive trigger) Yes Yes

● Syntax
When obtaining: value = DBTriggerParamLogical.Type
When setting: DBTriggerParamLogical.Type = value

Value Description Type


DBTriggerLogicType or
value Type of combination
Long

Type of combination

Constant Value Description


ltAnd 0 Trigger occurs as long as both Trigger1 and Trigger2 are ON.
ltOr 1 Trigger occurs as long as Trigger1, Trigger2 or both are ON.
ltNot 2 Trigger occurs as long as Trigger1 is OFF. Trigger2 is ignored.

● References
"Trigger1"(4-117 page)
"Trigger2"(4-118 page)

● Explanation
Specifies type of combination.
When combination type is ltAnd, both Trigger1 and Trigger2 are set.
When either of them is set, trigger does not occur.
For ltOr, either of Trigger1 or Trigger2 property, or both are set.
For ltNot, Trigger1 property is set. Trigger2 property is ignored.
Exception error occurs when invalid value as type is specified.

● Usage Example
See usage example of “DBTrigger.AsLogical” (4-101 page).

4-116 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamLogical

 Trigger1 Property

Obtains or sets trigger1 to be combined.


Reference This property can also be set in the property page.

Property Method Event


"Trigger Setting to combine into already set trigger"(3-18 page)

Active Value acquisition Value setting


True (active trigger) Yes Yes
False (inactive trigger) Yes Yes

● Syntax
When obtaining: trigger = DBTriggerParamLogical.Trigger1
When setting: DBTriggerParamLogical.Trigger1= trigger 4
Value Description Type

Details of Properties/Methods/Events
trigger Trigger to be combined DBTrigger

● Explanation
Specifies the first trigger to be combined.
Be sure to specify this if combination type of Type property is ltAnd or ltNot.

● References
“DBTriggerParamLogical.Type” (4-94 page)
"Trigger2"(4-118 page)

● Usage Example
See usage example of “DBTrigger.AsLogical” (4-101 page).

- KV COM+ Library User’s Manual - 4-117


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamLogical

 Trigger2 Property

Obtains or sets trigger2 to be combined.


Reference This property can also be set in the property page.
Property Method Event

"Trigger Setting to combine into already set trigger"(3-18 page)

Active Value acquisition Value setting


True (active trigger) Yes Yes
False (inactive trigger) Yes Yes

● Syntax

4 When obtaining: trigger = DBTriggerParamLogical.Trigger2


When setting: DBTriggerParamLogical.Trigger2= trigger

Value Description Type


Details of Properties/Methods/Events

trigger Trigger to be combined DBTrigger

● Explanation
Specifies the second trigger to be combined.
Be sure to specify this if combination type of Type property is ltAnd.
If ltNot, this property is ignored.

● References
“DBTriggerParamLogical.Type” (4-94 page)
"Trigger1"(4-117 page)

● Usage Example
See usage example of “DBTrigger.AsLogical” (4-101 page).

4-118 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamCustom

DBTriggerParamCustom Object

Properties

Property Method Event


 OneShot Property

Obtains or sets automatic OFF setting of trigger.


Reference This property can also be set in the property page.
"Set any trigger"(3-20 page)

Active
True (active trigger)
Value acquisition
Yes
Value setting
Yes
4

Details of Properties/Methods/Events
False (inactive trigger) Yes Yes

● Syntax
When obtaining: value = DBTriggerParamCustom.OneShot
When setting: DBTriggerParamCustom.OneShot = value

Value Description Type


Obtains or sets automatic OFF setting of
value Boolean
trigger.

Keyword available for value

Keyword Description
True Sets automatic OFF of trigger.
False Does not set automatic OFF of trigger.

● Explanation
Controls trigger after SetState method turns trigger ON.
In True, trigger becomes OFF immediately after Fire event occurs.
In False, triggers occur consecutively until SetState method turns trigger OFF.

● References
"TimeTo"(4-115 page)

● Usage Example
See usage example of “DBTrigger.AsCustom” (4-102 page).

- KV COM+ Library User’s Manual - 4-119


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamCustom

Methods

 SetState Method
Property Method Event

Sets status of any trigger.

Active Operation
True (active trigger) Yes
False (inactive trigger) Yes

● Syntax

4 DBTriggerParamCustom. SetState value

Value Description Type


Details of Properties/Methods/Events

value Specifies trigger status. Boolean

Keyword available for value

Keyword Description
True Sets status of any trigger ON.
False Sets status of any trigger OFF.

● Explanation
Sets status of any trigger.
When setting to True, trigger status is set to ON and trigger occurs.

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim trgCustom As DATABUILDERAXLibLB.DBTriggerParamCustom
trgCustom = AxDBTriggerManager1.Triggers.Item(1).AsCustom
Call trgCustom.SetState(True)
End Sub

4-120 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamDevice

DBTriggerParamDevice Object

Properties

Property Method Event


 CommManager Property

Obtains or sets referred Commanagement object (DBCommManager).


Reference This property can also be set in the property page.
"Communication manager Object"(3-23 page)

Communication status
Communication suspended
Value acquisition
Yes
Value setting
Yes
4

Details of Properties/Methods/Events
Communicating Yes Yes

● Syntax
When obtaining: Set dbcomm=DBTriggerParamDevice.CommManager
When setting: Set DBTriggerParamDevice.CommManager=dbcomm

Value Description Type


dbcomm Commanagement object Object

● Explanation
Obtains or sets Commanagement object.
Sets device of the connected equipment which object specified with this property communicates with as
trigger.
When referring control object, use GetOcx * property.
When setting is changed, device is converted.
For more information, see "Model Change"(A-9 page).
* When you use Visual Basic 6.0, use object property.

● References
“DBCommManager.Active” (4-24 page)

● Usage Example
See “DBTrigger.AsDevice” (4-103 page).

- KV COM+ Library User’s Manual - 4-121


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamDevice

 DeviceKind Property

Obtains or sets device type.

Point
Property Method Event

To set a device, we recommend using the SetDevice method, which checks the device type
and device number.

Communication status Value acquisition Value setting


Communication suspended Yes Yes
Communicating Yes Yes

4 ● Syntax
When obtaining: Set value=DBTriggerParamDevice.DeviceKind
When setting: Set DBTriggerParamDevice.DeviceKind=value
Details of Properties/Methods/Events

Value Description Type


value Device type DBPlcDevice

● Explanation
Obtains or sets device type set as trigger device.
A device specified with this property and DeviceNo property is monitored as trigger device.

● References
"DeviceNo"(4-123 page)

● Usage Example
See usage example of “DBTrigger.AsDevice” (4-103 page).

4-122 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamDevice

 DeviceNo Property

Obtains or sets device number.

Point

Property Method Event


To set a device, we recommend using the SetDevice method, which checks the device type
and device number.

Communication status Value acquisition Value setting


Communication suspended Yes Yes
Communicating Yes Yes

● Syntax
When obtaining: Set text=DBTriggerParamDevice.DeviceNo
4
When setting: Set DBTriggerParamDevice.DeviceNo=text

Details of Properties/Methods/Events
Value Description Type
text Device number String

● Explanation
Obtains or sets device number set as trigger device.
A device specified with this property and DeviceKind property is monitored as trigger device.

● References
"DeviceKind"(4-122 page)

● Usage Example
See usage example of “DBTrigger.AsDevice” (4-103 page).

- KV COM+ Library User’s Manual - 4-123


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamDevice

 DeviceCondition Property

Obtains or sets device condition.

Communication status Value acquisition Value setting


Property Method Event

Communication suspended Yes Yes


Communicating Yes Yes

● Syntax
When obtaining: Set value=DBTriggerParamDevice.DeviceCondition
When setting: Set DBTriggerParamDevice.DeviceCondition=value

Value Description Type


4 value Trigger condition Long
Details of Properties/Methods/Events

Value for ‘value’

Value Status
1 ↑
2 ↓
3 ↑↓
4 ON
5 OFF

● Explanation
Obtains and sets occurrence condition of trigger occurred by bit device status specified with
DeviceKind and DeviceNo properties.
When value out of range is input, runtime error occurs.

● References
"DeviceKind"(4-122 page)

● Usage Example
See usage example of “DBTrigger.AsDevice” (4-103 page).

4-124 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamDevice

 TriggerBitReset Property

Obtains or sets whether trigger bit should be reset.

Communication status Value acquisition Value setting

Property Method Event


Communication suspended Yes Yes
Communicating Yes Yes

● Syntax
When obtaining: Set value=DBTriggerParamDevice.TriggerBitReset
When setting: Set DBTriggerParamDevice. TriggerBitReset =value

Value Description Type


value Condition to reset trigger bit Boolean 4

Details of Properties/Methods/Events
Value for ‘value’
0: Reset trigger bit after trigger occurs.
1: Do not reset trigger bit after trigger occurs.

● Explanation
Obtains or sets whether trigger bit should be reset after trigger condition occurs.
Referred only when trigger condition is " ↑ " or " ↓ ," trigger bit does not be reset for other set value
(OFF if trigger condition is " ↑ ," On if " ↓ ").

● References
"DeviceCondition"(4-124 page)

● Usage Example
See usage example of “DBTrigger.AsDevice” (4-103 page).

- KV COM+ Library User’s Manual - 4-125


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamDevice

 ErrorConnect Property

Obtains connection status, but cannot set it.

Communication status Value acquisition Value setting


Property Method Event

Communication suspended Yes No


Communicating Yes No

● Syntax
When obtaining: Set value=DBTriggerParamDevice.ErrorConnect

Value Description Type

4 value Connection error status Boolean

Value for ‘value’


Details of Properties/Methods/Events

Value Description
True Connection error in DBCommManager
False No connection error in DBCommManager.

● Explanation
Obtains connection status of Commanagement object (DBCommManager), but cannot set it.
True: Connection error occurs.
False: Connection error does not occur.

● References
"CommManager"(4-121 page)

● Usage Example

Private Sub AxDBTriggerManager1_Error(ByVal sender As Object, ByVal e As _


AxDATABUILDERAXLibLB._IDBTriggerEvents_ErrorEvent) Handles AxDBTriggerManager1.Error
Dim errConnect As Boolean

errConnect = AxDBTriggerManager1.Triggers(1).AsDevice.ErrorConnect
End Sub

4-126 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamDevice

 ClearError Method

Clears communication error status.

Communication status Operation

Property Method Event


Communication suspended Yes
Communicating Yes

● Syntax
DBTriggerParamDevice.ClearError

● Explanation
Clears connection error status of Commanagement object (DBCommManager).
Makes status of ErrorConnect property FALSE. 4
● References

Details of Properties/Methods/Events
"CommManager"(4-121 page)
"ErrorConnect"(4-126 page)

● Usage Example

Private Sub MyTrigger_Error(ByVal pTrigger As DATABUILDERAXLibLB.DBTrigger, ByVal lAxErr As _


DATABUILDERAXLibLB.DBAxError) Handles MyTrigger.Error
AxDBTriggerManager1.Triggers.Item(1).AsDevice.ClearError()
End Sub

- KV COM+ Library User’s Manual - 4-127


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamDevice

 SetDevice Method

Sets a trigger device.


Reference This method can be executed during designing in the property page. See 3-15 page.
Property Method Event

Operation
Communication suspended Yes
Communicating Yes

● Syntax
DBTriggerManager.DBTriggerParamDevice.SetDevice (kind, no)

4 Description Type
kind Device type DBPlcDevice
Details of Properties/Methods/Events

no Device number String

● Explanation
Sets a device trigger device.
If the trigger device setting is invalid, a runtime error occurs.

● References
"DeviceKind"(4-122 page)
"DeviceNo"(4-123 page)

● Usage Example
See usage example of "DBTrigger.AsDevice" (4-103 page).

4-128 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBTriggerManager DBTriggers DBTrigger DBTriggerParamDevice

 Error Event

Occurs during communication error.

Communication status Operation

Property Method Event


Communication suspended No
Communicating Yes

● Syntax
Sub DBTrigger_Error(ByVal pTrigger As DBTrigger, ByVal lAxErr As DBAxError)
Value for IAxErr

Constant
aeTriggerManagerRead
Value
4
Description
Reading process error
4

Details of Properties/Methods/Events
aeTriggerManagerWrite 5 Writing process error

● Explanation
Occurs during communication error status when using device trigger.

● References
"CommManager"(4-121 page)
"ErrorConnect"(4-126 page)
"ClearError"(4-127 page)

● Usage Example
See usage example of "ClearError"(4-127 page).

- KV COM+ Library User’s Manual - 4-129


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

DBRTLoggingManager Object

Properties
Property Method Event

 CommManager Property

Obtains or sets referred Commanagement object (DBCommManager).


Reference This property can also be set in the property page
"Communication manager Object"(3-23 page)

4 Communication status
Communication suspended
Value acquisition
Yes
Value setting
Yes
Details of Properties/Methods/Events

Communicating Yes Yes

● Syntax
When obtaining: Set dbcomm=DBRTLoggingManager. CommManager
When setting: Set DBRTLoggingManager. CommManager = dbcomm

Value Description Type


dbcomm Commanagement object Object

● Explanation
Obtains or sets Commanagement object.
Real time logging is performed by the connected equipment which object specified with this property
communicates with.
Use GetOcx* property when referring control object.
Device is converted when setting is changed.
For details, see "Model Change"(A-9 page).
* If you use Visual Basic 6.0, use object property.

● References
“DBCommManager.Active” (4-24 page)

4-130 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
AxDBRTLoggingManager1.CommManager = AxDBCommManager1.GetOcx

Property Method Event


AxDBRTLoggingManager1.SamplingCycle = _
DATABUILDERAXLibLB.DBRTLSamplingCycleSet.SampleCycle_SCAN

With AxDBRTLoggingManager1.TriggerStart.AsDevice
.CommManager = AxDBCommManager1.GetOcx
.DeviceKind = DATABUILDERAXLibLB.DBPlcDevice.DKV5000_MR
.DeviceNo = "0"
.DeviceCondition = 1
End With

With AxDBRTLoggingManager1.TriggerStop.AsDevice
4
.CommManager = AxDBCommManager1.GetOcx

Details of Properties/Methods/Events
.DeviceKind = DATABUILDERAXLibLB.DBPlcDevice.DKV5000_MR
.DeviceNo = "0"
.DeviceCondition = 2
End With

AxDBCommManager1.Connect()
AxDBCommManager1.WriteDevice(DATABUILDERAXLibLB.DBPlcDevice.DKV5000_MR, "0", 1)
AxDBCommManager1.Disconnect()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button2.Click
AxDBCommManager1.Connect()
AxDBCommManager1.WriteDevice(DATABUILDERAXLibLB.DBPlcDevice.DKV5000_MR, "0", 0)
AxDBCommManager1.Disconnect()
End Sub

- KV COM+ Library User’s Manual - 4-131


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 Devices Property

Obtains DBDevices collection.

Communication status Value acquisition Value setting


Property Method Event

Communication suspended Yes No


Communicating Yes No

● Syntax
When obtaining: Set devices = DBRTLoggingManager.Devices

Value Description Type

4 device DBDevice collection Devices

● Explanation
Details of Properties/Methods/Events

Obtains DBDevices collection. Setting is performed by AddRTL and InsertRTL methods of DBDevices
objects.
Up to 128 devices in total of bit devices and word devices can be set.
When trying to set more than the upper limit, error occurs.

● References
"DBDevices Object"(4-5 page)
"DBDevice Object"(4-6 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
AxDBRTLoggingManager1.Devices.AddRTL(DATABUILDERAXLibLB.DBPlcDevice.DKV5000_DM, "0", _
1, 1, 11, 0)
End Sub

4-132 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 TriggerStart Property

Obtains and sets a start trigger.

Communication status Value acquisition Value setting

Property Method Event


Communication suspended Yes Yes
Communicating Yes Yes

● Syntax
When obtaining: Set trigger = DBRTLoggingManager.TriggerStart
When setting: Set DBRTLoggingManager.TriggerStart = trigger

Value Description Type


trigger DBTrigger object to start DBTrigger 4

Details of Properties/Methods/Events
● Explanation
Obtains or sets DBTrigger object to be trigger to start sampling.
When trigger condition of set trigger is met, real time logging is started accordingly.
When a start trigger occurs, sampling condition is written into PLC.
So time lag occurs until data is actually obtained.

● References
"DBTrigger Object"(4-8 page)
"TriggerStop"(4-134 page)

● Usage Example
See usage example of “DBRTLogging.CommManager” (4-130 page).

- KV COM+ Library User’s Manual - 4-133


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 TriggerStop Property

Obtains and sets a stop trigger.

Communication status Value acquisition Value setting


Property Method Event

Communication suspended Yes Yes


Communicating Yes Yes

● Syntax
When obtaining: Set trigger = DBRTLoggingManager.TriggerStop
When setting: Set DBRTLoggingManager.TriggerStop = trigger

Value Description Type


4 trigger DBTrigger object to start stopping DBTrigger
Details of Properties/Methods/Events

● Explanation
Obtains or sets DBTrigger object to be trigger to finish sampling.
When trigger condition of set trigger is met, real time logging is finished accordingly.
When a stop trigger occurs, finish request is issued to PLC.

● References
"DBTrigger Object"(4-8 page)
"TriggerStart"(4-133 page)

● Usage Example
See usage example of “DBRTLogging.CommManager” (4-130 page).

4-134 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 SamplingCycle Property

Obtains and sets sampling cycle.

Communication status Value acquisition Value setting

Property Method Event


Communication suspended Yes Yes
Communicating Yes Yes
During real time logging Yes No

● Syntax
When obtaining: cycle = DBRTLoggingManager.SamplingCycle
When setting: DBRTLoggingManager.SamplingCycle = cycle

Value Description Type 4


cycle Sampling cycle DBRTSamplingCycleSet

Details of Properties/Methods/Events
Value for cycle

Constant Value Description


SampleCycle_SCAN 0 SCAN (Depends on PLC scan time)
SampleCycle_1 1 1ms
SampleCycle_2 2 2ms
SampleCycle_5 3 5ms
SampleCycle_10 4 10ms
SampleCycle_20 5 20ms
SampleCycle_50 6 50ms
SampleCycle_100 7 100ms
SampleCycle_200 8 200ms
SampleCycle_300 9 300ms
SampleCycle_400 10 400ms
SampleCycle_500 11 500ms
SampleCycle_1000 12 1s
SampleCycle_2000 13 2s
SampleCycle_3000 14 3s
SampleCycle_4000 15 4s
SampleCycle_5000 16 5s
SampleCycle_TRGD 17 Command trigger (TRGD)

● Explanation
Sets cycle for sampling data in PLC.
This value is set before starting real time logging, and setting cannot be changed during it. Runtime
error occurs when value out of range is entered.

● References
"GetStatus"(4-150 page)

● Usage Example
See usage example of “DBRTLogging.CommManager” (4-130 page).

- KV COM+ Library User’s Manual - 4-135


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 LastID Property

Obtains ID of obtained data.

Communication status Value acquisition Value setting


Property Method Event

Communication suspended Yes No


Communicating Yes No

● Syntax
When obtaining: id = DBRTLoggingManager.LastID

Value Description Type

4 id ID of obtained data Long

● Explanation
Details of Properties/Methods/Events

For real time logging, data is saved with ID in the order of sampling. Data saved in PLC is read to a PC
by using ReadData method of DBRTLoggingManager.
The largest value of data read to PLC, that is, the last read data is obtained with LastID.
Only sampling data which is not loaded from within PLC can be obtained by combining LastID and
TopID which is the largest value of data saved within PLC, that is, the last saved ID in PLC.

● References
"ReadData"(4-151 page)
"TopID"(4-137 page)

● Usage Example

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Timer1.Tick
Dim sTopID As Long
Dim sLastID As Long
Dim err As Integer
Dim i As Integer
Dim LogDataCollection As DATABUILDERAXLibLB.DBRTLoggingDataCollection

sTopID = AxDBRTLoggingManager1.TopID
sLastID = AxDBRTLoggingManager1.LastID
If sTopID > 1000 + sLastID Then
err = AxDBRTLoggingManager1.ReadData(sLastID + 1, 1000)
Else
err = AxDBRTLoggingManager1.ReadData(sLastID + 1, sTopID - sLastID)
End If
LogDataCollection = AxDBRTLoggingManager1.LoggingDataCollection
End Sub

4-136 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 TopID Property

Obtains the latest sampled data ID.

Communication status Value acquisition Value setting

Property Method Event


Communication suspended Yes No
Communicating Yes No

● Syntax
When obtaining: id = DBRTLoggingManager.TopID

Value Description Type


id Latest data ID Long
4
● Explanation

Details of Properties/Methods/Events
For real time logging, data is saved with ID in the order of sampling. Data saved in PLC is read to a PC
by using ReadData method of DBRTLoggingManager.
The largest value of data saved in PLC, that is, the last saved ID number within PLC is obtained with
LastID.
Only sampling data which is not loaded from within PLC can be obtained by combining LastID and
TopID which is the largest value of data read into the PC, that is, the last read ID number.

● References
"ReadData"(4-151 page)
"TopID"(4-137 page)

● Usage Example
See usage example of "LastID"(4-136 page).

- KV COM+ Library User’s Manual - 4-137


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 TriggerID Property

Obtains ID of data which PLC trigger occurred.

Communication status Value acquisition Value setting


Property Method Event

Communication suspended Yes No


Communicating Yes No

● Syntax
When obtaining: id = DBRTLoggingManager.TriggerID

Value Description Type

4 id Data ID which PLC trigger occurs Long

● Explanation
Details of Properties/Methods/Events

Using triggerID can obtain data of when PLC trigger occurs.

● References
"ReadData"(4-151 page)
"TopID"(4-137 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim trgID As Long

trgID = AxDBRTLoggingManager1.TriggerID
TextBox1.Text = AxDBRTLoggingManager1.ReadData(trgID, 1)
End Sub

4-138 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 LoggingDataCollection Property

Collection of logging data.

Communication status Value acquisition Value setting

Property Method Event


Communication suspended Yes No
Communicating Yes No

● Syntax
When obtaining: Set DataCollection = DBRTLoggingManager.LoggingDataCollection

Value Description Type


DataCollection Logging data collection DBRTLoggingDataCollection
4
● Explanation

Details of Properties/Methods/Events
Collection of DBRTLoggingData (data block by ReadData).

● References
"ReadData"(4-151 page)

● Usage Example
See usage example of "LastID"(4-136 page).

- KV COM+ Library User’s Manual - 4-139


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 TriggerDataRatio Property

Obtains or sets data size (%) after trigger.

Communication status Value acquisition Value setting


Property Method Event

Communication suspended Yes Yes


Communicating Yes Yes

● Syntax
When obtaining: Ratio = DBRTLoggingManager. TriggerDataRatio
When setting: DBRTLoggingManager. TriggerDataRatio = Ratio

Value Description Type


4 Ratio Data size (%) after trigger Integer
Details of Properties/Methods/Events

● Explanation
Obtains or sets data size after trigger by 0 - 100 (%). Data score after trigger is calculated with this
number.

● Usage Example

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


MyBase.Load
AxDBRTLoggingManager1.TriggerDataRatio = 50
AxDBRTLoggingManager1.TrgParamBitEnable1 = True
AxDBRTLoggingManager1.TrgParamBitIndex1 = 1
AxDBRTLoggingManager1.TrgParamBitOn1 = _
DATABUILDERAXLibLB.DBRTLBitDeviceOnOffSet.BitDevice_ON
AxDBRTLoggingManager1.TrgParamBitLogicOperator = _
DATABUILDERAXLibLB.DBRTLLogicalSet.Logical_AND
AxDBRTLoggingManager1.TrgParamWordLogicOperator = _
DATABUILDERAXLibLB.DBRTLLogicalSet.Logical_AND
AxDBRTLoggingManager1.TrgParamWordEnable = True
AxDBRTLoggingManager1.TrgParamWordIndex = 3
AxDBRTLoggingManager1.TrgParamWordCmpOperator = _
DATABUILDERAXLibLB.DBRTLCmpOperatorSet.CmpOperator_GREATER
AxDBRTLoggingManager1.TrgParamWordCmpValue = 1000
End Sub

4-140 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 TrgParamBitEnable1 - 4 Property

Sets whether bit device 1-4 available as PLC trigger should be used.

Communication status Value acquisition Value setting

Property Method Event


Communication suspended Yes Yes
Communicating Yes Yes

● Syntax
When obtaining: value = DBRTLoggingManager.TrgParamBitEnable1
When setting: DBRTLoggingManager.TrgParamBitEnable1 = value

Value Description Type


value Whether trigger bit should be used Boolean 4

Details of Properties/Methods/Events
Value for ‘value’

Constant Description
True Use trigger bit (1 -4).
False Do not use trigger bit (1 -4).

● Explanation
Sets whether trigger bit (1-4) should be used as trigger.

● References
"TrgParamBitIndex1 - 4"(4-142 page)
"TrgParamBitOn1 - 4"(4-143 page)
"TrgParamBitLogicOperator"(4-144 page)

● Usage Example
See usage example of "TriggerDataRatio"(4-140 page).

- KV COM+ Library User’s Manual - 4-141


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 TrgParamBitIndex1 - 4 Property

Obtains or sets Index number of device used for bit device which can be used as PLC trigger.

Communication status Value acquisition Value setting


Property Method Event

Communication suspended Yes Yes


Communicating Yes Yes

● Syntax
When obtaining: value = DBRTLoggingManager.TrgParamBitIndex1
When setting: DBRTLoggingManager.TrgParamBitIndex1 = value

Value Description Type


4 value Index number Integer
Details of Properties/Methods/Events

● Explanation
Only the device registered for logging by DBDevice object can be registered for trigger bit of real time
logging. Registers as trigger bit device by using index number of DBDevice object.

● References
"DBDevice Object"(4-6 page)
"TrgParamBitIndex1 - 4"(4-142 page)
"TrgParamBitOn1 - 4"(4-143 page)
"TrgParamBitLogicOperator"(4-144 page)

● Usage Example
See usage example of "TriggerDataRatio"(4-140 page).

4-142 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 TrgParamBitOn1 - 4 Property

Obtains or sets whether trigger status of bit device 1-4 available as PLC trigger is ON or OFF.

Communication status Value acquisition Value setting

Property Method Event


Communication suspended Yes Yes
Communicating Yes Yes

● Syntax
When obtaining: value = DBRTLoggingManager.TrgParamBitOn1
When setting: DBRTLoggingManager.TrgParamBitOn1 = value

Value Description Type

value
Status to set as trigger
DBRTLBitDeviceOnOffSet
4
(ON/OFF)

Details of Properties/Methods/Events
Value for ‘value’

Constant Value Description


BitDevice_ON 1 Trigger condition is met if configured trigger device is ON.
BitDevice_OFF 0 Trigger condition is met if configured trigger device is OFF.

● Explanation
Obtains or sets whether trigger status of bit set as trigger bit is ON or OFF.

● References
"TrgParamBitEnable1 - 4"(4-141 page)
"TrgParamBitIndex1 - 4"(4-142 page)
"TrgParamBitLogicOperator"(4-144 page)

● Usage Example
See usage example of "TriggerDataRatio"(4-140 page).

- KV COM+ Library User’s Manual - 4-143


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 TrgParamBitLogicOperator Property

Obtains or sets combination condition of bit device 1-4 available as PLC trigger.

Communication status Value acquisition Value setting


Property Method Event

Communication suspended Yes Yes


Communicating Yes Yes

● Syntax
When obtaining: value = DBRTLoggingManager.TrgParamBitLogicOperator
When setting: DBRTLoggingManager.TrgParamBitLogicOperator = value

Value Description Type


4 value
Combination
DBRTLLogicalSet
condition of trigger
Details of Properties/Methods/Events

Value for ‘value’

Constant Value Description


Trigger occurs when all conditions of configured trigger device
Logical_AND 0
1 - 4 are met.
Trigger occurs when one condition of configured trigger device
Logical_OR 1
1 - 4 is met.

● Explanation
Obtains or sets combination condition of trigger bit.

● References
"TrgParamBitEnable1 - 4"(4-141 page)
"TrgParamBitIndex1 - 4"(4-142 page)
"TrgParamBitOn1 - 4"(4-143 page)
"TrgParamBitLogicOperator"(4-144 page)

● Usage Example
See usage example of "TriggerDataRatio"(4-140 page).

4-144 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 TrgParamWordLogicOperator Property

Obtains or set combination condition of bit device 1-4 and word device available as PLC trigger.

Communication status Value acquisition Value setting

Property Method Event


Communication suspended Yes Yes
Communicating Yes Yes

● Syntax
When obtaining: value = DBRTLoggingManager.TrgParamWordLogicOperator
When setting: DBRTLoggingManager.TrgParamWordLogicOperator = value

Value Description Type


value Combination condition of trigger DBRTLLogicalSet 4

Details of Properties/Methods/Events
Value for ‘value’

Constant Value Description


Operates when both conditions of bit and word devices are
Logical_AND 0
met.
Logical_OR 1 Operates when either condition of bit or word devices is met.

● Explanation
Obtains or sets combination condition of configured trigger bit device and trigger word device.

● References
"TrgParamWordEnable"(4-146 page)
"TrgParamWordIndex"(4-147 page)
"TrgParamWordCmpOperator"(4-148 page)
"TrgParamWordCmpValue"(4-149 page)

● Usage Example
See usage example of "TriggerDataRatio"(4-140 page).

- KV COM+ Library User’s Manual - 4-145


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 TrgParamWordEnable Property

Obtains or sets whether word device available as PLC trigger should be used.

Communication status Value acquisition Value setting


Property Method Event

Communication suspended Yes Yes


Communicating Yes Yes

● Syntax
When obtaining: value = DBRTLoggingManager.TrgParamWordEnable
When setting: DBRTLoggingManager.TrgParamWordEnable = value

Value Description Type


4 value Whether to set as trigger condition Boolean
Details of Properties/Methods/Events

Value for ‘value’

Constant Description
True Uses word device.
False Does not use word device.

● Explanation
Obtains or sets whether word device should be used as a trigger.

● References
"TrgParamWordLogicOperator"(4-145 page)
"TrgParamWordEnable"(4-146 page)
"TrgParamWordIndex"(4-147 page)
"TrgParamWordCmpOperator"(4-148 page)
"TrgParamWordCmpValue"(4-149 page)

● Usage Example
See usage example of "TriggerDataRatio"(4-140 page).

4-146 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 TrgParamWordIndex Property

Obtains and sets Index number of word device available as PLC trigger.

Communication status Value acquisition Value setting

Property Method Event


Communication suspended Yes Yes
Communicating Yes Yes

● Syntax
When obtaining: value = DBRTLoggingManager.TrgParamWordIndex()
When setting: DBRTLoggingManager.TrgParamWordIndex() = value

Value Description Type


value Index number Short 4

Details of Properties/Methods/Events
● Explanation
Only the device registered for logging by DBDevice object can be registered as the trigger word device
for real time logging. It is registered as trigger word device by using index number of DBDvice object.

● References
"DBDevice Object"(4-6 page)
"TrgParamWordLogicOperator"(4-145 page)
"TrgParamWordEnable"(4-146 page)
"TrgParamWordCmpOperator"(4-148 page)
"TrgParamWordCmpValue"(4-149 page)

● Usage Example
See usage example of "TriggerDataRatio"(4-140 page).

- KV COM+ Library User’s Manual - 4-147


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 TrgParamWordCmpOperator Property

Obtains or sets Index number of word device available as PLC trigger.

Communication status Value acquisition Value setting


Property Method Event

Communication suspended Yes Yes


Communicating Yes Yes

● Syntax
When obtaining: value = DBRTLoggingManager.TrgParamWordCmpOperator
When setting: DBRTLoggingManager.TrgParamWordCmpOperator = value

Value Description Type


4 value Condition to compare DBRTLCmpOperatorSet
Details of Properties/Methods/Events

Value for ‘value’

Constant Value Description


CmpOperator_EQUAL 0 Trigger is established when matching configured value.
CmpOperator_NEQUAL 1 Trigger is established when different from configured value.
CmpOperator_GREATER 2 Trigger is established when larger than configured value.
Trigger is established when equal to configured value or
CmpOperator_GREATER_EQ 3
larger.
CmpOperator_LESS 4 Trigger is established when smaller than configured value.
Trigger is established when equal to configured value or
CmpOperator_LESS_EQ 5
smaller.

● Explanation
Obtains or sets comparison condition to be trigger condition of word device.
Value to compare with is set by TrgParamWordCmpValue object.

● References
"TrgParamWordLogicOperator"(4-145 page)
"TrgParamWordEnable"(4-146 page)
"TrgParamWordIndex"(4-147 page)
"TrgParamWordCmpValue"(4-149 page)

● Usage Example
See usage example of "TriggerDataRatio"(4-140 page).

4-148 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 TrgParamWordCmpValue Property

Obtains or sets value compared with word device available as PLC trigger.

Communication status Value acquisition Value setting

Property Method Event


Communication suspended Yes Yes
Communicating Yes Yes

● Syntax
When obtaining: value = DBRTLoggingManager.TrgParamWordCmpValue
When setting: DBRTLoggingManager.TrgParamWordCmpValue = value

Value Description Type


value Compared configuration value Integer 4

Details of Properties/Methods/Events
● Explanation
Obtains or sets compared configuration value to be trigger of word device.
Comparison method is set by TrgParamWordCmpOperator object.

● References
"TrgParamWordLogicOperator"(4-145 page)
"TrgParamWordEnable"(4-146 page)
"TrgParamWordIndex"(4-147 page)
"TrgParamWordCmpOperator"(4-148 page)

● Usage Example
See usage example of "TriggerDataRatio"(4-140 page).

- KV COM+ Library User’s Manual - 4-149


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

Methods

 GetStatus Method
Property Method Event

Obtains whether object is under real time logging.

Communication status Operation


Communication suspended No
Communicating Yes

● Syntax

4 Status = DBRTLoggingManager. GetStatus

Value Description Type


Details of Properties/Methods/Events

Status Status of real time logging DBRTLoggingStatusSet or Long

Value for Status

Constant Value Description


STAT_IDLE 0 Idle
STAT_INIT 1 Initializing
STAT_LOGGING 2 Executing real time logging
PLC trigger occurred, data acquisition of data size after trigger
STAT_TRGEND 3
completed

● Explanation
Obtains status of real time logging execution of object.

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim LogStatus As Long

LogStatus = AxDBRTLoggingManager1.GetStatus
If LogStatus = DATABUILDERAXLibLB.DBRTLoggingStatusSet.STAT_LOGGING Then
MsgBox(" Executing real time logging")
End If
End Sub

4-150 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 ReadData Method

Obtains specified data.

Communication status Operation

Property Method Event


Communication suspended No
Communicating Yes

● Syntax
IsSuccess= DBRTLoggingManager.ReadData(startId, count)

Value Description Type


IsSuccess Result of ReadData
Data ID at the beginning you want to
Boolean
4
obtain.
startId Long

Details of Properties/Methods/Events
If specifying 0, the one at the beginning is
obtained first.
count The number of data you want to obtain Long

● Explanation
PLC collects data in the specified cycle of sampling from the beginning of sampling to the end. To
obtain data collected from PC, use ReadData method.

● Usage Example
See usage example of “DBRTLoggingManager.LastID” (4-136 page).

- KV COM+ Library User’s Manual - 4-151


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 RTLoggingStart Method

Starts real time logging.

Communication status Operation


Property Method Event

Communication suspended No
Communicating Yes

● Syntax
DBRTLoggingManager.RTLoggingStart

● Explanation

4 Writes sampling condition to PLC and starts real time logging.


Time lag to actual data acquisition occurs after starting.
When sampling of real time chart monitor or other DBRTLoggingManager object is already started to
Details of Properties/Methods/Events

the same PLC, the first started sampling ends abnormally.


When real time chart monitor or other DBRTLoggingManager object starts sampling after start
sampling, DBRTLoggingManager object stops sampling. When executing GetStatus or ReadData
object when sampling is stopped, error occurs.

Point If communication stops from starting to ending of real time logging, real time logging may
not be executed properly. Do not stop communication from starting to ending of real time
logging.

● References
"RTLoggingStop"(4-153 page)
"GetStatus"(4-150 page)
"ReadData"(4-151 page)

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
AxDBCommManager1.Connect()
AxDBRTLoggingManager1.RTLoggingStart()
End Sub
‘Communicating (Do not stop communication)
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _
Button2.Click
AxDBRTLoggingManager1.RTLoggingStop()
AxDBCommManager1.Disconnect()
End Sub

4-152 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 RTLoggingStop Method

Stops real time logging.

Communication status Operation

Property Method Event


Communication suspended No
Communicating Yes

● Syntax
DBRTLoggingManager. RTLoggingStop

● Explanation
Issues sampling stop request to PLC to stop real time logging.
4
● References

Details of Properties/Methods/Events
"TriggerStop"(4-134 page)

● Usage Example
See usage example of "TriggerStart"(4-133 page).

- KV COM+ Library User’s Manual - 4-153


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 GetTrgParamBit Method

Obtains trigger bit setting specified with Index.

Communication status Operation


Property Method Event

Communication suspended Yes


Communicating Yes

● Syntax
DBRTLoggingManager.GetTrgParamBit(sIdx, pvbEnable, plSelIdx, psOn)

Value Description Type

4 sIdx
pvbEnable
Trigger condition (1 - 4)
Trigger condition, active/inactive flag
Integer
Boolean
Device index
Details of Properties/Methods/Events

plSelIdx (Index in Devices of device as trigger Long


condition)
psOn Status when trigger condition is met Integer

Value for pvbEnable

Constant Description
True Specified trigger bit is active.
False Specified trigger bit is inactive.

Value for psOn

Constant Value Description


BitDevice_ON 1 Trigger condition is met when specified trigger device is ON.
BitDevice_OFF 0 Trigger condition is met when specified trigger device is OFF.

● Explanation
Sets bit device to be as PLC trigger condition. Active/inactive trigger condition flag, device index, status
when trigger condition is met (ON/OFF value) can be obtained by specifying Index of condition desire to
obtain.

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim pvbEnable As Boolean
Dim plSelIdx As Long
Dim psOn As Integer

AxDBRTLoggingManager1.GetTrgParamBit(1, pvbEnable, plSelIdx, psOn)


End Sub

4-154 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 SetTrgParamBit Method

Sets trigger bit specified with Index.

Communication status Operation

Property Method Event


Communication suspended Yes
Communicating Yes

● Syntax
DBRTLoggingManager.SetTrgParamBit(sIdx, vbEnable, lSelIdx, sOn)

Value Description Type


sIdx
vbEnable
Trigger condition index (1 - 4)
Trigger condition, active/inactive flag
Integer
Boolean
4
Device index

Details of Properties/Methods/Events
lSelIdx (Index in Devices of device as trigger Long
condition)
sOn ON/OFF value Integer

Value for pvbEnable

Constant Description
True Specified trigger bit is active.
False Specified trigger bit is inactive.

Value for sOn

Constant Value Description


BitDevice_ON 1 Trigger condition is met when specified trigger device is ON.
BitDevice_OFF 0 Trigger condition is met when specified trigger device is OFF.

● Explanation
Sets bit device to be as PLC trigger condition. Active/inactive trigger condition flag, device index, status
when trigger condition is met (ON/OFF value) can be set collectively by specifying Index of condition
you want to obtain.

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
AxDBRTLoggingManager1.SetTrgParamBit(1,True , 2, _
DATABUILDERAXLibLB.DBRTLBitDeviceOnOffSet.BitDevice_ON)
End Sub

- KV COM+ Library User’s Manual - 4-155


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 GetTrgParamWord Method

Obtains setting of trigger word device.

Communication status Operation


Property Method Event

Communication suspended Yes


Communicating Yes

● Syntax
DBRTLoggingManager.GetTrgParamWord(pvbEnable, psOpe, psSelIdx, plCmpVal)

Value Description Type

4 pvbEnable
psOpe
Word device trigger condition, active/inactive flag
Word device trigger condition, comparison operator
Boolean
Integer
Device index
Details of Properties/Methods/Events

psSelIdx Integer
(Index in Devices of device as trigger condition)
plCmpVal Word device trigger condition, compared value Long

Value for pvbEnable

Constant Description
True Specified trigger word device is active.
False Specified trigger word device is inactive.

Value for psOpe

Constant Value Description


CmpOperator_EQUAL 0 Trigger condition is met when matching configured value.
CmpOperator_NEQUAL 1 Trigger condition is met when different from configured value.
CmpOperator_GREATER 2 Trigger condition is met when larger than configured value.
Trigger condition is met when equal to configured value or
CmpOperator_GREATER_EQ 3
larger.
CmpOperator_LESS 4 Trigger condition is met when smaller than configured value.
Trigger condition is met when equal to configured value or
CmpOperator_LESS_EQ 5
smaller.

● Explanation
Sets word device to be as PLC trigger condition. Active/inactive trigger condition flag, device index,
comparison operation and compared value can be set collectively.

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim pvbEnable As Boolean
Dim psOpe As Integer
Dim psSelIdx As Integer
Dim plCmpVal As Long

AxDBRTLoggingManager1.GetTrgParamWord(pvbEnable, psOpe, psSelIdx, plCmpVal)


End Sub

4-156 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 SetTrgParamWord Method

Sets trigger word device.

Communication status Operation

Property Method Event


Communication suspended Yes
Communicating Yes

● Syntax
DBRTLoggingManager.GetTrgParamWord(vbEnable, sOpe, sSelIdx, lCmpVal)

Value Description Type

vbEnable
Word device trigger condition, active/
inactive flag
Boolean
4
Word device trigger condition,
sOpe Integer

Details of Properties/Methods/Events
comparison operator
Device index
sSelIdx (Index in Devices of device as trigger Integer
condition)
Word device trigger condition, compared
lCmpVal Long
value

Value for vbEnable

Constant Description
True Specified trigger word device is active.
False Specified trigger word device is inactive.

Value for sOpe

Constant Value Description


CmpOperator_EQUAL 0 Trigger condition is met when matching configured value.
CmpOperator_NEQUAL 1 Trigger condition is met when different from configured value.
CmpOperator_GREATER 2 Trigger condition is met when larger than configured value.
Trigger condition is met when equal to configured value or
CmpOperator_GREATER_EQ 3
larger.
CmpOperator_LESS 4 Trigger condition is met when smaller than configured value.
Trigger condition is met when equal to configured value or
CmpOperator_LESS_EQ 5
smaller.

● Explanation
Sets word device to be as PLC trigger condition. Active/inactive trigger condition flag, device index,
comparison operation and compared value can be set collectively.

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
AxDBRTLoggingManager1.SetTrgParamWord(True, _
DATABUILDERAXLibLB.DBRTLCmpOperatorSet.CmpOperator_GREATER_EQ, 2, 500)
End Sub

- KV COM+ Library User’s Manual - 4-157


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

Events

 BeforeRead Event
Property Method Event

Occurs before reading process is actually performed to the connected equipment when executing
ReadData method.

● Syntax
Sub DBRTLoggingManager_BeforeRead()

● Explanation
Occurs before reading process is actually performed to the connected equipment when executing
4 ReadData method.

● References
Details of Properties/Methods/Events

"ReadData"(4-151 page)
"AfterRead"(4-159 page)

● Usage Example

Private Sub AxDBRTLoggingManager1_BeforeRead(ByVal sender As Object, ByVal e As _


System.EventArgs) Handles AxDBRTLoggingManager1.BeforeRead
MsgBox(" Start reading process")
End Sub

4-158 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBRTLoggingManager

 AfterRead Event

Occurs after actual reading process to the connected equipment is finished when executing ReadData
method.

Property Method Event


● Syntax
Sub DBRTLoggingManager_AfterRead()

● Explanation
Occurs after actual reading process to the connected equipment is finished when executing ReadData
method.

● References
"ReadData"(4-151 page) 4
"BeforeRead"(4-158 page)

Details of Properties/Methods/Events
● Usage Example

Private Sub AxDBRTLoggingManager1_AfterRead(ByVal sender As Object, ByVal e As _


System.EventArgs) Handles AxDBRTLoggingManager1.AfterRead
MsgBox(" Reading process completed")
End Sub

- KV COM+ Library User’s Manual - 4-159


4-2 Details of Properties/Methods/Events

DBRTLoggingManager DBRTLoggingDataCollection

DBRTLoggingDataCollection Object

Properties
Property Method Event

 Count Property

Obtains the number of DBRTLoggingData included in collection.

Communication Value
Value setting
status acquisition
Communication
4 suspended
Yes No

Communicating Yes No
Details of Properties/Methods/Events

● Syntax
When obtaining: value = DBRTLoggingDataCollection.Count

Value Description Type


value The number of DBRTLoggingData Long

● Explanation
Obtains the number of DBRTLoggingData included in collection.

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim lDataCount As Long
Dim lDevData As Long

lDataCount = AxDBRTLoggingManager1.LoggingDataCollection.Count
lDevData = AxDBRTLoggingManager1.LoggingDataCollection.Item(lDataCount).DeviceValues(1).Value
End Sub

4-160 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBRTLoggingManager DBRTLoggingDataCollection

 Item Property

Obtains DBRTLoggingData registered for specified index.

Communication Value
Value setting

Property Method Event


status acquisition
Communication
Yes No
suspended
Communicating Yes No

● Syntax
When obtaining: value = DBRTLoggingDataCollection.Item

Value Description Type 4


value Registered DBRTLoggingData DBRTLoggingData

Details of Properties/Methods/Events
● Explanation
Obtains DBRTLoggingData registered for specified index.

● Usage Example
See usage example of "Id"(4-162 page).

- KV COM+ Library User’s Manual - 4-161


4-2 Details of Properties/Methods/Events

DBRTLoggingManager DBRTLoggingDataCollection DBRTLoggingData

DBRTLoggingData Object

Properties
Property Method Event

 Id Property

Obtains data ID.

Communication Value
Value setting
status acquisition
Communication
4 suspended
Yes No

Communicating Yes No
Details of Properties/Methods/Events

● Syntax
When obtaining: value = DBRTLoggingData.Id

Value Description Type


value Data ID Long

● Explanation
For real time logging, data is collected by sampling cycle, and collected data is managed with data ID in
order. Data ID of DBRTLoggingData object can be obtained with ID property.

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim ltrgID As Long
Dim lDataID As Long
Dim dateTime As Object
Dim bPLCTrigger As Boolean
Dim lDeviceCount As Long
Dim lDevData As Long
Dim err As Integer

AxDBCommManager1.Connect()
ltrgID = AxDBRTLoggingManager1.TriggerID
If ltrgID > 100 Then
err = AxDBRTLoggingManager1.ReadData(ltrgID - 100, 200)
Else
err = AxDBRTLoggingManager1.ReadData(0, 200)
End If
lDataID = AxDBRTLoggingManager1.LoggingDataCollection.Item(1).Id
dateTime = AxDBRTLoggingManager1.LoggingDataCollection.Item(1).DateTime
bPLCTrigger = AxDBRTLoggingManager1.LoggingDataCollection.Item(1).PLCTrigger
lDeviceCount = AxDBRTLoggingManager1.LoggingDataCollection.Item(1).DeviceCount
lDevData = AxDBRTLoggingManager1.LoggingDataCollection.Item(1).DeviceValues(1).Value
End Sub

4-162 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBRTLoggingManager DBRTLoggingDataCollection DBRTLoggingData

 DateTime Property

Obtains sampled date/time.

Communication Value
Value setting

Property Method Event


status acquisition
Communication
Yes No
suspended
Communicating Yes No

● Syntax
When obtaining: value = DBRTLoggingData.DateTime

Value Description Type 4


value Date/time Variant

Details of Properties/Methods/Events
● Explanation
Obtains sampled date/time.

● Usage Example
See usage example of "Id"(4-162 page).

 PLCTrigger Property

Obtains whether PLC triggers occurred.

Communication Value
Value setting
status acquisition
Communication
Yes No
suspended
Communicating Yes No

● Syntax
When obtaining: value = DBRTLoggingData.PLCTrigger

Value Description Type


value Status of PLC trigger Boolean

● Explanation
Obtains whether PLC triggers occurred.

● Usage Example
See usage example of "Id"(4-162 page).

- KV COM+ Library User’s Manual - 4-163


4-2 Details of Properties/Methods/Events

DBRTLoggingManager DBRTLoggingDataCollection DBRTLoggingData

 DeviceCount Property

Obtains the number of devices (up to 128 devices).

Communication Value
Value setting
Property Method Event

status acquisition
Communication
Yes No
suspended
Communicating Yes No

● Syntax
When obtaining: value = DBRTLoggingData.DeviceCount

4 Value Description Type


value The number of devices Long
Details of Properties/Methods/Events

● Explanation
Obtains the number of devices (up to 128 devices).

● Usage Example
See usage example of "Id"(4-162 page).

4-164 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBRTLoggingManager DBRTLoggingDataCollection DBRTLoggingData DBRTLoggingDataValue

 DeviceValues Property

Obtains DBRTLoggingDataValue collection.

Communication Value
Value setting

Property Method Event


status acquisition
Communication
Yes No
suspended
Communicating Yes No

● Syntax
When obtaining: value = DBRTLoggingData.DeviceValues

Value Description Type 4


value DBRTLoggingDataValue collection DBRTLoggingDataValue

Details of Properties/Methods/Events
● Explanation
Obtains DBRTLoggingDataValue collection.

● Usage Example
See usage example of "Id"(4-162 page).

- KV COM+ Library User’s Manual - 4-165


4-2 Details of Properties/Methods/Events

DBRTLoggingManager DBRTLoggingDataCollection DBRTLoggingData DBRTLoggingDataValue

DBRTLoggingDataValue Object

Properties
Property Method Event

 DeviceType Property

Obtains device type.

Communication Value
Value setting
status acquisition
Communication
4 suspended
Yes No

Communicating Yes No
Details of Properties/Methods/Events

● Syntax
Set DeviceType=DBRTLoggingDataValue.DeviceType

Value Description Type


DeviceType Device type Long

Value for DeviceType

Constant Value Description


dtBit 0 Device type is bit device.
dtWord 1 Device type is word device (16-bit).
dtDWord 2 Device type is word device (32-bit).

● Explanation
Obtains device type of the specified device.

● Usage Example

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Button1.Click
Dim ldevicetype As Long
Dim lDevData As Long
Dim ltrgID As Long

ltrgID = AxDBRTLoggingManager1.TriggerID
ldevicetype = _
AxDBRTLoggingManager1.LoggingDataCollection.Item(ltrgID).DeviceValues(1).DeviceType
lDevData = AxDBRTLoggingManager1.LoggingDataCollection.Item(1).DeviceValues(1).Value
End Sub

4-166 - KV COM+ Library User’s Manual -


4-2 Details of Properties/Methods/Events

DBRTLoggingManager DBRTLoggingDataCollection DBRTLoggingData DBRTLoggingDataValue

 Value Property

Obtains sampled device data.

Communication Value
Value setting

Property Method Event


status acquisition
Communication
Yes No
suspended
Communicating Yes No

● Syntax
value=DBRTLoggingDataValue.Value

Value Description Type 4


value Device data Long

Details of Properties/Methods/Events
● Explanation
Obtains sampled device data.

● Usage Example
See usage example of "DeviceType"(4-166 page).

- KV COM+ Library User’s Manual - 4-167


4-3 ActiveX Control
DBCommandButton

This section describes property/method/event of each ActiveX control.

DBCommandButton Object
Property Method Event

This control creates switch, lamp switch, lamp and N-state lamp.
Switch has two types of state, “ON” and “OFF” lump has two types of state, “Light-on” and “Light-off.”
Lamp switch has four types of state, “Light-on by ON,” “Light-off by ON,” “Light-on by OFF,” “Light-off by
OFF.” N-state lamp has N types of state.
You can check the number of states (N) on the property page.

4  Properties
Obtain Set
ActiveX Control

Property name Description Reference


value value
Status Obtains or sets status. Yes Yes 4-171
BackgroundColor Sets background color of control. No Yes 4-182

 Method
Method name Description Reference
GetStatus Obtains status. 4-183
SetStatus Sets status. 4-183
GetStatusMax Obtains the number of status. 4-183
GetType Obtains button type. 4-183
GetMode Obtains button mode. 4-184
IsButtonPushed Obtains button pushed flag. 4-184
ResetButtonPushed Resets button pushed flag. 4-184
ShowPropDialog Displays sub-property dialog. 4-184
InvalidateCtrl Redraws control. 4-184
SetInitMode Sets mode when newly creating. 4-185

Point • BackgroundColor property can be changed directly from the property window, however,
you need to save and reload control in order to reflect on the actual control.

Event name Description Reference


Click Occurs when clicking object. 4-186
DblClick Occurs when double-clicking object. 4-186
MouseDown Occurs when pressing mouse button on object. 4-186
MouseMove Occurs when mouse pointer moves on object. 4-186
MouseUp Occurs when pressed mouse button is released. 4-186

4-168 - KV COM+ Library User’s Manual -


4-3 ActiveX Control

DBBarMeter

DBBarMeter Object

A control to create bar type meter.

Property Method Event


Various bar type meters can be created by setting “Each range configuration,” “Setting on display,”
“Setting on scale” and so on in the property page.
Previously configured bar type meter can be used by selecting “Style.”

 Properties
Obtain Set
Property name Description Reference
value value
InputValue
InputRangeLowerLimit
Obtains or sets value.
Obtains or sets lower limit of input range.
Yes
Yes
Yes
Yes
4-172
4-173
4

ActiveX Control
InputRangeUpperLimit Obtains or sets upper limit of input range. Yes Yes 4-173
DisplayRangeLowerLimit Obtains or sets lower limit of display range. Yes Yes 4-175
DisplayRangeUpperLimit Obtains or sets upper limit of display range. Yes Yes 4-175
AlarmRangeLowerLimit Obtains or sets lower limit of alarm range. Yes Yes 4-176
AlarmRangeUpperLimit Obtains or sets upper limit of alarm range. Yes Yes 4-176
Obtains or sets status of showing/hiding
ShowOptimumValue Yes Yes 4-179
optimum value.
OptimumValue Obtains or sets optimum value. Yes Yes 4-177
Obtains or sets status of showing/hiding
ShowLowerAlarm Yes Yes 4-178
lower limit of alarm.
Obtains or sets status of showing/hiding
ShowUpperAlarm Yes Yes 4-178
upper limit of alarm.
ScaleMarkingColor Obtains or sets scale color. Yes Yes 4-180
ScaleMarkingLowerAlarmColor Obtains or sets line color of lower limit of alarm. Yes Yes 4-181
ScaleMarkingUpperAlarmColor Obtains or sets line color of upper limit of alarm. Yes Yes 4-181
BackgroundColor Sets background color of control image. No Yes 4-182

 Method
Method name Description Reference
ShowPropDialog Displays sub-property dialog box. 4-184
InvalidateCtrl Redraws control. 4-184

Event name Description Reference


Click Occurs when clicking object. 4-186
DblClick Occurs when double-clicking object. 4-186
MouseDown Occurs when pressing mouse button on object. 4-186
MouseMove Occurs when mouse pointer moves on object. 4-186
MouseUp Occurs when pressed mouse button is released. 4-186

Point • BackgroundColor property can be changed directly from the property window, however,
you need to save and reload control in order to reflect on the actual control.

- KV COM+ Library User’s Manual - 4-169


4-3 ActiveX Control

DBFanMeter

DBFanMeter Object

A control to create circle meter and fan-shaped meter.


Property Method Event

Circle meter can set start and end angles to represent lower and upper values of input range or display
range within 360 degree, fan-shaped meter can set them within 180 degree.
Like bar type meter, various circle and fan-shaped meters can be created by setting “Each range
configuration,” “Setting on display,” “Setting on scale” and so on in the property page.
Previously configured circle and fan-shaped meters can be used by selecting “Style.”

 Properties
Obtain Set Refer
4 Property name

InputValue
Description

Obtains or sets value.


value
Yes
value
Yes
ence
4-172
ActiveX Control

InputRangeLowerLimit Obtains or sets lower limit of input range. Yes Yes 4-173
InputRangeUpperLimit Obtains or sets upper limit of input range. Yes Yes 4-173
DisplayRangeLowerLimit Obtains or sets lower limit of display range. Yes Yes 4-175
DisplayRangeUpperLimit Obtains or sets upper limit of display range. Yes Yes 4-175
AlarmRangeLowerLimit Obtains or sets lower limit of alarm range. Yes Yes 4-176
AlarmRangeUpperLimit Obtains or sets upper limit of alarm range. Yes Yes 4-176
Obtains or sets status of showing/hiding
ShowOptimumValue Yes Yes 4-179
optimum value.
OptimumValue Obtains or sets optimum value. Yes Yes 4-177
Obtains or sets status of showing/hiding
ShowLowerAlarm Yes Yes 4-178
lower limit of alarm.
Obtains or sets status of showing/hiding
ShowUpperAlarm Yes Yes 4-178
upper limit of alarm.
ScaleMarkingColor Obtains or sets scale color. Yes Yes 4-180
ScaleMarkingLowerAlarmColor Obtains or sets line color of lower limit of alarm. Yes Yes 4-181
ScaleMarkingUpperAlarmColor Obtains or sets line color of upper limit of alarm. Yes Yes 4-181
BackgroundColor Sets background color of control image. No Yes 4-182

 Method
Method name Description Reference
ShowPropDialog Displays sub-property dialog box. 4-184
InvalidateCtrl Redraws control. 4-184

Event name Description Reference


Click Occurs when clicking object. 4-186
DblClick Occurs when double-clicking object. 4-186
MouseDown Occurs when pressing mouse button on object. 4-186
MouseMove Occurs when mouse pointer moves on object. 4-186
MouseUp Occurs when pressed mouse button is released. 4-186

Point • BackgroundColor property can be changed directly from the property window, however,
you need to save and reload control in order to reflect on the actual control.

4-170 - KV COM+ Library User’s Manual -


4-3 ActiveX Control

DBCommandButton

Properties

 Status Property

Property Method Event


Obtains or sets status of switch, lamp, lamp switch and N-state lamp.

● Syntax
When obtaining: value=DBComandButton.Status
When setting: DBCommandButton.Status=value

Value Description Type


value Status Integer

Value for ‘value’


4

ActiveX Control
Type Value Description
0: OFF
Switch 0 -1
1: ON
0: Light-off
Lamp 0 -1
1: Light-on
0:Light-off with OFF
1:Light-off with ON
Lamp switch 0 -3
2:Light-on with OFF
3:Light-on with ON
0 - (N-1)
Depends on type of N
N status lamp (* N depends on the selected N status
status lamp.
lamp)

● Explanation
Switch has two types of status, “ON” and “OFF”; lump also has two status types “Light-on” and “Light-
off.” Lamp switch has four types of status, “Light-on by ON,” “Light-off by ON,” “Light-on by OFF,” “Light-
off by OFF.” N status lamp has N types of status.
Check the number of status (N) on the property page.

● Usage Example

Private Sub AxDBCommandButton1_Enter(ByVal sender As System.Object, ByVal e As _


System.EventArgs) Handles AxDBCommandButton1.Enter
If AxDBCommandButton1.Status = 1 Then
AxDBCommandButton1.Status = 0
Else
AxDBCommandButton1.Status = 1
End If
End Sub

- KV COM+ Library User’s Manual - 4-171


4-3 ActiveX Control

DBBarMeter
DBFanMeter
 InputValue Property

Obtains or sets data to be referred as value.

● Syntax
Property Method Event

When obtaining: value=DBBarMeter.InputValue


When setting: DBBarMeter.InputValue=value
When obtaining: value=DBFanMeter.InputValue
When setting: DBFanMeter.InputValue=value

Value Description Type


value Input value Double

4 ● Explanation
Obtains or sets input value to display.
ActiveX Control

● Usage Example

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


Timer1.Tick
AxDBFanMeter1.InputValue =AxDBCommManager1.ReadDevice _
(DATABUILDERAXLibLB.DBPlcDevice.DKV5000_DM, "0")
End Sub

4-172 - KV COM+ Library User’s Manual -


4-3 ActiveX Control

DBBarMeter
DBFanMeter
 InputRangeLowerLimit
Property
 InputRangeUpperLimit
Can obtain or sets the lower limit of input range with InputRangeLowerLimit and the upper limit of input

Property Method Event


range with InputRangeUpperLimit.

● Syntax
When obtaining: LowerLimit = DBBarMeter.InputRangeLowerLimit
When setting: DBBarMeter.InputRangeLowerLimit = LowerLimit
When obtaining: UpperLimit = DBBarMeter.InputRangeUpperLimit
When setting: DBBarMeter.InputRangeUpperLimit = UpperLimit
When obtaining: LowerLimit = DBFanMeter.InputRangeLowerLimit
When setting: DBFanMeter.InputRangeLowerLimit = LowerLimit 4
When obtaining: UpperLimit = DBFanMeter.InputRangeUpperLimit

ActiveX Control
When setting: DBFanMeter.InputRangeUpperLimit = UpperLimit

Value Description Type


LowerLimit Lower limit of input range Double
UpperLimit Upper limit of input range Double

● Explanation
Can obtain or set the lower limit of input range with InputRangeLowerLimit and the upper limit of input
range with InputRangeUpperLimit.
Set value of InputRangeLowerLimit lower than that of InputRangeUpperLimit.

● References
"InputValue"(4-172 page)
"DisplayRangeLowerLimit"(4-175 page)
"DisplayRangeUpperLimit"(4-175 page)

● Usage Example

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _


MyBase.Load
AxDBFanMeter1.ScaleMarkingColor = Color.DarkOrange
AxDBFanMeter1.InputRangeLowerLimit = 0
AxDBFanMeter1.InputRangeUpperLimit = 1000
AxDBFanMeter1.DisplayRangeLowerLimit = 0
AxDBFanMeter1.DisplayRangeUpperLimit = 100
AxDBFanMeter1.ShowLowerAlarm = True
AxDBFanMeter1.ScaleMarkingLowerAlarmColor = Color.BlueViolet
AxDBFanMeter1.AlarmRangeLowerLimit = 10
AxDBFanMeter1.ShowUpperAlarm = True
AxDBFanMeter1.ScaleMarkingUpperAlarmColor = Color.Red
AxDBFanMeter1.AlarmRangeUpperLimit = 90
AxDBFanMeter1.ShowOptimumValue = True
AxDBFanMeter1.OptimumValue = 50
End Sub

- KV COM+ Library User’s Manual - 4-173


4-3 ActiveX Control

DBBarMeter
DBFanMeter

Reference When input value is out of input range (higher than the upper limit or lower than the lower
limit), the upper or lower limit of input range is displayed and value out of the range is
never displayed.
Property Method Event

Example) If the lower limit of input range is 1000, and the upper limit is 10000:
Input value is 500 => Displayed value is 1000
Input value is 20000 => Displayed value is 10000
When display range and input range are different, input value is displayed by converting
into display range.
Example) When the lower limit of input range is 0 and the upper limit is 1000, the

4 lower limit of display range is 0 and the upper limit is 300:

Input value
ActiveX Control

0 500 1000
Input range

Conversion

0 300
Display range
Converted value
150

4-174 - KV COM+ Library User’s Manual -


4-3 ActiveX Control

DBBarMeter
DBFanMeter
 DisplayRangeLowerLimit
Property
 DisplayRangeUpperLimit
Can obtain or set the lower limit of display range with DisplayRangeLowerLimit and the upper limit with

Property Method Event


DisplayRangeUpperLimit.

● Syntax
When obtaining: LowerLimit = DBBarMeter.DisplayRangeLowerLimit
When setting: DBBarMeter.DisplayRangeLowerLimit = LowerLimit
When obtaining: UpperLimit = DBBarMeter.DisplayRangeUpperLimit
When setting: DBBarMeter.DisplayRangeUpperLimit = UpperLimit
When obtaining: LowerLimit = DBFanMeter.DisplayRangeLowerLimit
When setting: DBFanMeter.DisplayRangeLowerLimit = LowerLimit 4
When obtaining: UpperLimit = DBFanMeter.DisplayRangeUpperLimit

ActiveX Control
When setting: DBFanMeter.DisplayRangeUpperLimit = UpperLimit

Value Description Type


LowerLimit Lower limit of display range Double
UpperLimit Upper limit of display range Double

● Explanation
Can obtain or set the lower limit of display range with DisplayRangeLowerLimit and the upper limit of
display range with DisplayRangeUpperLimit.
Set value of DisplayRangeLowerLimit lower than that of DisplayRangeUpperLimit.

● References
"InputValue"(4-172 page)
"DisplayRangeLowerLimit"(4-175 page)
"DisplayRangeUpperLimit"(4-175 page)

● Usage Example
See usage example of "InputRangeLowerLimit" and "InputRangeUpperLimit"(4-173 page).

- KV COM+ Library User’s Manual - 4-175


4-3 ActiveX Control

DBBarMeter
DBFanMeter

 AlarmRangeLowerLimit
Property
 AlarmRangeUpperLimit
Property Method Event

Can obtain or set the lower limit of alarm range with AlarmRangeLowerLimit and the upper limit with
AlarmRangeUpperLimit.

● Syntax
When obtaining: LowerLimit = DBBarMeter.AlarmRangeLowerLimit
When setting: DBBarMeter.AlarmRangeLowerLimit = LowerLimit
When obtaining: UpperLimit = DBBarMeter.AlarmRangeUpperLimit
When setting: DBBarMeter.AlarmRangeUpperLimit = UpperLimit

4 When obtaining: LowerLimit = DBFanMeter.AlarmRangeLowerLimit


When setting: DBFanMeter.AlarmRangeLowerLimit = LowerLimit
When obtaining: UpperLimit = DBFanMeter.AlarmRangeUpperLimit
ActiveX Control

When setting: DBFanMeter.AlarmRangeUpperLimit = UpperLimit

Value Description Type


LowerLimit Lower limit of alarm range Double
UpperLimit Upper limit of alarm range Double

● Explanation
Can obtain or set the lower limit of alarm range with AlarmRangeLowerLimit and the upper limit of
alarm range with AlarmRangeUpperLimit.
Set value of AlarmRangeLowerLimit lower than that of AlarmRangeUpperLimit.

● References
"ShowLowerAlarm"(4-178 page)
"ShowUpperAlarm"(4-178 page)
"ScaleMarkingLowerAlarmColor"(4-181 page)
"ScaleMarkingUpperAlarmColor"(4-181 page)

● Usage Example
See usage example of "InputRangeLowerLimit" and "InputRangeUpperLimit"(4-173 page).

4-176 - KV COM+ Library User’s Manual -


4-3 ActiveX Control

DBBarMeter
DBFanMeter
 OptimumValue Property

Obtains or sets optimum value.

● Syntax

Property Method Event


When obtaining: value = DBFanMeter.OptimumValue
When setting: DBFanMeter.OptimumValue = value
When obtaining: value = DBFanMeter.OptimumValue
When setting: DBFanMeter.OptimumValue = value

Value Description Type


value Optimum value Double

● Explanation 4
Obtains or sets optimum value.

ActiveX Control
● References
"ShowOptimumValue"(4-179 page)

● Usage Example
See usage example of "InputRangeLowerLimit" and "InputRangeUpperLimit"(4-173 page).

- KV COM+ Library User’s Manual - 4-177


4-3 ActiveX Control

DBBarMeter
DBFanMeter

 ShowLowerAlarm
Property
 ShowUpperAlarm
Property Method Event

Obtains or sets status of showing/hiding the lower limit of alarm with ShowLowerAlarm and the upper
limit with ShowUpperAlarm.

● Syntax
When obtaining: value = DBBarMeter.ShowLowerAlarm
When setting: DBBarMeter.ShowLowerAlarm = value
When obtaining: value = DBBarMeter.ShowUpperAlarm
When setting: DBBarMeter.ShowUpperAlarm = value

4 When obtaining: value = DBFanMeter.ShowLowerAlarm


When setting: DBFanMeter.ShowLowerAlarm = value
When obtaining: value = DBFanMeter.ShowUpperAlarm
ActiveX Control

When setting: DBFanMeter.ShowUpperAlarm = value

Value Description Type


value Status of showing/hiding Boolean

Value for ‘value’

Constant Description
True Displays alarm the upper/lower limit.
False Does not display alarm the upper/lower limit.

● Explanation
Obtains or sets status of showing/hiding the lower limit of alarm with ShowLowerAlarm and the upper
limit with ShowUpperAlarm.

● References
"AlarmRangeLowerLimit"(4-176 page)
"AlarmRangeUpperLimit"(4-176 page)
"ScaleMarkingLowerAlarmColor"(4-181 page)
"ScaleMarkingUpperAlarmColor"(4-181 page)

● Usage Example
See usage example of "InputRangeLowerLimit" and "InputRangeUpperLimit"(4-173 page).

4-178 - KV COM+ Library User’s Manual -


4-3 ActiveX Control

DBBarMeter
DBFanMeter
 ShowOptimumValue Property

Obtains or sets status of showing/hiding optimum value.

● Syntax

Property Method Event


When obtaining: value = DBFanMeter.ShowOptimumValue
When setting: DBFanMeter.ShowOptimumValue = value
When obtaining: value = DBFanMeter.ShowOptimumValue
When setting: DBFanMeter.ShowOptimumValue = value

Value Description Type


value Status of showing/hiding optimum value Boolean

Value for ‘value’ 4


Constant Description

ActiveX Control
True Displays optimum value.
False Does not display optimum value.

● Explanation
Obtains or sets status of showing/hiding optimum value.

● References
"OptimumValue"(4-177 page)

● Usage Example
See usage example of "InputRangeLowerLimit" and "InputRangeUpperLimit"(4-173 page).

- KV COM+ Library User’s Manual - 4-179


4-3 ActiveX Control

DBBarMeter
DBFanMeter

 ScaleMarkingColor Property

Obtains or sets scale color.


Property Method Event

● Syntax
When obtaining: value = DBFanMeter.ScaleMarkingColor
When setting: DBFanMeter.ScaleMarkingColor = value

Value Description Type


value Scale color System.Drawing.Color

● Explanation
4 Obtains or sets scale color.

● References
ActiveX Control

"InputRangeLowerLimit"(4-173 page)
"InputRangeUpperLimit"(4-173 page)

● Usage Example
See usage example of "InputRangeLowerLimit" and "InputRangeUpperLimit"(4-173 page).

4-180 - KV COM+ Library User’s Manual -


4-3 ActiveX Control

DBBarMeter
DBFanMeter
 ScaleMarkingLowerAlarmColor
Property
 ScaleMarkingUpperAlarmColor
Can obtain or set line color of lower limit of alarm with ScaleMarkingLowerAlarmColor and that of upper

Property Method Event


limit of alarm with ScaleMarkingUpperAlarmColor.

● Syntax
When obtaining: value = DBFanMeter.ScaleMarkingLowerAlarmColor
When setting: DBFanMeter.ScaleMarkingLowerAlarmColor = value
When obtaining: value = DBFanMeter.ScaleMarkingUpperAlarmColor
When setting: DBFanMeter.ScaleMarkingUpperAlarmColor = value

Value Description
Line color of alarm the lower limit or the
Type
4
value System.Drawing.Color
upper limit

ActiveX Control
● Explanation
Can obtain or set line color of lower limit of alarm with ScaleMarkingLowerAlarmColor and that of upper
limit of alarm with ScaleMarkingUpperAlarmColor.

● References
"AlarmRangeLowerLimit"(4-176 page)
"AlarmRangeUpperLimit"(4-176 page)
"ShowLowerAlarm"(4-178 page)
"ShowUpperAlarm"(4-178 page)

● Usage Example
See usage example of "InputRangeLowerLimit" and "InputRangeUpperLimit"(4-173 page).

- KV COM+ Library User’s Manual - 4-181


4-3 ActiveX Control

DBCommandButton
DBBarMeter
DBFanMeter

 BackgroundColor Property

Sets background color of control image.


Property Method Event

● Syntax
DBFanMeter.BackgroundColor = value

Value Description Type


value Background color System.Drawing.Color

● Explanation
Sets background color of control image.
4 BackgroundColor property can be changed directly from the property window, however, you need to
save and reload control in order to reflect on the actual control.
ActiveX Control

● Usage Example

DBCommandButton.BackgroundColor = System.Drawing.Color.AliceBlue
DBCommandButton.BackgroundColor = System.Drawing.Color.FromArgb(&HFFFF00)
DBCommandButton.BackgroundColor = System.Drawing.SystemColors.Control

DBFanMeter.BackgroundColor = System.Drawing.Color.AliceBlue
DBFanMeter.BackgroundColor = System.Drawing.Color.FromArgb(&HFFFF00)
DBFanMeter.BackgroundColor = System.Drawing.SystemColors.Control

DBBarMeter.BackgroundColor = System.Drawing.Color.AliceBlue
DBBarMeter.BackgroundColor = System.Drawing.Color.FromArgb(&HFFFF00)
DBBarMeter.BackgroundColor = System.Drawing.SystemColors.Control

4-182 - KV COM+ Library User’s Manual -


4-3 ActiveX Control

DBCommandButtonr

Methods

 GetStatus Method

Property Method Event


Obtains object status.

● Syntax
value=DBCommandButton.GetStatus

Value Description Type


value Status Integer

 SetStatus Method 4
Sets object status.

ActiveX Control
● Syntax
DBCommandButton.SetStatus=value

Value Description Type


value Status Integer

 GetStatusMax Method

Obtains the number of object status.


Switch and lamp include two types of status, lamp switch has four types of them, and N status lamp
depends on the used style.

● Syntax
value=DBCommandButton.GetStatusMax

Value Description Type


value The number of status Integer

 GetType Method

Obtains button type.

● Syntax
value=DBCommandButton.GetType

Value Description Type


value Type value Integer

Value for ‘value’

Value Description
0 Switch
1 Lamp switch
2 Lamp
3 N status lamp

- KV COM+ Library User’s Manual - 4-183


4-3 ActiveX Control

DBCommandButton

 GetMode Method

Obtains button mode.

● Syntax
Property Method Event

value=DBCommandButton.GetMode

Value Description Type


value Mode value Integer

Value for ‘value’

Value Description
4 0 Set
1 Reset
ActiveX Control

2 Bit invert
3 Momentary

 IsButtonPushed Method

Obtains button pushed flag.

● Syntax
value=DBCommandButton.IsButtonPushed

Value Description Type


value Button pushed flag Boolean

Constant Description
True Button was pushed.
False Button is not pushed.

 ResetButtonPushed Method

Resets button pushed flag.

● Syntax
DBCommandButton.ResetButtonPushed

 ShowPropDialog Method

Displays sub-property dialog box.

● Syntax
DBCommandButton.ShowPropDialog

 InvalidateCtrl Method

Redraws control. Often used after control property is changed.

● Syntax
DBCommandButton.InvalidateCtrl

4-184 - KV COM+ Library User’s Manual -


4-3 ActiveX Control

DBCommandButton

 SetInitMode Method

Sets mode for new creation.

● Syntax

Property Method Event


DBCommandButton.SetInitMode(value)

Value Description Type


value Mode value Integer

Value for ‘value’

Value Description
0 Switch 4
1 Lamp switch

ActiveX Control
2 Lamp
3 N status lamp

- KV COM+ Library User’s Manual - 4-185


4-3 ActiveX Control

DBCommandButton
DBBarMeter
DBFanMeter

Events

 Click Event
Property Method Event

Occurs when clicking object placed on the form.

● Syntax
Sub DBCommandButton_ClickEvent()
Sub DBBarMeter_ClickEvent()
Sub DBFanMeter_ClickEvent()

 DblClick Event
4 Occurs when double-clicking object placed on the form.
ActiveX Control

● Syntax
Sub DBCommandButton_DblClick()
Sub DBBarMeter_DblClick()
Sub DBFanMeter_DblClick()

 MouseDown Event

Occurs when pressing mouse button on the object placed on the form.

● Syntax
Sub DBCommandButton_MouseDownEvent()
Sub DBBarMeter_MouseDownEvent()
Sub DBFanMeter1_MouseDownEvent()

 MouseMove Event

Occurs when moving mouse pointer on the object placed on the form.

● Syntax
Sub DBCommandButton_MouseMoveEvent()
Sub DBBarMeter_MouseMoveEvent()
Sub DBFanMeter_MouseMoveEvent()

 MouseUp Event

Occurs when pressed mouse button is released on the object placed on the form.

● Syntax
Sub DBCommandButton_MouseUpEvent()
Sub DBBarMeter_MouseUpEvent()
Sub DBFanMeter_MouseUpEvent()

● Explanation
Occurs when pressed mouse button is released on the object placed on the form.

4-186 - KV COM+ Library User’s Manual -


4-4 Data Conversion Function
DBValueConverterEx

KV COM+ Library provides objects to interconvert device value and string.

DBValueConverterEx Object

Property Method Event


An object to provide function to convert from value data to string data, or from string data to value data.
Methods of DBValueConverterEx object performs conversion.

 Methods
Method name Description Reference

ValueToUnsignedText
Converts LONG variable to decimal 16-bit format string
without sign.
4-189 4
Converts LONG variable to decimal 16-bit format string with

Data Conversion Function


ValueToSignedText 4-189
sign.
ValueToHexText Converts LONG variable to hexadecimal 16-bit format string. 4-189
ValueToBcdText Converts LONG variable to 1BCD format string. 4-189
ValueToBinText Converts LONG variable to binary format string 4-189
Converts LONG variable divided into the higher and lower to
WValueToUnsignedText 4-190
decimal 32-bit format string without sign.
Converts LONG variable divided into the higher and lower to
WValueToSignedText 4-190
decimal 32-bit format string with sign.
Converts LONG variable divided into the higher and lower to
WValueToHexText 4-190
hexadecimal 32-bit format string.
Converts LONG variable divided into the higher and lower to
WValueToBcdText 4-190
32-bit BCD format string.
Converts LONG variable divided into the higher and lower to
WValueToBinText 4-190
binary 32-bit format string.
Converts LONG variables divided into the higher and lower
WValueToFloatText 4-191
to single precision floating point real number format string.
Converts string to represent decimal 16-bit without sign to
UnsignedTextToValue 4-192
LONG variable.
Converts string to represent decimal 16-bit with sign to
SignedTextToValue 4-192
LONG variable.
Converts string to represent hexadecimal 16-bit to LONG
HexTextToValue 4-192
variable.
BcdTextToValue Converts string to represent 16-bit BCD to LONG variable. 4-192
BinTextToValue Converts string to represent binary 16-bit to LONG variable. 4-192
Converts string to represent decimal 32-bit without sign to
UnsignedTextToWValue number and to two LONG variables of the higher and lower 4-194
digits.
Converts string to represent decimal 32-bit with sign to
SignedTextToWValue number and to two LONG variables of the higher and lower 4-194
digits.
Converts string to represent hexadecimal 32-bit to number
HexTextToWValue 4-194
and to two LONG variables of the higher and lower digits.
Converts string to represent 32-bit BCD to number and to
BcdTextToWValue 4-194
two LONG variables of the higher and lower digits.
Converts string to represent binary 32-bit to number and to
BinTextToWValue 4-194
two LONG variables of the higher and lower digits.

- KV COM+ Library User’s Manual - 4-187


4-4 Data Conversion Function

DBValueConverterEx

Method name Description Reference


Converts string to represent single precision floating point
FloatTextToWValue real number to number and to two LONG variables of the 4-196
higher and lower digits.
Property Method Event

Combines LONG variables divided into the higher and lower


WValueToSigned 4-197
digits and converts to one LONG variable.
Converts LONG variables divided into the higher and lower
WValueToFloat 4-197
to single precision floating point real number.
Converts LONG variable into two LONG variables divided
SignedToWValue 4-198
into the higher and lower.
Converts single precision floating point real number into two
FloatToWValue 4-198
4
LONG variables divided into the higher and lower.
Data Conversion Function

Point • Not available for VBScript.

4-188 - KV COM+ Library User’s Manual -


4-4 Data Conversion Function

DBValueConverterEx

Methods

 ValueToUnsignedText

Property Method Event


 ValueToSignedText

 ValueToHexText Method

 ValueToBcdText

 ValueToBinText
Converts Long variable to 16-bit string data format. 4
ValueToUnsignedText: Converts to decimal 16-bit format string without sign.

Data Conversion Function


ValueToSignedText: Converts to decimal 16-bit format string with sign.
ValueToHexText: Converts to hexadecimal 16-bit format string.
ValueToBcdText: Converts to 16-bit BCD format string.
ValueToBinText: Converts to binary 16-bit format string.

● Syntax
ValueToUnsignedText(value, strText)
ValueToSignedText(value, strText)
ValueToHexText(value, strText)
ValueToBcdText(value, strText)
ValueToBinText(value, strText)

Value Description Type


value Value to be converted Long
strText Converted string String

● Explanation
Converts Long variable to 16-bit string data format. Runtime error occurs when there is a value which
cannot be converted.
Only low 16-bit of converted value is used.

● Usage Example

Dim CV As DATABUILDERAXLibLB.DBValueConverterEx
Dim value As Integer
Dim valueH As Integer
Dim unsignedText As String
Dim signedText As String
Dim hexText As String
Dim bcdText As String
Dim binText As String

CV = New DATABUILDERAXLibLB.DBValueConverterEx
value = 1234
valueH = &H1234
CV.ValueToUnsignedText(value, unsignedText)
CV.ValueToSignedText(value, signedText)
CV.ValueToHexText(valueH,hexText)
CV.ValueToBcdText(valueH, bcdText)
CV.ValueToBinText(value, binText)
MsgBox(unsignedText + vbLf + signedText + vbLf + hexText + vbLf + bcdText + vbLf + binText)

- KV COM+ Library User’s Manual - 4-189


4-4 Data Conversion Function

DBValueConverterEx

 WValueToUnsignedText

 WValueToSignedText
Property Method Event

 WValueToHexText Method

 WValueToBcdText

 WValueToBinText
Converts two Long variables divided into the higher and lower digits to 32-bit string data format.
WValueToUnsignedText: Converts to decimal 32-bit format string without sign.

4 WValueToSignedText:
WValueToHexText:
Converts to decimal 32-bit format string with sign.
Converts to hexadecimal 32-bit format string.
WValueToBcdText: Converts to 32-bit BCD format string.
Data Conversion Function

WValueToBinText: Converts to binary 32-bit format string.

● Syntax
WValueToUnsignedText(valueL,valueH,strText)
WValueToSignedText(valueL,valueH, strText)
WValueToHexText(valueL,valueH, strText)
WValueToBcdText(valueL,valueH, strText)
WValueToBinText(valueL,valueH, strText)

Value Description Type


valueL The low 16 bit value to be converted Long
valueH The high 16 bit value to be converted Long
strText Converted strings String

● Explanation
Converts two Long variables divided into the high and low to 32-bit string data format. Runtime error
occurs when there is a value which cannot be converted.
Only low 16-bit of converted values (higher and lower) is used.

● Usage Example

Dim CV As DATABUILDERAXLibLB.DBValueConverterEx
Dim valueL As Long
Dim valueH As Long
Dim unsignedText As String
Dim signedText As String
Dim hexText As String
Dim bcdText As String
Dim binText As String

CV = New DATABUILDERAXLibLB.DBValueConverterEx
valueL = &H1234
valueH = &H5678
CV.WValueToUnsignedText(valueL, valueH, unsignedText)
CV.WValueToSignedText(valueL, valueH, signedText)
CV.WValueToHexText(valueL, valueH, hexText)
CV.WValueToBcdText(valueL, valueH, bcdText)
CV.WValueToBinText(valueL, valueH, binText)
MsgBox(unsignedText + vbLf + signedText + vbLf + hexText + vbLf + bcdText + vbLf + binText)

4-190 - KV COM+ Library User’s Manual -


4-4 Data Conversion Function

DBValueConverterEx

 WValueToFloatText Method

Converts two LONG variables divided into the high and low to string data format of single precision
floating point.

Property Method Event


● Syntax
WValueToFloatText(valueL,valueH,strText)

Value Description Type


valueL The low 16 bit value to be converted Long
valueH The high 16 bit value to be converted Long
strText Converted strings String

● Explanation 4
Converts two LONG variables divided into the high and low to string data format of single precision

Data Conversion Function


floating point. Conversion cannot be performed if data is not single precision floating point. Runtime
error occurs when there is a value which cannot be converted.
Only low 16-bit of converted values (higher and lower) is used.

● Usage Example

Dim CV As DATABUILDERAXLibLB.DBValueConverterEx
Dim valueL As Long
Dim valueH As Long
Dim floatText As String

CV = New DATABUILDERAXLibLB.DBValueConverterEx
valueL = &HE56
valueH = &H4049
CV.WValueToFloatText(valueL, valueH, floatText)
MsgBox(floatText)
'”3.1415” is stored in floatTesx.

- KV COM+ Library User’s Manual - 4-191


4-4 Data Conversion Function

DBValueConverterEx

 UnsignedTextToValue

 SignedTextToValue
Property Method Event

 HexTextToValue Method

 BcdTextToValue

 BinTextToValue
Converts string data to Long variable.
UnsignedTextToValue : Converts string to represent decimal without sign.

4 SignedTextToValue :
HexTextToValue:
Converts string to represent decimal with sign.
Converts string to represent hexadecimal.
BcdTextToValue : Converts string to represent BCD data.
Data Conversion Function

BinTextToValue: Converts string to represent binary data.

● Syntax
UnsignedTextToValue(strText, value )
SignedTextToValue(strText, value )
HexTextToValue(strText, value )
BcdTextToValue(strText, value )
BinTextToValue(strText, value )

Value Description Type


strText String to be converted String
value Converted string Long

● Explanation
Converts string data to specified data format and store in Long variable.
Runtime error occurs when there is a value which cannot be converted and if converted digit exceeds
16bit.

4-192 - KV COM+ Library User’s Manual -


4-4 Data Conversion Function

DBValueConverterEx

● Usage Example

Dim CV As DATABUILDERAXLibLB.DBValueConverterEx
Dim unsignedText As String
Dim signedText As String

Property Method Event


Dim hexText As String
Dim bcdText As String
Dim binText As String
Dim unsignedValue As Long
Dim signedValue As Long
Dim hexValue As String
Dim bcdValue As String
Dim binValue As String

CV = New DATABUILDERAXLibLB.DBValueConverterEx
unsignedText = "12345"
4
signedText = "-12345"

Data Conversion Function


hexText = "ABCD"
bcdText = "1234"
binText = "1010101010"
CV.UnsignedTextToValue(unsignedText, unsignedValue)
CV.SignedTextToValue(signedText, signedValue)
CV.HexTextToValue(hexText, hexValue)
CV.BcdTextToValue(bcdText, bcdValue)
CV.BinTextToValue(binText, binValue)

- KV COM+ Library User’s Manual - 4-193


4-4 Data Conversion Function

DBValueConverterEx

 UnsignedTextToWValue

 SignedTextToWValue
Property Method Event

 HexTextToWValue Method

 BcdTextToWValue

 BinTextToWValue
Converts string data to two Long variables divided into the higher and lower digits.
UnsignedTextToWValue : Converts string to represent decimal without sign.

4 SignedTextToWValue :
HexTextToWValue:
Converts string to represent decimal with sign.
Converts string to represent hexadecimal.
BcdTextToWValue : Converts string to represent BCD.
Data Conversion Function

BinTextToWValue: Converts string to represent binary.

● Syntax
UnsignedTextToWValue(strText, valueL ,valueH )
SignedTextToWValue(strText, valueL ,valueH )
HexTextToWValue(strText, valueL ,valueH )
BcdTextToWValue(strText, valueL ,valueH )
BinTextToWValue(strText, valueL ,valueH )

Value Description Type


strText String to be converted String
valueL The low 16 bit of converted value Long
valueH The high 16 bit of converted value Long

● Explanation
Converts string data to specified data format and store in two Long variables of the higher and lower
digits.
Runtime error occurs when there is a value which cannot be converted and if converted digits exceeds
32bit.

4-194 - KV COM+ Library User’s Manual -


4-4 Data Conversion Function

DBValueConverterEx

● Usage Example

Dim CV As DATABUILDERAXLibLB.DBValueConverterEx
Dim unsignedText As String
Dim signedText As String

Property Method Event


Dim hexText As String
Dim bcdText As String
Dim binText As String
Dim unsignedValueL As Long
Dim unsignedValueH As Long
Dim signedValueL As Long
Dim signedValueH As Long
Dim hexValueL As String
Dim hexValueH As String
Dim bcdValueL As String
Dim bcdValueH As String
4
Dim binValueL As String

Data Conversion Function


Dim binValueH As String

CV = New DATABUILDERAXLibLB.DBValueConverterEx
unsignedText = "12345678"
signedText = "-12345678"
hexText = "ABCDEF"
bcdText = "12345678"
binText = "1010101010101011010101"
CV.UnsignedTextToWValue(unsignedText, unsignedValueL, unsignedValueH)
CV.SignedTextToWValue(signedText, signedValueL, signedValueH)
CV.HexTextToWValue(hexText, hexValueL, hexValueH)
CV.BcdTextToWValue(bcdText, bcdValueL, bcdValueH)
CV.BinTextToWValue(binText, binValueL, binValueH)

- KV COM+ Library User’s Manual - 4-195


4-4 Data Conversion Function

DBValueConverterEx

 FloatTextToWValue Method

Converts string data of single precision floating point to store into two LONG variables of the higher and
lower digits.
Property Method Event

● Syntax
FloatTextToWValue(strText, valueL ,valueH )

Value Description Type


strText String to be converted String
valueL The low 16 bit of converted value Long
valueH The high 16 bit of converted value Long

4 ● Explanation
Converts string data of single precision floating point to store into two LONG variables of the higher and
Data Conversion Function

lower digits.
Runtime error occurs when there is a value which cannot be converted.

● Usage Example

Dim CV As DATABUILDERAXLibLB.DBValueConverterEx
Dim floatText As String
Dim floatValueL As Long
Dim floatValueH As Long

CV = New DATABUILDERAXLibLB.DBValueConverterEx
floatText = "+3.1415"
CV.FloatTextToWValue(floatText, floatValueL, floatValueH)

4-196 - KV COM+ Library User’s Manual -


4-4 Data Conversion Function

DBValueConverterEx

 WValueToSigned
Method
 WValueToFloat
Combines LONG variables divided into the high and low digits and converts to one variable.

Property Method Event


WValueToSigned: Converts to LONG variable.
WValueToFloat: Converts to single precision floating point real number.

● Syntax
WValueToSigned (valueL, valueH, value)
WValueToFloat (valueL, valueH, value)

Value Description Type


valueL
valueL
The low 16 bit of converted value
The high 16 bit of converted value
Long
Long
4
WValueToSigned: Long

Data Conversion Function


value Storage for converted value (32-bit)
WValueToFloat: Single

● Explanation
Combines LONG variables divided into the high and low digits and converts to one 32-bit variable.
Runtime error occurs when there is a value which cannot be converted.
Only the low 16-bit of valueL or valueH is used.

● Usage Example

Dim CV As DATABUILDERAXLibLB.DBValueConverterEx
Dim valueL As Long
Dim valueH As Long
Dim valueSined As Long
Dim valueFloat As Single

CV = New DATABUILDERAXLibLB.DBValueConverterEx()
valueL = &HE979
valueH = &HC2F6
CV.WValueToSigned(valueL, valueH, valueSined)
CV.WValueToFloat(valueL, valueH, valueFloat)

- KV COM+ Library User’s Manual - 4-197


4-4 Data Conversion Function

DBValueConverterEx

 SignedToWValue
Method
 FloatToWValue
Converts LONG variable or single precision floating point real number into two LONG variables divided
Property Method Event

into the high and low.


SignedToWValue: Converts LONG variable to the divided two LONG variables.
FloatToWValue: Converts single precision floating point real number to the divided two LONG
variables.

● Syntax
SignedToWValue (value, valueL, valueH)
FloatToWValue (value, valueL, valueH)

4 Value Description Type


WValueToSigned: Long
value Value to be converted
Data Conversion Function

WValueToFloat: Single
valueL The low 16 bit of converted value Long
valueH The high 16 bit of converted value Long

● Explanation
Converts LONG variable or single precision floating point real number into two LONG variables divided
into the higher and lower. Runtime error occurs when there is a value which cannot be converted.

● Usage Example

Dim CV As DATABUILDERAXLibLB.DBValueConverterEx
Dim valueSigned As Long
Dim valueFloat As Single
Dim valueLSigned As Long
Dim valueHSigned As Long
Dim valueLFloat As Long
Dim valueHFloat As Long

CV = New DATABUILDERAXLibLB.DBValueConverterEx()
valueSigned = -1000000
valueFloat = +123.456
CV.SignedToWValue(valueSigned, valueLSigned, valueHSigned)
CV.FloatToWValue(valueFloat, valueLFloat, valueHFloat)

4-198 - KV COM+ Library User’s Manual -


5

About DLL Function


About DLL Function 5

This chapter introduces the installation of DLL and DLL functions.

5-1 Installation of DLL . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-2


5-2 DLL Function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-3

- KV COM+ Library User’s Manual - 5-1


5-1 Installation of DLL

How to Set the Path

Set the path to the folder on which KV COM+ Library is installed before use.

Set a new function name and the directory which has the files in the environment functions of the
advanced settings in "control panel" of WINDOWS.
About DLL Function

Link Setting

Use DataBuilderVC.lib to set link. Explicit link is not supported.


Select "Project" -> "Settings" to display "Project settings" window.
Click "Link" tab and add "DataBuidlerVC.lib" to "Object/Library module".
5
Include File
Installation of DLL

Include the following header files in the required source files.

#include "DataBuilder.h"
#include "DBPlcDef.h"
#include "ACPathManager2.h"

5-2 - KV COM+ Library User’s Manual -


5-2 DLL Function
All of functions concerning to communication perform blocking (synchronous processing).
Character strings handled in DLL are unicode/shift JIS.

1 Constant, Type and Structure Definition

 DBHCONNECT

About DLL Function


Connection handle

● Definition

typedef void* DBHCONNECT;

● Explanation
Type of connection handles 5
 DBERROR

DLL Function
Error code

● Definition

typedef LONG DBERROR;

● Explanation
Type of error codes

 DBMode
Operation mode/state

● Definition

typedef enum { //Operation mode


DB_MODE_INVALID = 0,
DB_MODE_KV700_RUN, //RUN mode
DB_MODE_KV700_PROG, //PROG mode
DB_MODE_VT2_CF_UNLOCK, //Memory card unlocked
DB_MODE_VT2_CF_LOCK, //Memory card locked
} DBMode;

● Explanation
Represents the operation mode/state in KV-5500/5000/3000/1000/700 and VT3/DT.

- KV COM+ Library User’s Manual - 5-3


5-2 DLL Function

 DBTime
Time

● Definition

typedef struct { //Time


WORD wYear; //Year
WORD wMonth; //Month
About DLL Function

WORD wDay; //Day


WORD wHour; //Hour
WORD wMinute; //Minute
WORD wSecond; //Second
} DBTime;

● Explanation
Time specification structure
5
 DBDevInfo
DLL Function

Device information

● Definition

#define DB_BITDEV_RW_MAX 16 // Upper limit of read/write number (Bit device)


#define DB_WORDDEV_RW_MAX 32 // Upper limit of read/write number (Word device)
#define DB_LONG_RW_MAX 120 // Upper limit of read/write number (One time continuous word
device reading)
#define DB_DEV_LONG_RW_MAX 8192 // Upper limit of read/write number (Whole continuous word
device reading)
#define DB_RANDOM_RW_MAX (DB_BITDEV_RW_MAX + DB_WORDDEV_RW_MAX)
// Upper limit of random read/write number
#define DB_STRRW_BYTE_MAX 256 // Upper limit of bytes for read/write number of character strings
typedef struct { // Device information
WORD wKind; // Device type
DWORD dwNo; // Device No.
LONG lValue; // Value
WORD wRTLDataSize; // Data length
WORD wRTLDataType; // Data type
WORD wRTLIndicationForm; // Display format
DWORD wRTLManageIndex; // Management index No.
WCHAR szNo[DB_DEVITM_MAX]; // Item path
} DBDevInfo;

● Explanation
Structure which represents the device information of KV-5500/5000/3000/1000/700

5-4 - KV COM+ Library User’s Manual -


5-2 DLL Function

 DBDevInfoEx
Device information (expansion)

● Definition

typedef struct { //Device information


WORD wKind; //Device type
CHAR szNo[DB_DEVNO_MAX]; //Device No.

About DLL Function


LONG lValue; //Value
WORD wRTLDataSize; //Data length
WORD wRTLDataType; //Data type
WORD wRTLIndicationForm; //Display format
DWORD wRTLManageIndex; //Management index No.
} DBDevInfoEx;

● Explanation
Structure which represents the device information of KV-5500/5000/3000/1000/700
The format of device Nos. is as follows.
5

DLL Function
:= Device No. ""-" Bit No. in the device"
For example, "01000" represents specifying a device No. 01000.

"01000-12" represents specifying a bit 12 in a device No. 01000.

 DBPlcDevice
Device type definition

● Definition

typedef enum DBPlcDevice {


...
} DBPlcDevice;

● Explanation
Defines the device types of each model.
See "Device List" (A-4) for a list of devices you can set.

 DB_COMMENT_MAX
Maximum length of a device comment

● Definition

#define DB_COMMENT_MAX (32 + 1) // Maximum length of a device comment

● Explanation
Maximum length of a device comment

- KV COM+ Library User’s Manual - 5-5


5-2 DLL Function

 DBKvAlarmLog
KV-5500/5000/3000/1000/700 one alarm log

● Definition

#define DBKV_ALARM_LOG_MAX 64 //Maximum number of alarm logs


typedef struct { //KV700/1000 one alarm
WORD wNo; //Alarm relay No. (CRXXXX)
About DLL Function

BOOL bUpEdge; //Up (TRUE), Down (FALSE)


DBTime Time; //Time
} DBKvAlarmLog;

● Explanation
KV-5500/5000/3000/1000/700 one alarm log

 DBMachineType
5 Model information
DLL Function

● Definition

#define DB_NAMEMAX (38 + 1) //Maximum length of the unit model name


#define DB_MAKERMAX (44 + 1) //Maximum length of the PLC manufacture name
#define DB_PLCNAMEMAX (64 + 1) //Maximum length of the PLC model name
typedef struct { //Model information
CHAR szName[DB_NAMEMAX]; //Unit model name
CHAR szPLCMaker[DB_MAKERMAX]; //PLC manufacture name
CHAR szPLCName[DB_PLCNAMEMAX]; //PLC model name
} DBMachineType;

● Explanation
Retains the model information of KV-5500/5000/3000/1000/700.

5-6 - KV COM+ Library User’s Manual -


5-2 DLL Function

 Connection destination
Connection destination information

● Definition

typedef enum { //Communication route


DBCOMTYPE_RS232C = 1, //RS232C
DBCOMTYPE_USB = 2, //USB
DBCOMTYPE_TCP = 4, //TCP

About DLL Function


DBCOMTYPE_BLUETOOTH = 5 //BLUETOOTH
} DBComType;
#define DB_ADDR_MAX 250 + 1 //Maximum length of the address
typedef struct { //TCP communication parameter
CHAR szAddr[DB_ADDR_MAX]; //Address
WORD wPortNo; //Port No.
} DBComParamTCPA;
typedef struct { //TCP communication parameter

5
WCHAR szAddr[DB_ADDR_MAX]; //Address
WORD wPortNo; //Port No.
} DBComParamTCPW;
#define DB_COMPORT_MAX 16 //Maximum number of COM ports

DLL Function
typedef struct { //RS232C communication parameter
BYTE byComNo; //COM Port No.
DBComBaud BaudRate; //Communication speed
SHORT nStation; //Station No. (-1: No station No.)
} DBComParamRS232C;
#define DB_BLUETOOTH_DEVNAME_LEN 31 //Maximum number of characters in the
Bluetooth distinguish name
#define DB_BLUETOOTH_BD_LEN 18 //Number of characters in the Bluetooth
BD address
(xx:xx:xx:xx:xx:xx)
#define DB_BLUETOOTH_PASSKEY_LEN 17 //Maximum number of characters in the
Bluetooth pass key
typedef struct { //BLUETOOTH parameter
int iComPort; //Virtual COM port setting value (1-100)
int iStackType; //Protocol stack type
BOOL flgManual; //COM automatic/manual
CHAR szDeviceName[DB_BLUETOOTH_DEVNAME_LEN]; //Distinguish name
CHAR szBDAddress[DB_BLUETOOTH_BD_LEN]; //BD address(display value as it is)
CHAR szPassKey[DB_BLUETOOTH_PASSKEY_LEN]; //Passkey
} DBComParamBLUETOOTHA;
typedef struct { //BLUETOOTH parameter
int iComPort; //Virtual COM port setting value (1-100)
int iStackType; //Protocol stack type
BOOL flgManual; //COM automatic/manual
WCHAR szDeviceName[DB_BLUETOOTH_DEVNAME_LEN]; //Distinguish name
WCHAR szBDAddress[DB_BLUETOOTH_BD_LEN]; //BD address(display value as it is)
WCHAR szPassKey[DB_BLUETOOTH_PASSKEY_LEN]; //Passkey
} DBComParamBLUETOOTHW;
typedef struct { //Connection configuration information
DBComType Type; //Communication route
DBComParamTCPA ParamTCP; //TCP communication parameter
DBComParamRS232C ParamRS232C; //RS232C communication parameter
DBComParamBLUETOOTHA ParamBLUETOOTH; //BLUETOOTH parameter
} DBComInfoA;
typedef struct { //Connection configuration information
DBComType Type; //Communication route
DBComParamTCPW ParamTCP; //TCP communication parameter
DBComParamRS232C ParamRS232C; //RS232C communication parameter
DBComParamBLUETOOTHW ParamBLUETOOTH; //BLUETOOTH parameter
} DBComInfoW;

● Explanation
Structure concerning to connection destination

- KV COM+ Library User’s Manual - 5-7


5-2 DLL Function

2 Initialization of DataBuilder.dll

 DBInit
Initializes DataBuilder.dll.

● Syntax
ret = DBInit(void)
About DLL Function

Value Content Format


Return value
ret TRUE: Initialization success BOOL
FALSE: Initialization failure

● Explanation
5 Initializes DataBuilder.dll.
Make sure to perform DBInit() before using DataBuilder.dll.
DLL Function

● Usage Example

if(!DBInit()){
MessageBox("Initialization failure","Initialization failed ",MB_OK);
return;
}

5-8 - KV COM+ Library User’s Manual -


5-2 DLL Function

3 Connection Control

 DBConnect
Starts communication with KV-5500/5000/3000/1000/700.

● Syntax
ret = DBConnect(lpszDestName, PlcId, lphConnect)

About DLL Function


Value Content Format
Return value
DB_NOERROR: Normal exit
ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page)
This is the pointer of buffer which stores the connection destination
name and terminates with ’\0’.
• In RS-232C
5
Specifies communications port and speed as follows.

DLL Function
"COMx,speed" COMx : Specification of the port No. (1 to 16)
speed : Communication speed
(9600,19200,38400,57600,115200)
Example) "COM1,9600"
• In USB
Specifies as "USB".
• In Ethernet
Specifies with IP address or host name.
"The other end of communication: Port No." The other end of
communication :IP address or host name
Port No.: Port No.
lpszDestName LPCTSTR
Example) "192.168.0.10:8500"
"localhost:8500"
• In Bluetooth
Specifies parameters such as BD address as follows.
"(P1),(P2),(P3),(P4),(P5),(P6)"
P1: Virtual COM port setting value (1-100)
P2: Protocol stack type (0-3)
(* Set 0. When a Bluetooth communication driver of a
Bluetooth dongle manufacture is used, communication with
0 may fail. Please contact the nearest office.)
P3: Automatic/Manual (0: COM automatic, 1: Manual)
P4: Distinguish name (Distinguish name set by "KV STUDIO")
P5: BD address
P6: Passkey (Pass key set by "KV STUDIO")
Example) "1,1,0,KV-5000,00:00:00:00:00:00,1111"

- KV COM+ Library User’s Manual - 5-9


5-2 DLL Function

Value Content Format


• In routing setting
Specifies the equipment and route to be routed, equipment to be
connected etc.
"(Basic information setting);
Via,(P01),(P02),(P03),(P04),(P05),(P06),
(P07),(P08),(P09),(P10),(P11)"
Basic information setting: Communication to the equipment to be
About DLL Function

routed
P01: Communication port assigned value
Communication with PLC connected by Serial
DLLTYPE_SERI(1)
Communication with PLC connected by USB
DLLTYPE_USB(2)
Communication with PLC connected by Ethernet
DLLTYPE_IP (4)
5 Communication via VT connected by Serial
DLLTYPE_VTSERI (7)
Communication via VT connected by USB
DLL Function

DLLTYPE_VTUSB (8)
Communication via VT connected by Ethernet
DLLTYPE_VTIP (9)
Communication via DT connected by USB
lpszDestName DLLTYPE_DTUSB (10) LPCTSTR
Communication via KV connected by USB
DLLTYPE_KVUSB (13)
Bluetooth direct-connection with PLC
DLLTYPE_BLUETOOTH(15)
Communication via KV connected by Bluetooth
DLLTYPE_ACL_BLUETOOTH(16)
P02:Communication destination equipment (1: KV-1000/700,2:
KV-5000/3000)
P03:PC-side communications port (2: Ethernet, 3: Serial, 4:
USB, 5: Bluetooth)
P04:Via VT/DT (1: Used, 2: Not used)
P05:VT/DT model(1: DT-100A, 2: VT2, 3: VT3)
P06:Communication method with KV via VT/DT (1: Serial, 2: Via
LM20V)
P07:Via FL-net (1: Used, 2: Not used)
P08:Via EtherNet/IP (1: Used, 2: Not used)
P09:Routing unit No. (0 to 48)
P10:Routing unit name (Same as the routing unit No. 0 to 48)
P11:Routing unit address
Via FL-net: Node No. 1 to 254
Via EtherNet/IP: IP address
Example)"USB;Via,,10,2,4,2,1,1,2,1,0,0,192.168.0.10"
PlcId Connection unit type. Specify PLCID defined by DBPlcDef.h. DBPlcId
When communication succeeds, a connection handle is set. In
lphConnect DBHCONNECT*
subsequent communication, this connection handle is used.

● Explanation
Starts communication with KV-5500/5000/3000/1000/700.
• In TCP/IP, When something other than IP address is specified, name resolution is performed for
Local HOSTS and DNS in that order.
• When an error occurs, communication is disconnected. (DBDisconnect() is called internally).

● Related Item
"DBDisconnect"(5-12 page)

5-10 - KV COM+ Library User’s Manual -


5-2 DLL Function

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
//Communication starts
err=DBConnect("USB",DBPLC_DKV5000,&hConnect);
if(DB_NOERROR!=err){
//Processing when an communication error occurs
return;

About DLL Function


}
//Communication stops
DBDisconnect(hConnect);

DLL Function

- KV COM+ Library User’s Manual - 5-11


5-2 DLL Function

 DBDisconnect
Terminates communication with KV-5500/5000/3000/1000/700

● Syntax
ret = DBDisconnect( hConnect)

Value Content Format


Return value
About DLL Function

DB_NOERROR: Normal termination


ret DBERROR
DB_ERR_INVALID_HANDLE: When the communication
destination indicated by hConnect does not exist
hConnect Connection handle DBHCONNECT

● Explanation
Terminates communication with KV-5500/5000/3000/1000/700.
5 ● Related Item
DLL Function

"DBConnect"(5-9 page)

● Usage Example
See "DBConnect"(5-9 page) for usage examples.

5-12 - KV COM+ Library User’s Manual -


5-2 DLL Function

4 Operation Mode/State Control

Acquires or sets the operation mode/state of KV-5500/5000/3000/1000/700.


KV-5500/5000/3000/1000/700 has RUN mode/PROGRAM mode.

 DBChangeMode
Changes the operation mode/state of KV-5500/5000/3000/1000/700.

About DLL Function


● Syntax
ret = DBChangeMode(hConnect, Mode)

Value Content Format


Return value
DB_NOERROR: Normal termination
ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page). 5
hConnect Connection handle DBHCONNECT

DLL Function
Mode Specifies the mode/state defined by DBMode. DBMode

● Explanation
Changes the operation mode/state of KV-5500/5000/3000/1000/700.

● Related Item
"DBQueryMode"(5-14 page)

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
//Communication starts
err= DBConnect("USB", DBPLC_DKV5000, &hConnect);
if (DB_NOERROR != err) {
//Error handling
return;
}
//Shifts KV-5500/5000/3000/1000/700 to RUN mode
err = DBChangeMode(hConnect, DB_MODE_KV700_RUN);
if (DB_NOERROR != err) {
//Error handling
}

- KV COM+ Library User’s Manual - 5-13


5-2 DLL Function

 DBQueryMode
Acquires the operation mode/state of KV-5500/5000/3000/1000/700.

● Syntax
ret = DBQueryMode(hConnect, lpMode)

Value Content Format


Return value
About DLL Function

DB_NOERROR: Normal termination


ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
When terminated normally, the operation mode/state defined by
lpMode DBMode *
DBMode is set.

5 ● Explanation
Acquires the operation mode/state of KV-5500/5000/3000/1000/700.
DLL Function

● Related Item
"DBChangeMode"(5-13 page)

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
DBMode Mode;
//Communication starts
err= DBConnectA("USB", DBPLC_DKV5000, &hConnect);
if (DB_NOERROR != err) {
//Error handling
return;
}
//Acquires the operation mode of KV-5500/5000/3000/1000/700
err = DBQueryMode(hConnect, &Mode);
if (DB_NOERROR != err) {
//Error handling
}
if (DB_MODE_KV700_RUN == Mode) {
//KV-5500/5000/3000/1000/700 is in RUN mode
m_radio3->SetCheck(BST_CHECKED);
} else if (DB_MODE_KV700_PROG == Mode) {
//KV-5500/5000/3000/1000/700 is PROGRAM mode
m_radio4->SetCheck(BST_CHECKED);
}

5-14 - KV COM+ Library User’s Manual -


5-2 DLL Function

5 Read/Write to a Device

There are five methods to read a device, and four methods to write to a device.
• Read/write a value in a device.
DBRead()、DBWrite()
• Read/write a value in multiple continuous devices.
DBReadArea()、DBWriteArea()、DBReadLong()、DBWriteLong()

About DLL Function


• Batch read/write to various types of devices.
DBKvReadRandom()、DBKvWriteRandom()
• Read using monitor registration.
DBRegMonitorBit()、DBReadMonitorDataBit()
DBRegMonitorWord()、DBReadMonitorDataWord()
• Read/write text data with the specified device as the beginning.
DBReadText()、DBWriteText()

 DBRead
5
Reads a value in a specified device.

DLL Function
● Syntax
ret = DBRead(hConnect, lpDevInfo)

Value Content Format


Return value
DB_NOERROR: Normal termination
ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Set the device type of the device to read in lpDevInfo->wKind in
WORD format, and the device No. in lpDevInfo->dwNo in
DWORD format.
lpDevInfo When terminated normally, the value read in lpDevInfo->lValue is DBDevInfo *
set in LONG format.
See the definition of DBPlcDevice for the device types and No.
which can be set.

● Explanation
Reads one device value.
As for a bit device, the device value is 1 when ON, and 0 when OFF.

● Related Item
"DBWrite"(5-17 page)
"DBReadArea"(5-19 page)
"DBWriteArea"(5-21 page)
"DBReadLong"(5-23 page)
"DBWriteLong"(5-25 page)
"DBKvReadRandom"(5-27 page)
"DBKvWriteRandom"(5-29 page)
"DBKvReadMonitorDataBit"(5-33 page)
"DBKvReadMonitorDataWord"(5-36 page)
"DBReadText"(5-37 page)
"DBWriteText"(5-39 page)

- KV COM+ Library User’s Manual - 5-15


5-2 DLL Function

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
DBDevInfo DevInfo;
//Communication start
err= DBConnectA("USB", DBPLC_DKV5000, &hConnect);
if (DB_NOERROR != err) {
//Error handling
About DLL Function

return;
}
//Read the value of DM0
DevInfo.wKind = DKV5000_DM;
DevInfo.dwNo = 0;
err = DBRead(hConnect, &DevInfo);
if (DB_NOERROR != err) {
//Error handling
5 }
return;

//DevInfo.lValue The read value


DLL Function

5-16 - KV COM+ Library User’s Manual -


5-2 DLL Function

 DBWrite
Writes a value to the specified device.

● Syntax
ret = DBWrite(hConnect, lpDevInfo)

Value Content Format


Return value

About DLL Function


DB_NOERROR: Normal termination
ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Device information
Set the type of the device to write in lpDevInfo->wKind in WORD
format, the device No. in lpDevInfo->dwNo in DWORD format,
lpDevInfo
and the device value in lpDevInfo->lValue in LONG format.
See the definition of DBPlcDevice for the device types and
const DBDevInfo *
5
device No. which can be set.

DLL Function
● Explanation
Writes a value to the specified device.
• For a bit device, set 1 in lpDevInfo->lValue when ON, and 0 when OFF.
• CTC contact cannot be ON.

● Related Item
"DBRead"(5-15 page)
"DBReadArea"(5-19 page)
"DBWriteArea"(5-21 page)
"DBReadLong"(5-23 page)
"DBWriteLong"(5-25 page)
"DBKvReadRandom"(5-27 page)
"DBKvWriteRandom"(5-29 page)
"DBKvReadMonitorDataBit"(5-33 page)
"DBKvReadMonitorDataWord"(5-36 page)
"DBReadText"(5-37 page)
"DBWriteText"(5-39 page)

- KV COM+ Library User’s Manual - 5-17


5-2 DLL Function

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
DBDevInfo DevInfo;
//Communication start
err= DBConnectA("USB", DBPLC_DKV5000, &hConnect);
if (DB_NOERROR != err) {
//Error handling
About DLL Function

return;
}
//Writes to DM
DevInfo.wKind = DKV5000_DM;
DevInfo.dwNo = 100;
DevInfo.lValue = 1000;
err = DBWrite(hConnect, &DevInfo);
if (DB_NOERROR != err) {
5 //Error handling
return;
}
DLL Function

5-18 - KV COM+ Library User’s Manual -


5-2 DLL Function

 DBReadArea
Reads continuous devices.

● Syntax
ret = DBReadArea(hConnect, wKind, dwFirstNo, lCount,aDevInfo[])

Value Content Format


Return value

About DLL Function


DB_NOERROR: Normal termination
ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Device type
wKind See the definition of DBPlcDevice for the device types which can WORD
be set.

dwFirstNo
Initial device No. of the devices to read
See the definition of DBPlcDevice for the device No. which can DWORD
5
be set.

DLL Function
Number of the devices to read
The maximum number is as follows.
lCount As for bit devices, DB_BITDEV_RW_MAX (16) LONG
As for word/double-word devices, DB_WORDDEV_RW_MAX
(32)
Device information (array)
Secure lCount number's aDevInfo arrays by the caller.
aDevInfo DBDevInfo
When terminated normally, the device type, device No. and read
value is set in an array of aDevinfo.

● Explanation
Reads continuous devices.
• In a bit device, the device value is 1 when ON, and 0 when OFF.
• Use DBKvReadRandom() to batch-read different types of devices or noncontinuous devices.

● Related Item
"DBRead"(5-15 page)
"DBWrite"(5-17 page)
"DBWriteArea"(5-21 page)
"DBReadLong"(5-23 page)
"DBWriteLong"(5-25 page)
"DBKvReadRandom"(5-27 page)
"DBKvWriteRandom"(5-29 page)
"DBKvReadMonitorDataBit"(5-33 page)
"DBKvReadMonitorDataWord"(5-36 page)
"DBReadText"(5-37 page)
"DBWriteText"(5-39 page)

- KV COM+ Library User’s Manual - 5-19


5-2 DLL Function

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
DBDevInfo aDevInfo[10];
//Communication start
err= DBConnect("USB", DBPLC_DKV5000, &hConnect);
if (DB_NOERROR != err) {
//Error handling
About DLL Function

return;
}
//Reads the values of DM0 to DM9
err = DBReadArea(hConnect, DKV5000_DM, 0, 10, aDevInfo);
if (DB_NOERROR != err) {
//Error handling
return;
}
5 //aDevInfo[0].lValue The read value of DM0
//aDevInfo[1].lValue The read value of DM1
DLL Function

5-20 - KV COM+ Library User’s Manual -


5-2 DLL Function

 DBWriteArea
Writes to continuous devices.

● Syntax
ret = DBWriteArea(hConnect, wKind, dwFirstNo, lCount, aDevInfo[])

Value Content Format


Return value

About DLL Function


DB_NOERROR: Normal termination
ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Device type
wKind See the definition of DBPlcDevice for the device types which can WORD
be set.

dwFirstNo
Initial device No. of the devices to write
See the definition of DBPlcDevice for the device Nos. which can DWORD
5
be set.

DLL Function
Number of the devices to write
The maximum number is as follows.
lCount As for bit devices, DB_BITDEV_RW_MAX (16) LONG
As for word/double-word devices, DB_WORDDEV_RW_MAX
(32)
Device information (array)
Set the value to write in aDevInfo[x].lValue.
When x is 0, write aDevInfo[x].lValue to the device whose device
aDevInfo const DBDevInfo
No. is dwFirstNo.
When x is 1, write aDevInfo[x].lValue to the device whose device
No. is dwFirstNo+1.

● Explanation
Writes to continuous devices.
• For a bit device, set 1 in aDevInfo[x].lValue when ON, and 0 when OFF.
• CTC contact cannot be ON.
• Use DBKvWriteRandom() to batch-write different types of devices or noncontinuous devices.

● Related Item
"DBRead"(5-15 page)
"DBWrite"(5-17 page)
"DBReadArea"(5-19 page)
"DBReadLong"(5-23 page)
"DBWriteLong"(5-25 page)
"DBKvReadRandom"(5-27 page)
"DBKvWriteRandom"(5-29 page)
"DBKvReadMonitorDataBit"(5-33 page)
"DBKvReadMonitorDataWord"(5-36 page)
"DBReadText"(5-37 page)
"DBWriteText"(5-39 page)

- KV COM+ Library User’s Manual - 5-21


5-2 DLL Function

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
DBDevInfo aDevInfo[3];
//Communication start
err= DBConnect("USB", DBPLC_DKV5000, &hConnect);
if (DB_NOERROR != err) {
//Error handling
About DLL Function

return;
}
//Writes a value to DM0 to DM2 (Write 100 to DM0, 200 to DM1 and 300 to DM2)
aDevInfo[0].lValue = 100;
aDevInfo[1].lValue = 200;
aDevInfo[2].lValue = 300;
err = DBWriteArea(hConnect, DKV5000_DM, 0, 3, aDevInfo);
if (DB_NOERROR != err) {
5 //Error handling
return;
}
DLL Function

5-22 - KV COM+ Library User’s Manual -


5-2 DLL Function

 DBReadLong
Acquires data through multiple scan, and reads continuous devices up to 8192 words.

● Syntax
ret = DBReadLong(hConnect, wKind, dwFirstNo, lCount,aDevInfo[])

Value Content Format


Return value

About DLL Function


DB_NOERROR: Normal termination
ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Device type
wKind See the definition of DBPlcDevice for the device types which can WORD
be set.

dwFirstNo
Initial device No. of the devices to be read
See the definition of DBPlcDevice for the device No. which can DWORD
5
be set.

DLL Function
Number of the devices read
lCount Reads up to DB_DEV_LONG_RW_MAX (8192) of devices LONG
continuously.
Device information (array)
Secure ICount number's aDevInfo array by the caller.
aDevInfo DBDevInfo
When terminated normally, the device type, device No. and read
value is set in an array of aDevInfo.

● Explanation
Acquires data through multiple scan, and read continuous devices up to 8192 words.
• In a bit device, the device value is 1 when ON, and 0 when OFF.
• Use DBKvReadRandom() to batch-read different types of devices and noncontinuous devices.

● Related Item
"DBRead"(5-15 page)
"DBWrite"(5-17 page)
"DBReadArea"(5-19 page)
"DBWriteArea"(5-21 page)
"DBWriteLong"(5-25 page)
"DBKvReadRandom"(5-27 page)
"DBKvWriteRandom"(5-29 page)
"DBKvReadMonitorDataBit"(5-33 page)
"DBKvReadMonitorDataWord"(5-36 page)
"DBReadText"(5-37 page)
"DBWriteText"(5-39 page)

- KV COM+ Library User’s Manual - 5-23


5-2 DLL Function

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
DBDevInfo aDevInfo[4096];
//Communication start
err= DBConnect("USB", DBPLC_DKV5000, &hConnect);
if (DB_NOERROR != err) {
//Error handling
About DLL Function

return;
}
//Reads the values of DM0 to DM9
err = DBReadLong(hConnect, DKV5000_DM, 0, 10, aDevInfo);
if (DB_NOERROR != err) {
//Error handling
return;
}
5 //aDevInfo[0].lValue The read value of DM0
//aDevInfo[1].lValue The read value of DM1
DLL Function

5-24 - KV COM+ Library User’s Manual -


5-2 DLL Function

 DBWriteLong
Writes values to devices through multiple scan and up to 8192 continuous devices.

● Syntax
ret = DBWriteLong(hConnect, wKind, dwFirstNo, lCount,const DBDevInfo aDevInfo[])

Value Content Format


Return value

About DLL Function


DB_NOERROR: Normal termination
ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Device type
wKind See the definition of DBPlcDevice for the device type which can WORD
be set.

dwFirstNo
Initial device No. of the devices to write
See the definition of DBPlcDevice for the device Nos. which can DWORD
5
be set.

DLL Function
Number of the devices to write
lCount LONG
Writes to up to DB_DEV_LONG_RW_MAX (8192) of devices.
Device information (array)
Set the value to write in aDevInfo[x].lValue.
When x is 0, write aDevInfo[x].lValue to the device whose device
aDevInfo const DBDevInfo
No. is dwFirstNo.
When x is 1, write aDevInfo[x].lValue to the device whose device
No. is dwFirstNo+1.

● Explanation
Writes values to devices through multiple scan and up to 8192 continuous devices.
• For a bit device, set 1 in aDevInfo[x].lValue when ON, and 0 when OFF.
• CTC contact cannot be ON.
• Use DBKvWriteRandom() to batch-write to different types of devices and noncontinuous devices.

● Related Item
"DBRead"(5-15 page)
"DBWrite"(5-17 page)
"DBReadArea"(5-19 page)
"DBWriteArea"(5-21 page)
"DBReadLong"(5-23 page)
"DBKvReadRandom"(5-27 page)
"DBKvWriteRandom"(5-29 page)
"DBKvReadMonitorDataBit"(5-33 page)
"DBKvReadMonitorDataWord"(5-36 page)
"DBReadText"(5-37 page)
"DBWriteText"(5-39 page)

- KV COM+ Library User’s Manual - 5-25


5-2 DLL Function

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
DBDevInfo aDevInfo[4096];
//Communication start
err= DBConnect("USB", DBPLC_DKV5000, &hConnect);
if (DB_NOERROR != err) {
//Error handling
About DLL Function

return;
}
//Writes values to DM0 to DM4095
// (Write 100 to DM0, 200 to DM1, 300 to DM2, ..., 1234 to DM4095)
aDevInfo[0].lValue = 100;
aDevInfo[1].lValue = 200;
aDevInfo[2].lValue = 300;
:
5 aDevInfo[4095].lValue = 1234;
err = DBWriteLong(hConnect, DKV5000_DM, 0, 4096, aDevInfo);
if (DB_NOERROR != err) {
DLL Function

//Error handling
return;
}

5-26 - KV COM+ Library User’s Manual -


5-2 DLL Function

 DBKvReadRandom
Batch-reads different types of devices and noncontinuous devices.

● Syntax
ret = DBKvReadRandom(hConnect, lCount, aDevInfo[])

Value Content Format


Return value

About DLL Function


DB_NOERROR: Normal termination
ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Number of the devices to read.
The maximum number is as follows.
As for bit devices, DB_BITDEV_RW_MAX (16)
lCount
As for word/double-word devices, DB_WORDDEV_RW_MAX
(32)
LONG
5
Sets up to 48 (16 bit devices + 32 word/double-word devices).

DLL Function
Device information (array)
Set the device types in aDevInfo[x].wKind, and device Nos. in
aDevInfo[x].dwNo to the device to read.
aDevInfo When terminated normally, the results of reading each device is DBDevInfo
set in aDevInfo[x].lValue.
See the definition of DBPlcDevice for the device types and
device Nos. which can be set.

● Explanation
Batch-reads different types of devices and noncontinuous devices.
DB_NOERROR: Normal termination
Other than above: Error
See "Error Message Lists"(A-10 page).

● Related Item
"DBRead"(5-15 page)
"DBWrite"(5-17 page)
"DBReadArea"(5-19 page)
"DBWriteArea"(5-21 page)
"DBReadLong"(5-23 page)
"DBWriteLong"(5-25 page)
"DBKvWriteRandom"(5-29 page)
"DBKvReadMonitorDataBit"(5-33 page)
"DBKvReadMonitorDataWord"(5-36 page)
"DBReadText"(5-37 page)
"DBWriteText"(5-39 page)

- KV COM+ Library User’s Manual - 5-27


5-2 DLL Function

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
DBDevInfo aDevInfo[3];
//Communication start
err= DBConnect("USB", DBPLC_DKV5000, &hConnect);
if (DB_NOERROR != err) {
//Error handling
About DLL Function

return;
}
//Reads the values of DM0, DM100 and TM5
aDevInfo[0].wKind = DKV5000_DM;
aDevInfo[0].dwNo = 0;
aDevInfo[1].wKind = DKV5000_DM;
aDevInfo[1].dwNo = 100;
aDevInfo[2].wKind = DKV5000_TM;
5 aDevInfo[2].dwNo = 5;
err = DBKvReadRandom(hConnect, 3, aDevInfo);
if (DB_NOERROR != err) {
DLL Function

//Error handling
return;
}
//aDevInfo[0].lValue The read value of DM0
//aDevInfo[1].lValue The read value of DM100
//aDevInfo[2].lValue The read value of TM5

5-28 - KV COM+ Library User’s Manual -


5-2 DLL Function

 DBKvWriteRandom
Batch-writes to different types of devices and noncontinuous devices.

● Syntax
ret = DBKvWriteRandom(hConnect, lCount, aDevInfo[]);

Value Content Format


Return value

About DLL Function


DB_NOERROR: Normal termination
ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Number of the devices to write
The maximum number is as follows.
As for bit devices, DB_BITDEV_RW_MAX (16)
lCount As for word/double-word devices, DB_WORDDEV_RW_MAX
(32)
LONG
5
Number of devices to write

DLL Function
Sets up to 48 (16 bit devices + 32 word/double-word devices).
Device information (array)
Sets the device types in aDevInfo[x].wKind, device Nos. in
aDevInfo[x].dwNo and device values in aDevInfo[x].lValue to the
aDevInfo const DBDevInfo
device to write.
See the definition of DBPlcDevice for the device types and
device Nos. which can be set.

● Explanation
Batch-writes to different types of devices and noncontinuous devices.
• As for a bit device, set 1 in aDevInfo[x].lValue when ON, and 0 when OFF.
• CTC contact cannot be ON.

● Related Item
"DBRead"(5-15 page)
"DBWrite"(5-17 page)
"DBReadArea"(5-19 page)
"DBWriteArea"(5-21 page)
"DBReadLong"(5-23 page)
"DBWriteLong"(5-25 page)
"DBKvReadRandom"(5-27 page)
"DBKvReadMonitorDataBit"(5-33 page)
"DBKvReadMonitorDataWord"(5-36 page)
"DBReadText"(5-37 page)
"DBWriteText"(5-39 page)

- KV COM+ Library User’s Manual - 5-29


5-2 DLL Function

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
DBDevInfo aDevInfo[3];
//Starts communication
err= DBConnect("USB", DBPLC_DKV5000, &hConnect);
if (DB_NOERROR != err) {
//Error handling
About DLL Function

return;
}
//Writes 100 to DM0, 200 to DM100 and 300 to TM5
aDevInfo[0].wKind = DKV5000_DM;
aDevInfo[0].dwNo = 0;
aDevInfo[0].lValue = 100;
aDevInfo[1].wKind = DKV5000_DM;
aDevInfo[1].dwNo = 100;
5 aDevInfo[1].lValue = 200;
aDevInfo[2].wKind = DKV5000_TM;
aDevInfo[2].dwNo = 5;
DLL Function

aDevInfo[2].lValue = 300;
err = DBKvWriteRandom(hConnect, 3, aDevInfo);
if (DB_NOERROR != err) {
//Error handling
return;
}

5-30 - KV COM+ Library User’s Manual -


5-2 DLL Function

 DBKvRegMonitorBit
Performs monitor registration for a bit device.

● Syntax
ret = DBKvRegMonitorBit(hConnect, byBankNo, lCount,aDevInfo[]);

Value Content Format


Return value

About DLL Function


DB_NOERROR: Normal termination
ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Bank No. (0-3)
Can register up to DBKV_MONITOR_DEVICE_MAX (32) in one
byBankNo BYTE
bank. Independent from the bank of monitor registration (word
device).
Specifies the number of devices for which monitors are
5
lCount registered. When 0 is specified, the monitor registration LONG

DLL Function
information is cleared.
Set the device type of the device to be registered in
aDevInfo[x].wKind, and the device No. in aDevInfo[x].dwNo.
aDevInfo const DBDevInfo
The object device type is bit format only. aDevInfo is used to read
a monitor.

● Explanation
Performs monitor registration for a bit device.
• When this function is performed, monitor registration is performed after clearing the monitor
information of the specified bank (Cannot add monitor registration).
• Cannot register two or more banks simultaneously.

● Related Item
"DBKvReadMonitorDataBit"(5-33 page)
"DBKvRegMonitorWord"(5-34 page)
"DBKvReadMonitorDataWord"(5-36 page)

- KV COM+ Library User’s Manual - 5-31


5-2 DLL Function

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
DBDevInfo aDevInfo[3];
//Starts communication
err= DBConnect("USB", DBPLC_DKV5000, &hConnect);
if (DB_NOERROR != err) {
//Error handling
About DLL Function

return;
}
//Performs monitor registration of relay (R)0, timer (T)10 and counter (C)50 for bank 0.
aDevInfo[0].wKind = DKV5000_RLY_B;
aDevInfo[0].dwNo = 0;
aDevInfo[1].wKind = DKV5000_T;
aDevInfo[1].dwNo = 10;
aDevInfo[2].wKind = DKV5000_C;
5 aDevInfo[2].dwNo = 50;
err = DBKvRegMonitorBit(hConnect, 0, 3, aDevInfo);
if (DB_NOERROR != err) {
DLL Function

//Error handling
return;
}
//Reads the monitor (bank 0)
err = DBKvReadMonitorDataBit(hConnect, 0, 3, aDevInfo);
if (DB_NOERROR != err) {
//Error handling
return;
}
//aDevInfo[0].lValue The result of reading relay (R)0
//aDevInfo[1].lValue The result of reading timer (T)10
//aDevInfo[2].lValue The result of reading counter (C)50

5-32 - KV COM+ Library User’s Manual -


5-2 DLL Function

 DBKvReadMonitorDataBit
Reads a device for which monitor registration was done by DBKvRegMonitorBit().

● Syntax
ret = DBKvReadMonitorDataBit(hConnect, byBankNo, lCount,aDevInfo[]);

Value Content Format


Return value

About DLL Function


DB_NOERROR: Normal termination
ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Bank No. (0-3)
byBankNo BYTE
Independent from the bank of monitor registration (word device).

5
lCount Specifies the number of devices to read. LONG
Device information (array)
Specify aDevInfo used in monitor registration by

DLL Function
DBKvRegMonitorBit()
aDevInfo If different device information is specified, the operation is not DBDevInfo
guaranteed.
When terminated normally, the device value is set in
aDevInfo[x].lValue.

● Explanation
Reads a device for which monitor registration was done by DBKvRegMonitorBit().
• The device value is 1 when ON, and 0 when OFF.
• Cannot read two or more banks simultaneously.
• Cannot read a registered device from the middle of it. Reading is performed from the start registered
in a bank.

● Related Item
"DBKvRegMonitorBit"(5-31 page)
"DBKvRegMonitorWord"(5-34 page)
"DBKvReadMonitorDataWord"(5-36 page)
"DBRead"(5-15 page)
"DBWrite"(5-17 page)
"DBReadArea"(5-19 page)
"DBWriteArea"(5-21 page)
"DBReadLong"(5-23 page)
"DBWriteLong"(5-25 page)
"DBKvReadRandom"(5-27 page)
"DBReadText"(5-37 page)
"DBWriteText"(5-39 page)

● Usage Example
See "DBKvRegMonitorBit"(5-31 page) for usage example.

- KV COM+ Library User’s Manual - 5-33


5-2 DLL Function

 DBKvRegMonitorWord
Performs monitor registration for a word device/double-word device.

● Syntax
ret = DBKvRegMonitorWord(hConnect, byBankNo, lCount,aDevInfo[]);

Value Content Format


Return value
About DLL Function

DB_NOERROR: Normal termination


ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Bank No. (0-3)
byBankNo Registers up to DBKV_MONITOR_DEVICE_MAX (32) in a bank. BYTE
Independent from the bank of monitor registration (bit device).
5 lCount
Specifies the number of devices for which monitors are
registered. When 0 is specified, the monitor registration LONG
information is cleared.
DLL Function

Set the device type of the device to be registered in


aDevInfo[x].wKind, and the device No. in aDevInfo[x].dwNo.
aDevInfo const DBDevInfo
The object device type is WORD format only.
See "Device List"(A-4 page) for device types.

● Explanation
Performs monitor registration for a word device/double-word device*.
* Only when timer (T) and counter (C) are set, monitor registration of a double-word device is performed.

● Related Item
"DBKvRegMonitorBit"(5-31 page)
"DBKvReadMonitorDataBit"(5-33 page)
"DBKvReadMonitorDataWord"(5-36 page)

5-34 - KV COM+ Library User’s Manual -


5-2 DLL Function

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
DBDevInfo aDevInfo[3];
//Starts communication
err= DBConnect("USB", DBPLC_DKV5000, &hConnect);
if (DB_NOERROR != err) {
//Error handling

About DLL Function


return;
}
//Performs monitor registration of DM0, timer setting value (TS)10 and counter current value (CC)50 in
bank 1
aDevInfo[0].wKind = DKV5000_DM;
aDevInfo[0].dwNo = 0;
aDevInfo[1].wKind = DKV5000_TS;
aDevInfo[1].dwNo = 10;
aDevInfo[2].wKind = DKV5000_CC;
aDevInfo[2].dwNo = 50;
5
err = DBKvRegMonitorWord(hConnect, 1, 3, aDevInfo);

DLL Function
if (DB_NOERROR != err) {
//Error handling
return;
}
//Reads the monitor (bank1)
err = DBKvReadMonitorDataWord(hConnect, 1, 3, aDevInfo);
if (DB_NOERROR != err) {
//Error handling
return;
}
//aDevInfo[0].lValue The result of reading DM0
//aDevInfo[1].lValue The result of reading timer setting value (TS)10
//aDevInfo[2].lValue The result of reading counter current value (CC)50

- KV COM+ Library User’s Manual - 5-35


5-2 DLL Function

 DBKvReadMonitorDataWord
Reads a device for which a monitor is registered by DBKvRegMonitorWord().

● Syntax
ret = DBKvReadMonitorDataWord(hConnect, byBankNo, lCount,aDevInfo[]);

Value Content Format


Return value
About DLL Function

DB_NOERROR: Normal termination


ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Bank No. (0-3)
byBankNo BYTE
Independent from the bank of monitor registration (bit device).

5
lCount Specifies the number of devices to read. LONG
Device information (array)
Specifies aDevInfo which is used in monitor registration by
DLL Function

DBKvRegMonitorWord()
aDevInfo When different device information is specified, the operation is DBDevInfo
not guaranteed.
When terminated normally, the device value is set in
aDevInfo[x].lValue.

● Explanation
Reads a device for which a monitor is registered by DBKvRegMonitorWord().
• Cannot read two or more banks simultaneously.
• Cannot read a registered device from the middle of it. Reading is performed from the start registered
in a bank.

● Related Item
"DBKvRegMonitorBit"(5-31 page)
"DBKvReadMonitorDataBit"(5-33 page)
"DBKvRegMonitorWord"(5-34 page)
"DBRead"(5-15 page)
"DBWrite"(5-17 page)
"DBReadArea"(5-19 page)
"DBWriteArea"(5-21 page)
"DBReadLong"(5-23 page)
"DBWriteLong"(5-25 page)
"DBKvReadRandom"(5-27 page)
"DBReadText"(5-37 page)
"DBWriteText"(5-39 page)

● Usage Example
See "DBKvRegMonitorWord"(5-34 page) for usage examples.

5-36 - KV COM+ Library User’s Manual -


5-2 DLL Function

 DBReadText
Reads a variable-length character string from a PLC device.

● Syntax
ret = DBReadText(hConnect, wKind, dwFirstNo, lMaxCount, pszText)

Value Content Format


Return value

About DLL Function


DB_NOERROR: Normal termination
ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
hConnect DBHCONNECT
Device type
wKind See the definition of DBPlcDevice for the device types which can be WORD
set.

dwFirstNo
Initial device No. of the device to read
See the definition of DBPlcDevice for the device No. which can be set.
DWORD
5

DLL Function
Number of the devices to read
lMaxCount A word device can store 2 ASCII characters. LONG
The maximum value to be set is 128 word devices (256 characters).
Character string to read
pszText Secure device size which can store the number of devices in LPSTR
lMaxCount.

● Explanation
Reads the character data stored with the specified device type and device No. as the start. The
readable number of character strings is up to the maximum character string length (word unit) (two
characters of one byte can be read by one word). Reads until the first NULL from the start is confirmed
and stores the read character string. If there is no NULL within the maximum length of a character
string (word unit), the character string added with NULL is stored after reading the maximum length of a
character string.
When a value cannot be converted to a character string, a runtime error occurs.

● Related Item
"DBRead"(5-15 page)
"DBWrite"(5-17 page)
"DBReadArea"(5-19 page)
"DBWriteArea"(5-21 page)
"DBReadLong"(5-23 page)
"DBWriteLong"(5-25 page)
"DBKvReadRandom"(5-27 page)
"DBKvReadMonitorDataBit"(5-33 page)
"DBKvReadMonitorDataWord"(5-36 page)
"DBWriteText"(5-39 page)

- KV COM+ Library User’s Manual - 5-37


5-2 DLL Function

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
CHAR pszText[256];
//Starst communication
if (!DBInit()) {
return;
}
About DLL Function

err=DBConnect("USB",DBPLC_DKV5000,&hConnect);
if (DB_NOERROR != err) {
// Error handling
return;
}
//Reads text
err=DBReadText(hConnect,DKV5000_DM,0,10,(LPSTR)pszText);
if (DB_NOERROR != err) {
5 // Error handling
return;
}
DLL Function

//Stops communication
DBDisconnect(hConnect);

5-38 - KV COM+ Library User’s Manual -


5-2 DLL Function

 DBWriteText
Writes a variable-length character string to a PLC device.

● Syntax
ret = DBWriteText(hConnect, wKind, dwFirstNo, lMaxCount, pszText)

Value Content Format


Return value

About DLL Function


DB_NOERROR: Normal termination
ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Device type
wKind See the definition of DBPlcDevice for the device types which can WORD
be set.

dwFirstNo
Initial device No. of the device to write
See the definition of DBPlcDevice for the device No. which can DWORD
5
be set.

DLL Function
Maximum number of the devices to which can be written
Stores two ASCII characters by one word device.
Needs a storage space for NULL which is to write at the end of
lMaxCount LONG
the character string.
The maximum value to be set is 128 word devices (256
characters).
pszText Character string to write const LPCSTR

● Explanation
Writes a character string to a device.
• Writes NULL at the end of the character string.
• When the maximum number of devices specified by dwFirstNo + lMaxCount is exceeded, the
function returns an error.
• With the written data which do not have NULL within the maximum length of a character string, it
adds NULL at {(lMaxCount) × 2-1}th character from the start.
• When there is a value which cannot be converted to a character string, a runtime error occurs.

● Related Item
"DBRead"(5-15 page)
"DBWrite"(5-17 page)
"DBReadArea"(5-19 page)
"DBWriteArea"(5-21 page)
"DBReadLong"(5-23 page)
"DBWriteLong"(5-25 page)
"DBKvReadRandom"(5-27 page)
"DBKvReadMonitorDataBit"(5-33 page)
"DBKvRegMonitorWord"(5-34 page)
"DBReadText"(5-37 page)

- KV COM+ Library User’s Manual - 5-39


5-2 DLL Function

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
// Starts communication
err= DBConnect("USB", DBPLC_DKV5000, &hConnect);
if (DB_NOERROR != err) {
// Error handling
return;
About DLL Function

}
err=DBWriteText(hConnect,DKV5000_DM,10,20,"Sample");
if (DB_NOERROR != err) {
// Error handling
return;
}

5
DLL Function

5-40 - KV COM+ Library User’s Manual -


5-2 DLL Function

6 Alarm

Acquires the alarm information of KV-5500/5000/3000/1000/700.

 DBKvGetAlarmLogCount
Acquires the number of alarm logs.

About DLL Function


● Syntax
ret = DBKvGetAlarmLogCount(hConnect, lplCount)

Value Content Format


Return value
DB_NOERROR: Normal termination
ret DBERROR
Other than above: Error

hConnect
See "Error Message Lists"(A-10 page).
Connection handle DBHCONNECT
5

DLL Function
lplCount When terminated normally, the number of alarm logs is set. LONG *

● Explanation
Acquires the number of alarm logs.
By using DBKvGetAlarmLog(), the number of alarm logs is acquired in addition to the logs.

● Related Item
"DBKvGetAlarmLog"(5-42 page)

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
LONG lAlarmLogCount;
//Starts communication
err= DBConnect("USB", DBPLC_DKV5000, &hConnect);
if (DB_NOERROR != err) {
//Error handling
return;
}
//Acquires the number of alarm logs
err = DBKvGetAlarmLogCount(hConnect, &lAlarmLogCount);
if (DB_NOERROR != err) {
//Error handling
return;
}
//lAlarmLogCount The number of alarm logs

- KV COM+ Library User’s Manual - 5-41


5-2 DLL Function

 DBKvGetAlarmLog
Acquires all alarm logs.

● Syntax
ret = DBKvGetAlarmLog(hConnect, lpAlarmLog, lplCount)

Value Content Format


Return value
About DLL Function

DB_NOERROR: Normal termination


ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Alarm logs. The caller needs to secure a storage area for alarm logs by
declaring as DBKvAlarmLog AlarmLog[DBKV_ALARM_LOG_MAX];
(DBKV_ALARM_LOG_MAX
5 lpAlarmLog
= 64).
When terminated normally, alarm logs are set.
DBKvAlarmLog *

The logs are set from the latest one in lpAlarmLog.


DLL Function

When terminated normally, the number of the logs acquired actually


lplCount LONG *
are set.

● Explanation
Acquires all alarm logs.
• Up to 64 alarm logs are stored in KV-5500/5000/3000/1000/700.
• The value of lpAlarmLog->wYear is the actual year - 2000.
(Example) If it is 2010, 10 is set in lpAlarmLog->wYear.

● Related Item
"DBKvGetAlarmLogCount"(5-41 page)

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
LONG lAlarmLogCount;
DBKvAlarmLog aAlarmLog[DBKV_ALARM_LOG_MAX];
//Starts communication
err= DBConnect("USB", DBPLC_DKV5000, &hConnect);
if (DB_NOERROR != err) {
//Error handling
return;
}
//Acquires alarm logs
err = DBKvGetAlarmLog(hConnect, aAlarmLog, &lAlarmLogCount);
if (DB_NOERROR != err) {
//Error handling
return;
}
//aAlarmLog[DBKV_ALARM_LOG_MAX] Alarm logs
//lAlarmLogCount The number of alarm logs

5-42 - KV COM+ Library User’s Manual -


5-2 DLL Function

7 Access Functions to a Memory Card

 DBMemoryCardFileCopyFrom
Copies a file on a memory card to a PC's path.
Reference The maximum file size to be copied is 256MB.

About DLL Function


● Syntax
ret = DBMemoryCardFileCopyFrom(hConnect,pszFilePathM,pszFilePathL,dwFlag)

Value Content Format


Return value
ret DBERROR
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT

pszFilePathM
Specifies the path of the file to be copied on a memory card.
((IP address)/Set MMC onward)
LPSTR
5

DLL Function
pszFilePathL Specifies the path of a file to be copied to in PC. LPSTR
dwFlag Specifies the operating conditions DWORD

Value for dwFlag

Constant Value Content


Disables overwrite when there is a same name file in the
DB_OVERWRITE_PROTECT 0
copy destination.
Enables overwrite when there is a same name file in the copy
DB_OVERWRITE_ALLOW 1
destination.
Other Incorrect parameter error

● Explanation
Copies a file on a memory card to a PC's path.
* Available only for KV-5500/5000/3000.

● Related Item
"DBMemoryCardFileCopyTo"(5-45 page)

- KV COM+ Library User’s Manual - 5-43


5-2 DLL Function

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
//Starts communication
err=DBConnect("192.168.0.10:8500",DBPLC_DKV5000,&hConnect);
if (DB_NOERROR != err) {
// Error handling
return;
About DLL Function

}
//Reads from a memory card
err=DBMemoryCardFileCopyFrom(hConnect,"Sample.csv","C:\test\Sample1.csv",
DB_OVERWRITE_ALLOW);
if (DB_NOERROR != err) {
// Error handling
return;
}
5 //Stops communication
DBDisconnect(hConnect);
DLL Function

5-44 - KV COM+ Library User’s Manual -


5-2 DLL Function

 DBMemoryCardFileCopyTo
Copies a file on a PC to a memory card 's path.
Reference The maximum file size to be copied is 256MB.

● Syntax
ret = DBMemoryCardFileCopyTo(hConnect,pszFilePathL,pszFilePathM,dwFlag)

About DLL Function


Value Content Format
Return value
ret DBERROR
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
pszFilePathL Specifies the path of the file to be copied on a PC. LPSTR
Specifies the path of the file to be copied to on a memory card.
pszFilePathM LPSTR
((IP address)/Set MMC onward)
dwFlag Specifies the operating condition. DWORD 5

DLL Function
Value for dwFlag

Constant Value Content


Disables overwrite when there is a same name file in the
DB_OVERWRITE_PROTECT 0
copy destination.
Enables overwrite when there is a same name file in the copy
DB_OVERWRITE_ALLOW  1
destination.
Other Incorrect parameter error

● Explanation
Copies a file on a PC to a memory card 's path.
* Available only for KV-5500/5000/3000.

● Related Item
"DBMemoryCardFileCopyFrom"(5-43 page)

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
//Starts communication
err=DBConnect("192.168.0.10:8500",DBPLC_DKV5000,&hConnect);
if (DB_NOERROR != err) {
// Error handling
return;
}
//Writes to a memory card
err=DBMemoryCardFileCopyTo(hConnect,"C:\test\Sample.csv","Sample.csv",DB_OVERWRITE_ALLOW)
;
if (DB_NOERROR != err) {
// Error handling
return;
}
//Stops communication
DBDisconnect(hConnect);

- KV COM+ Library User’s Manual - 5-45


5-2 DLL Function

 DBMemoryCardFileState
Acquires a file status on a memory card.

● Syntax
ret = DBMemoryCardFileState(hConnect,pszFilePathM,ptmAccess,
ptmCreate,ptmModify,dwFileSize,bIsDirectory)

Value Content Format


About DLL Function

Return value
ret lAxError
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Specifies the path of the file whose status is to be acquired
pszFilePathM on a memory card. LPSTR
((IP address)/Set MMC onward)

5
ptmAccess Last access date tm*
ptmCreate Date created tm*
ptmModify Date updated tm*
DLL Function

dwFileSize File size (byte) DWORD*


Directory or file
bIsDirectory BOOL*
(0 - file, 1 - directory)

● Explanation
Acquires a file status on a memory card.
* Available only for KV-5500/5000/3000.

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
struct tm a;
struct tm b;
struct tm c;
DWORD dwFileSize;
BOOL bIsDirectory;
//Starts communication
err=DBConnect("USB",DBPLC_DKV5000,&hConnect);
if (DB_NOERROR != err) {
// Error handling
return;
}
//Reads from a memory card
err = DBMemoryCardFileState(hConnect,"Sample.csv",&a,&b,&c,&dwFileSize,&bIsDirectory);
if (DB_NOERROR != err) {
// Error handling
return;
}
//Stops communication
DBDisconnect(hConnect);

5-46 - KV COM+ Library User’s Manual -


5-2 DLL Function

 DBMemoryCardFileDelete
Deletes a file on a memory card.

● Syntax
ret = DBMemoryCardFileDelete(hConnect,pszFilePathM, dwFlag)

Value Content Format


Return value

About DLL Function


ret DBERROR
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Specifies the path of the file to be deleted on a memory card.
pszFilePathM LPSTR
((IP address)/Set MMC onward)
dwFlag Specifies the operating condition. DWORD

Value for dwFlag


5
Constant Value Content

DLL Function
Disables deletion when the file to be deleted is
DB_DELETE_EXCEPT_READ_ONLY 3
ReadOnly.
Enables deletion when the file to be deleted is
DB_DELETE_FORCE 2
ReadOnly.
Other Incorrect parameter error

● Explanation
Deletes a file on a memory card.
* Available only for KV-5500/5000/3000.

● Related Item
"DBMemoryCardFileRename"(5-48 page)

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
//Starts communication
err=DBConnect("192.168.0.10:8500",DBPLC_DKV5000,&hConnect);
if (DB_NOERROR != err) {
// Error handling
return;
}
//Deletes from the memory card
err=DBMemoryCardFileDelete(hConnect,"Sample.csv",DB_DELETE_FORCE);
if (DB_NOERROR != err) {
// Error handling
return;
}
//Stops communication
DBDisconnect(hConnect);

- KV COM+ Library User’s Manual - 5-47


5-2 DLL Function

 DBMemoryCardFileRename
Renames a file on a memory card.

● Syntax
ret = DBMemoryCardFileRename(hConnect,pszFilePathM,pszNewFilePathM,dwFlag)

Value Content Format


Return value
About DLL Function

ret DBERROR
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Specifies the path and file name before modification on a
pszFilePathM memory card. LPSTR
((IP address)/Set MMC onward)
Specifies a file name on a memory card.
pszNewFilePathM LPSTR
5
((IP address)/Set MMC onward)
dwFlag Specifies the operating condition. DWORD
DLL Function

● Explanation
Renames a file on a memory card.
* Available only for KV-5500/5000/3000.

● Related Item
"DBMemoryCardFileDelete"(5-47 page)

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
//Starts communication
err=DBConnect("192.168.0.10:8500",DBPLC_DKV5000,&hConnect);
if (DB_NOERROR != err) {
// Error handling
return;
}
//Rename
err=DBMemoryCardFileRename(hConnect,"Sample.csv","SampleTest.csv");
if (DB_NOERROR != err) {
// Error handling
return;
}
//Stops communication
DBDisconnect(hConnect);

5-48 - KV COM+ Library User’s Manual -


5-2 DLL Function

 DBMemoryCardMakeDirectory
Creates a directory on a memory card.

● Syntax
ret = DBMemoryCardMakeDirectory(hConnect,pszDirectory)

Value Content Format


Return value

About DLL Function


ret DBERROR
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Specifies the path of a directory to be created on a memory card.
pszDirectory LPSTR
((IP address)/Set MMC onward)

● Explanation
Creates a directory on a memory card.
* Available only for KV-5500/5000/3000.
5

DLL Function
● Related Item
"DBMemoryCardRemoveDirectory"(5-50 page)

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
//Starts communication
err=DBConnect("192.168.0.10:8500",DBPLC_DKV5000,&hConnect);
if (DB_NOERROR != err) {
// Error handling
return;
}
//Creates a directory
err=DBMemoryCardMakeDirectory(hConnect,"SampleDirectory");
if (DB_NOERROR != err) {
// Error handling
return;
}
//Stops communication
DBDisconnect(hConnect);

- KV COM+ Library User’s Manual - 5-49


5-2 DLL Function

 DBMemoryCardRemoveDirectory
Deletes a directory on a memory card.

● Syntax
ret = DBMemoryCardRemoveDirectory(hConnect,pszDirectory,dwFlag)

Value Content Format


Return value
About DLL Function

ret DBERROR
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Specifies the path of the directory to be deleted on a memory
pszDirectory card. LPSTR
((IP address)/Set MMC onward)
dwFlag Specifies the condition for deletion. DWORD

5 Value for dwFlag

Constant Value Content


DLL Function

Disables deletion when there is a file/folder in the


DB_DELETE_EMPTY 4
directory to be deleted.
Disables deletion when there is a ReadOnly file/
DB_DELETE_EXCEPT_READ_ONLY 3
folder in the directory to be deleted.
Enables deletion when there is a ReadOnly file/
DB_DELETE_FORCE 2
folder in the directory to be deleted.
Other Incorrect parameter error

● Explanation
Deletes a directory on a memory card.
* Available only for KV-5500/5000/3000.

● Related Item
"DBMemoryCardMakeDirectory"(5-49 page)

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
//Starts communication
err=DBConnect("192.168.0.10:8500",DBPLC_DKV5000,&hConnect);
if (DB_NOERROR != err) {
// Error handling
return;
}
//Deletes a directory
err=DBMemoryCardRemoveDirectory(hConnect,"SampleDirectory",DB_DELETE_EMPTY);
if (DB_NOERROR != err) {
// Error handling
return;
}
//Stops communication
DBDisconnect(hConnect);

5-50 - KV COM+ Library User’s Manual -


5-2 DLL Function

 DBMemoryCardFileCountInDirectory
Acquires the number of files contained in a directory of a memory card.

● Syntax
ret = DBMemoryCardFileCountInDirectory(hConnect,pszDirectory,pwFileCount)

Value Content Format


Return value

About DLL Function


ret DBERROR
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Specifies the path of the directory to be updated on a memory
pszDirectory card. LPSTR
((IP address)/Set MMC onward)
pwFileCount Number of files WORD*

● Explanation 5
Acquires the number of files contained in a directory of a memory card.

DLL Function
* Available only for KV-5500/5000/3000.

● Related Item
"DBMemoryCardFilesInDirectory"(5-52 page)

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
WORD wFileCount = 0;
//Starts communication
err=DBConnect("USB",DBPLC_DKV5000,&hConnect);
if (DB_NOERROR != err) {
// Error handling
return;
}
//Acquires the number of files
err=DBMemoryCardFileCountInDirectory(hConnect,"TEST",&wFileCount);
if (DB_NOERROR != err) {
// Error handling
return;
}
str.Format(_T("The number of files : %d"),wFileCount);
m_Edit2.SetWindowTextA(str);
//Stops communication
DBDisconnect(hConnect);

- KV COM+ Library User’s Manual - 5-51


5-2 DLL Function

 DBMemoryCardFilesInDirectory
Acquires file names contained in a directory of a memory card.

● Syntax
ret = DBMemoryCardFilesInDirectory(hConnect, pszDirectory, wFileCount, ppbyFiles)

Value Content Format


Return value
About DLL Function

ret DBERROR
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Specifies the path of the directory in which file names are to be
pszDirectory acquired on a memory card. LPSTR
((IP address)/Set MMC onward)
wFileCount Number of files WORD

5 ppbyFiles File name BYTE**

● Explanation
DLL Function

Acquires file names contained in a directory of a memory card.


* Available only for KV-5500/5000/3000.

● Related Item
"DBMemoryCardFileCountInDirectory"(5-51 page)

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
BYTE** ppbyFiles=NULL;
//Starts communication
err=DBConnect("USB",DBPLC_DKV5000,&hConnect);
if (DB_NOERROR != err) {
// Error handling
return;
}
ppbyFiles = new BYTE*[1];
ppbyFiles[0] = new BYTE[256];
//Acquires file names in a directory.
err=DBMemoryCardFilesInDirectory(hConnect,"TEST",1,ppbyFiles);
if (DB_NOERROR != err) {
// Error handling
return;
}
str = ppbyFiles[0];
m_Edit2.SetWindowTextA(str);
//Stops communication
DBDisconnect(hConnect);

5-52 - KV COM+ Library User’s Manual -


5-2 DLL Function

 DBMemoryCardSpace
Acquires the space of a memory card.

● Syntax
ret = DBMemoryCardSpace(hConnect,lpdwUpTotal,pdwLowTotal,pdwUpFree,pdwLowFree)

Value Content Format


Return value

About DLL Function


ret lAxError
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
pdwUpTotal Total capacity (upper 32 bits) DWORD*
pdwLowTotal Total capacity (lower 32 bits) DWORD*
pdwUpFree Space (upper 32 bits) DWORD*
pdwLowFree Space (lower 32 bits) DWORD*
5
● Explanation

DLL Function
Acquires the space of a memory card.

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
DWORD a=0;
DWORD b=0;
DWORD c=0;
DWORD d=0;
//Starts communication
err=DBConnect("USB",DBPLC_DKV5000,&hConnect);
if (DB_NOERROR != err) {
// Error handling
return;
}
//Acquires the space
err=DBMemoryCardSpace(hConnect,&a,&b,&c,&d);
if (DB_NOERROR != err) {
// Error handling
return;
}
//Stops communication
DBDisconnect(hConnect);

- KV COM+ Library User’s Manual - 5-53


5-2 DLL Function

8 Other Control

 DBSetSystemTime
Sets the built-in clock of KV-5500/5000/3000/1000/700.

● Syntax
ret = DBSetSystemTime(hConnect, pTime)
About DLL Function

Value Content Format


Return value
DB_NOERROR: Normal termination
ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
5 pTime Time DBTime *
DLL Function

● Explanation
Sets the built-in clock of KV-5500/5000/3000/1000/700.
• Sets the weekday by automatic calculating from pTime.
• The range can be set from 2000 to 2099.

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
DBTime DBTimeSet;
//Starts communication
err= DBConnect("USB", DBPLC_DKV5000, &hConnect);
if (DB_NOERROR != err) {
//Error handling
return;
}
//Time setting 08/18/2010 9:30:00
DBTimeSet.wYear = 2010;
DBTimeSet.wMonth = 8;
DBTimeSet.wDay = 18;
DBTimeSet.wHour = 9;
DBTimeSet.wMinute = 30;
DBTimeSet.wSecond = 0;
err = DBSetSystemTime(hConnect, &DBTimeSet);
if (DB_NOERROR != err) {
//Error handling
return;
}

5-54 - KV COM+ Library User’s Manual -


5-2 DLL Function

 DBQueryType
Inquires the model.

● Syntax
ret = DBQueryType(hConnect, lpType)

Value Content Format


Return value

About DLL Function


DB_NOERROR: Normal termination
ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
When terminated normally, the model information is set.
For KV-5500
lpType->szName "KV-5500"
For KV-5000
lpType->szName "KV-5000"
5
For KV-3000

DLL Function
lpType lpType->szName "KV-3000" DBMachineType *
For KV-1000
lpType->szName "KV-1000"
For KV-700 without expanded memory
lpType->szName “KV-700”
For KV-700 with expanded memory
lpType->szName “KV-700+M”

● Explanation
Inquires the model.

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
DBMachineType DBType;
//Starts communication
err= DBConnect("USB", DBPLC_DKV5000, &hConnect);
if (DB_NOERROR != err) {
//Error handling
return;
}
//Inquires the model
err = DBQueryType(hConnect, &DBType);
if (DB_NOERROR != err) {
//Error handling
return;
}

- KV COM+ Library User’s Manual - 5-55


5-2 DLL Function

 DBKvClearError
Clears an error of KV-5500/5000/3000/1000/700.

● Syntax
ret = DBKvClearError(hConnect)

Value Content Format


Return value
About DLL Function

DB_NOERROR: Normal termination


ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT

● Explanation
Clears an error of KV-5500/5000/3000/1000/700.
5 ● Related Item
DLL Function

"DBKvQueryErrorNumber"(5-57 page)

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
BYTE byError;
//Starts communication
err= DBConnectA("USB", DBPLC_DKV5000, &hConnect);
if (DB_NOERROR != err) {
//Error handling
return;
}
//Acquires the error No.
err = DBKvQueryErrorNumber(hConnect, &byError);
if (DB_NOERROR != err) {
//Error handling
return;
}
//byError The error No.
//Error clear
err = DBKvClearError(hConnect);
if (DB_NOERROR != err) {
//Error handling
return;
}

5-56 - KV COM+ Library User’s Manual -


5-2 DLL Function

 DBKvQueryErrorNumber
Acquires the error No. of KV-5500/5000/3000/1000/700.

● Syntax
ret = DBKvQueryErrorNumber(hConnect, lpbyErrNum)

Value Content Format


Return value

About DLL Function


DB_NOERROR: Normal termination
ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
When terminated normally, the error No. of KV-5500/5000/3000/
lpbyErrNum BYTE*
1000/700 is set. That is zero when there is no error.

● Explanation 5
Acquires the error No. of KV-5500/5000/3000/1000/700.

DLL Function
● Related Item
"DBKvClearError"(5-56 page)

● Usage Example
See the usage example in "DBKvClearError"(5-56 page).

- KV COM+ Library User’s Manual - 5-57


5-2 DLL Function

 DBKvReadComment
Reads a device comment.

● Syntax
ret = DBKvReadComment (hConnect, byDevKind, dwDevNo, lpszComment);

Value Content Format


Return value
About DLL Function

DB_NOERROR: Normal termination


ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
hConnect Connection handle DBHCONNECT
Device type
byDevKind See "Device List"(A-4 page) for the device types which can BYTE
be set.
5 dwDevNo
Device No.
See the definition of DBPlcDevice for the device Nos. which can DWORD
be set.
DLL Function

Pointer to the buffer in which the device comment is set.


lpszComment LPTSTR
Secure buffer of greater than DB_COMMENT_MAX(33) bytes.

● Explanation
Reads a device comment.

● Usage Example

DBHCONNECT hConnect;
DBERROR err;
DBDevInfo DevInfo;
_TCHAR szComment[DB_COMMENT_MAX];
// Starts communication
err= DBConnect("USB", DBPLC_DKV5000, &hConnect);
if (DB_NOERROR != err) {
// Error handling
return;
}
//Reads the comment of DM0
err = DBKvReadComment(hConnect, DKV5000_DM, 0, szComment);
if (DB_NOERROR != err) {
// Error handling
return;
}
//szComment The read comment of DM0

5-58 - KV COM+ Library User’s Manual -


5-2 DLL Function

 DBConvStrToComInfo
Converts a communication destination character string to a communication setting information structure.

● Syntax
ret = DBConvStrToComInfo(lpszComType, pComInfo)

Value Content Format


Return value

About DLL Function


DB_NOERROR: Normal termination
ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
lpszComType Pointer to the communication setting information structure (DBComInfo) LPCSTR
Communication destination character string specified in DBConnect().
Secure for up to 257 characters (256 + termination character).
pComInfo DBComInfo*
When terminated normally, the communication destination character
string is set.
5
● Explanation

DLL Function
Converts a communication destination character string to a communication setting information
structure. ComInfo.ParamRS232C.nStation is a reservation.

● Related Item
"DBConvComInfoToStr"(5-60 page)

● Usage Example

DBERROR err;
DBComInfo ComInfo;
//Converts a communication destination character string to a communication setting information structure
err = DBConvStrToComInfo("USB", &ComInfo);
if (DB_NOERROR != err) {
//Error handling
return;
}
//In USB
//ComInfo.Type = DBCOMTYPE_USB

//In RS232C
// err = DBConvStrToComInfo("COM1:9600", &ComInfo);
//ComInfo.Type = DBCOMTYPE_RS232C
//ComInfo.ParamRS232C.byComNo = (Port)
//ComInfo.ParamRS232C.BaudRate = (Baudrate)

//In Ethernet
//err = DBConvStrToComInfo("192.168.0.10:8500", &ComInfo);
//ComInfo.Type =DBCOMTYPE_TCP
//ComInfo.ParamTCP.szAddr = (Adress)
//ComInfo.ParamTCP.wPortNo = (Port No.)

//In Bluetooth
//err = DBConvStrToComInfo("40,2,0,KV-5500 ,00:03:7A:4D:C0:43,555ce34b", &ComInfo);
//ComInfo.Type = DBCOMTYPE_BLUETOOTH
//ComInfo.ParamBLUETOOTH.flgManual = (Selecting automatic/manual connection start)
//ComInfo.ParamBLUETOOTH.iComPort = (Virtual port)
//ComInfo.ParamBLUETOOTH.iStackType = (Protocol stack type)
//ComInfo.ParamBLUETOOTH.szBDAddress = (Address)
//ComInfo.ParamBLUETOOTH.szDeviceName = (Distinguish name)
//ComInfo.ParamBLUETOOTH.szPassKey = (Passkey)

- KV COM+ Library User’s Manual - 5-59


5-2 DLL Function

 DBConvComInfoToStr
Converts a communication setting information structure to a communication destination character
string.

● Syntax
ret = DBConvComInfoToStr(pComInfo, lpszComType)

Value Content Format


About DLL Function

Return value
DB_NOERROR: Normal termination
ret DBERROR
Other than above: Error
See "Error Message Lists"(A-10 page).
Communication destination character string specified in
pComInfo DBComInfo*
DBConnect()
Pointer to a communication setting information structure
5 lpszComType
(DBComInfo)
When terminated normally, a communication destination LPCSTR
character sting is set in a communication setting information
DLL Function

structure.

● Explanation
Converts a communication setting information structure to a communication destination character
string.
In RS232C, always specify pComInfo->ParamRS232C.nStation = -1 (Specification of a station No. is a
reservation).

● Related Item
"DBConvStrToComInfo"(5-59 page)

● Usage Example

DBERROR err;
DBComInfo ComInfo;
CHAR szComType[257];
//Converts a communication setting information structure to a communication destination character string
ComInfo.Type = DBCOMTYPE_TCP;
strcpy_s( ComInfo.ParamTCP.szAddr, DB_ADDR_MAX, "192.168.0.10" );
ComInfo.ParamTCP.wPortNo = 8500;
err = DBConvComInfoToStr(&ComInfo, szComType);
if (DB_NOERROR != err) {
//Error handling
return;
}
// szComType "192.168.0.10:8500"

5-60 - KV COM+ Library User’s Manual -


A
Appendices A

Appendices
Device list, error message lists etc. are provided.

1 USB Driver Installation. . . . . . . . . . . . . . . . . . . . . . . . A-2


2 Device List. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-4
3 Bit Specification of Word Device . . . . . . . . . . . . . . . A-8
4 Model Change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-9
5 Error Message Lists . . . . . . . . . . . . . . . . . . . . . . . . . A-10
6 About Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . A-20
7 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-21

- KV COM+ Library User’s Manual - A-1


1 USB Driver Installation

To connect KV series PLC with a PC via USB, it is necessary to install USB driver on the PC. How to
install USB driver is explained below.

Install on Windows 7/Vista

In Windows 7/Vista, USB driver is installed automatically when KV COM+ Library is installed.
"1-3 Software Installation"(1-5 page)

Install on Windows XP
Appendices

Only to connect for the first time, the USB driver for KV series PLC needs to be installed.
Because the second and later connection are recognized automatically, no more USB driver installation
is necessary.

Point Install KV COM+ Library before installing USB driver.


A "1-3 Software Installation"(1-5 page)
USB Driver Installation

Here is the step to install the driver for KV series PLC on Windows XP for the first time. To install the
USB driver of KV COM+ Library, hardware detection must be performed.

Follow the steps below to install the driver.

1 Start Windows XP and log on as a user with an authority to change the system such as
Administrator.

2 Connect the PC with KV series PLC with a USB cable.


A message "New Hardware Detected" is displayed, then "New Hardware Detection Wizard" comes up.

3 Select "Install from a list or specific location (Advanced)" radio button, then click the "Next"
button.

A-2 - KV COM+ Library User’s Manual -


1 USB Driver Installation

4 Select "Search for the best driver in these locations" radio button and check "Include this
location" check box.

Appendices
5 Click "Reference" button to specify the location where KV COM+ Library is installed.

Point By default, KV COM+ Library is installed in "C:¥Program


Files¥KEYENCE¥KVComPlusLB".
A

USB Driver Installation


6 Click "Next" button.
Installation starts.

Point When installation is started, the following dialog box may be displayed. Click "Continue"
button to continue the installation.

7 Click "Finish" button.

The USB driver for KV series PLC has been installed.

- KV COM+ Library User’s Manual - A-3


2 Device List

The following is the list of devices available in KV COM+ Library.


For the latest information, see " dlluser¥include¥DBPlcDef.h" in the folder where KV COM+ Library is
installed.
Reference Use the device type definition of KV-5000 for KV-5500.

KV-5000 Device type definition


typedef enum DBPlcDevice {
/*KV-5000*/
DKV5000_RLY_B = 0, /* Relay/Input range is 00000 to 99915, the last two digits is 0 to 15 and the first three digits is 000 to 999 */
DKV5000_CR = 10, /* Control relay/Input range is 0000 to 3915, the last two digits is 0 to 15 and the first two digits is 00 to 39 */
DKV5000_T = 7, /* Timer (Contact)/Input range is 0000 to 3999 */
DKV5000_C = 8, /* Counter (Contact)/Input range is 0000 to 3999 */
DKV5000_CTC = 9, /* CTC (Contact)/Input range is 0 to 3 */
DKV5000_MR = 12, /* Internal auxiliary relay/Input range is 00000 to 99915, the last two digits is 00 to 15 and the first three digits is 000 to 999 */
DKV5000_LR = 13, /* Latch relay/Input range is 00000 to 99915, the last two digits is 00 to 15 and the first three digits is 000 to 999 */
DKV5000_B = 45, /* Link relay/Input range is 0000 to 3FFF (hexadecimal), the last one digit is 0 to F and the first three digits is 000 to 3FF */
DKV5000_VB = 46, /* Work relay/Input range is 0000 to 3FFF (hexadecimal), the last one digit is 0 to F and the first three digits is 3FF */
DKV5000_DM_B = 11, /* Data memory (handled in bits)/Input range is 0000000 to 6553415, the last two digits is 00 to 15 and the first five digits is 00000 to 65534 */
DKV5000_EM_B = 14, /* Extended data memory (handled in bits)/Input range is 0000000 to 6553415, the last two digits is 00 to 15 and the first five digits is 00000 to 65534 */
DKV5000_FM_B = 15, /* File register (handled in bits)/Input range is 0000000 to 3276715, the last two digits is 00 to 15 and the first five digits is 00000 to 32767 */
Appendices

DKV5000_ZF_B = 70, /* File register (consecutive number method)) (handled in bits)/Input range is 000000 to 13107115, the last two digits is 00 to 15 and the first six digits is 000000 to
131071 */
DKV5000_W_B = 47, /* Link register (handled in bits)/Input range is 00000 to 3FFFF (hexadecimal), the last one digit is 0 to F and the first four digits is 0000 to 3FFF */
DKV5000_VM_B = 53, /* Work memory (handled in bits)/Input range is 0000000 to 5999915, the last two digits is 00 to 15 and the first five digits is 00000 to 59999 */
DKV5000_DM = 18, /* Data memory/Input range is 00000 to 65534 */
DKV5000_EM = 31, /* Extended data memory/Input range is 00000 to 65534 */
DKV5000_FM = 32, /* File register/Input range is 00000 to 32767 */
DKV5000_ZF = 75, /* File register (consecutive number method))/Input range is 00000 to 131071 */
DKV5000_W = 50, /* Link register/Input range is 0000 to 3FFF (hexadecimal) */

A
DKV5000_RLY_W = 25, /* Relay (00000 to 99900)/Input range is 00000 to 99900 and the last two digits is 00 */
DKV5000_TM = 19, /* Temporary data memory/Input range is 000 to 511 */
DKV5000_TRM = 20, /* Trimmer/Input range is 0 to 7 */
DKV5000_TS = 21, /* Timer (setting value)/Input range is 0000 to 3999 */
DKV5000_TC = 22, /* Timer (current value)/Input range is 0000 to 3999 */
DKV5000_CS = 23, /* Counter (setting value)/Input range is 0000 to 3999 */
Device List

DKV5000_CC = 24, /* Counter (current value)/Input range is 0000 to 3999 */


DKV5000_CTH = 16, /* High-speed counter (current value)/Input range is 0 to 1 */
DKV5000_CTC_W = 17, /* CTC(setting value)/Input range is 0 to 3 */
DKV5000_CM = 29, /* Control memory/Input range is 00000 to 5999 */
DKV5000_CR_W = 30, /* Control relay/Input range is 0000 to 3900 and the last two digits is 00 */
DKV5000_Z = 52, /* Index register/Input range is 1 to 12 */
DKV5000_G = 76, /* Extension unit buffer memory/Input range is 0000000 to 4832767 and the first two digits is the unit No. */
DKV5000_VM = 51, /* Work memory/Input range is 00000 to 59999 */
DKV5000_MR_W = 34, /* Internal auxiliary relay/Input range is 00000 to 99900 and the last two digits is 00 */
DKV5000_LR_W = 35, /* Latch relay/Input range is 00000 to 99900 and the last two digits is 00 */
DKV5000_B_W = 48, /* Link relay/Input range is 0000 to 3FF0 and the last two digits is 0 */
DKV5000_VB_W = 49, /* Work relay/Input range is 0000 to 3FFF, the last one digit is 0 and the first three digits is 000 to 3FF *//

/*KV-5000 (XYM) */
DKV5000XYM_RLY_B = 0, /* Relay/Input range is 00000 to 99915, the last two digits is 00 to 15 and the first three digits is 000 to 999 */
DKV5000XYM_X = 36, /* Input relay/Input range is 0000 to 999F, the last one digit is 0 to F and the first three digits is 000 to 999 */
DKV5000XYM_Y = 37, /* Output relay/Input range is 0000 to 999F, the last one digit is 0 to F and the first three digits is 000 to 999 */
DKV5000XYM_CR = 10, /* Control relay/Input range is 0000 to 3915, the last two digits is 0 to 15 and the first two digits is 00 to 39 */
DKV5000XYM_T = 7, /* Timer (Contact)/Input range is 0000 to 3999 */
DKV5000XYM_C = 8, /* Counter (Contact)/Input range is 0000 to 3999 */
DKV5000XYM_CTC = 9, /* CTC (Contact)/Input range is 0 to 3 */
DKV5000XYM_M = 12, /* Internal auxiliary relay/Input range is 00000 to 15999 */
DKV5000XYM_L = 13, /* Latch relay/Input range is 00000 to 15999 */
DKV5000XYM_B = 45, /* Link relay/Input range is 0000 to 3FFF (hexadecimal), the last one digit is 0 to F and the first three digits is 000 to 3FF */
DKV5000XYM_VB = 46, /* Work relay/Input range is 0000 to 3FFF (hexadecimal) and the last one digit is 0 to F */
DKV5000XYM_D_B = 30, /* Data memory (handled in bits)/Input range is 0000000 to 6553415, the last two digits is 00 to 15 and the first five digits is 00000 to 65534 */
DKV5000XYM_E_B = 14, /* Extended data memory (handled in bits)/Input range is 0000000 to 6553415, the last two digits is 00 to 15 and the first five digits is 00000 to 65534 */
DKV5000XYM_F_B = 15, /* File register (handled in bits)/Input range is 0000000 to 3276715, the last two digits is 00 to 15 and the first five digits is 00000 to 32766 */
DKV5000XYM_ZF_B = 70, /* File register (consecutive number method) (handled in bits)/Input range is 000000 to 13107115, the last two digits is 00 to 15 and the first five digits is
00000 to 131071 */
DKV5000XYM_W_B = 47, /* Link register (handled in bits)/Input range is 00000 to 3FFFF (hexadecimal), the last one digit is 0 to F and the first four digits is 0000 to 3FFF */
DKV5000XYM_VM_B = 53, /* Work memory (handled in bits) */
DKV5000XYM_D = 18, /* Data memory/Input range is 00000 to 65534 */
DKV5000XYM_E = 31, /* Extended data memory/Input range is 00000 to 65534 */
DKV5000XYM_F = 32, /* File register/Input range is 00000 to 32767 */
DKV5000XYM_ZF = 75, /* File register (consecutive number method)/Input range is 000000 to 131071 */
DKV5000XYM_W = 50, /* Link register/Input range is 0000 to 3FFF (hexadecimal) */
DKV5000XYM_RLY_W = 25, /* Relay (00000 to 99900)/Input range is 00000 to 99900 and the last two digits is 00 */
DKV5000XYM_X_W = 38, /* Input relay (0000 to 9990)/Input range is 0000 to 9990 and the last one digit is 0 */
DKV5000XYM_Y_W = 39, /* Output relay (0000 to 9990)/Input range is 0000 to 9990 and the last one digit is 0 */
DKV5000XYM_TM = 19, /* Temporary data memory/Input range is 000 to 511 */
DKV5000XYM_TRM = 20, /* Trimmer/Input range is 0 to 7 */
DKV5000XYM_TS = 21, /* Timer (setting value)/Input range is 0000 to 3999 */
DKV5000XYM_TC = 22, /* Timer (current value)/Input range is 0000 to 3999 */
DKV5000XYM_CS = 23, /* Counter (setting value)/Input range is 0000 to 3999 */
DKV5000XYM_CC = 24, /* Counter (current value)/Input range is 0000 to 3999 */
DKV5000XYM_CTH = 16, /* High-speed counter (current value)/Input range is 0 to 1 */
DKV5000XYM_CTC_W = 17, /* CTC (setting value)/Input range is 0 to 3 */
DKV5000XYM_CM = 29, /* Control memory/Input range is 00000 to 5999 */
DKV5000XYM_CR_W = 100, /* Control relay/Input range is 0000 to 3900 and the last two digits is 00 */
DKV5000XYM_Z = 52, /* Index register/Input range is 1 to 12 */
DKV5000XYM_G = 76, /* Extension unit buffer memory/Input range is 0000000 to 4832767 and the first two digits is the unit No. */
DKV5000XYM_VM = 51, /* Work memory */
DKV5000XYM_M_W = 34, /* Internal auxiliary relay/Input range is 00000 to 15984 and only the values divisible by 16 can be set */
DKV5000XYM_L_W = 35, /* Latch relay/Input range is 00000 to 15984 and only the values divisible by 16 can be set */
DKV5000XYM_B_W = 48, /* Link relay/Input range is 0000 to 3FF0 and the last two digits is 0 */
DKV5000XYM_VB_W = 49, /* Work relay (word) */

} DBPlcDevice;

A-4 - KV COM+ Library User’s Manual -


2 Device List

KV-3000 Device type definition


typedef enum DBPlcDevice {
/*KV-3000*/
DKV3000_RLY_B = 0, /* Relay/Input range is 00000 to 99915, the last two digits is 0 to 15 and the first three digits is 000 to 999 */
DKV3000_CR = 10, /* Control relay/Input range is 0000 to 3915, the last two digits is 0 to 15 and the first two digits is 00 to 39 */
DKV3000_T = 7, /* Timer (Contact)/Input range is 0000 to 3999 */
DKV3000_C = 8, /* Counter (Contact)/Input range is 0000 to 3999 */
DKV3000_CTC = 9, /* CTC (Contact)/Input range is 0 to 3 */
DKV3000_MR = 12, /* Internal auxiliary relay/Input range is 00000 to 99915, the last two digits is 00 to 15 and the first three digits is 000 to 999 */
DKV3000_LR = 13, /* Latch relay/Input range is 00000 to 99915, the last two digits is 00 to 15 and the first three digits is 000 to 999 */
DKV3000_B = 45, /* Link relay/Input range is 0000 to 3FFF (hexadecimal), the last one digit is 0 to F and the first three digits is 000 to 3FF */
DKV3000_VB = 46, /* Work relay */
DKV3000_DM_B = 30, /* Data memory (handled in bits)/Input range is 0000000 to 6553415, the last two digits is 00 to 15 and the first five digits is 00000 to 65534 */
DKV3000_EM_B = 14, /* Extended data memory (handled in bits)/Input range is 0000000 to 6553415, the last two digits is 00 to 15 and the first five digits is 00000 to 65534 */
DKV3000_FM_B = 15, /* File register (handled in bits)/Input range is 0000000 to 3276715, the last two digits is 00 to 15 and the first five digits is 00000 to 32767 */
DKV3000_ZF_B = 70, /* File register (consecutive number method) (handled in bits)/Input range is 000000 to 13107115, the last two digits is 00 to 15 and the first six digits is 000000 to
131071 */
DKV3000_W_B = 47, /* Link register (handled in bits)/Input range is 00000 to 3FFFF (hexadecimal), the last one digit is 0 to F and the first four digits is 0000 to 3FFF */
DKV3000_VM_B = 53, /* Work memory (handled in bits) */
DKV3000_DM = 18, /* Data memory/Input range is 00000 to 65534 */
DKV3000_EM = 31, /* Extended data memory/Input range is 00000 to 65534 */
DKV3000_FM = 32, /* File register/Input range is 00000 to 32767 */
DKV3000_ZF = 75, /* File register (consecutive number method)/Input range is 00000 to 131071 */
DKV3000_W = 50, /* Link register/Input range is 0000 to 3FFF (hexadecimal) */
DKV3000_RLY_W = 25, /* Relay (00000 to 99900)/Input range is 00000 to 99900 and the last two digits is 00 */
DKV3000_TM = 19, /* Temporary data memory/Input range is 000 to 511 */

Appendices
DKV3000_TRM = 20, /* Trimmer/Input range is 0 to 7 */
DKV3000_TS = 21, /* Timer (setting value)/Input range is 0000 to 3999 */
DKV3000_TC = 22, /* Timer (current value)/Input range is 0000 to 3999 */
DKV3000_CS = 23, /* Counter (setting value)/Input range is 0000 to 3999 */
DKV3000_CC = 24, /* Counter (current value)/Input range is 0000 to 3999 */
DKV3000_CTH = 16, /* High-speed counter (current value)/Input range is 0 to 1 */
DKV3000_CTC_W = 17, /* CTC (setting value)/Input range is 0 to 3 */
DKV3000_CM = 29, /* Control memory/Input range is 00000 to 5999 */
DKV3000_CR_W = 100, /* Control relay/Input range is 0000 to 3900 and the last two digits is 00 */
DKV3000_Z = 52, /* Index register/Input range is 1 to 12 */
DKV3000_G = 76,
DKV3000_VM = 51,
/* Extension unit buffer memory/Input range is 0000000 to 4832767 and the first two digits is the unit No. */
/* Work memory */
DKV3000_MR_W = 34, /* Internal auxiliary relay/Input range is 00000 to 99900 and the last two digits is 00 */
A
DKV3000_LR_W = 35, /* Latch relay/Input range is 00000 to 99900 and the last two digits is 00 */
DKV3000_B_W = 48, /* Link relay/Input range is 0000 to 3FF0 and the last two digits is 0 */

Device List
DKV3000_VB_W = 49, /* Work relay (word) */

/*KV-3000(XYM) */
DKV3000XYM_RLY_B = 0, /* Relay/Input range is 00000 to 99915, the last two digits is 00 to 15 and the first three digits is 000 to 999 */
DKV3000XYM_X = 36, /* Input relay/Input range is 0000 to 999F, the last one digit is 0 to F and the first three digits is 000 to 999 */
DKV3000XYM_Y = 37, /* Output relay/Input range is 0000 to 999F, the last one digit is 0 to F and the first three digits is 000 to 999 */
DKV3000XYM_CR = 10, /* Control relay/Input range is 0000 to 3915, the last two digits is 0 to 15 and the first two digits is 00 to 39 */
DKV3000XYM_T = 7, /* Timer (Contact)/Input range is 0000 to 3999 */
DKV3000XYM_C = 8, /* Counter (Contact)/Input range is 0000 to 3999 */
DKV3000XYM_CTC = 9, /* CTC (Contact)/Input range is 0 to 3 */
DKV3000XYM_M = 12, /* Internal auxiliary relay/Input range is 00000 to 15999 */
DKV3000XYM_L = 13, /* Latch relay/Input range is 00000 to 15999 */
DKV3000XYM_B = 45, /* Link relay/Input range is 0000 to 3FFF (hexadecimal), the last one digit is 0 to F and the first three digits is 000 to 3FF */
DKV3000XYM_VB = 46, /* Work relay */
DKV3000XYM_D_B = 30, /* Data memory (handled in bits)/Input range is 0000000 to 6553415, the last two digits is 00 to 15 and the first five digits is 00000 to 65534 */
DKV3000XYM_E_B = 14, /* Extended data memory (handled in bits)/Input range is 0000000 to 6553415, the last two digits is 00 to 15 and the first five digits is 00000 to 65534 */
DKV3000XYM_F_B = 15, /* File register (handled in bits)/Input range is 0000000 to 3276715, the last two digits is 00 to 15 and the first five digits is 00000 to 32766 */
DKV3000XYM_ZF_B = 70, /* File register (consecutive number method) (handled in bits)/Input range is 000000 to 13107115, the last two digits is 00 to 15 and the first five digits is 00000
to 131071 */
DKV3000XYM_W_B = 47, /* Link register (handled in bits)/Input range is 00000 to 3FFFF (hexadecimal), the last one digit is 0 to F and the first four digits is 0000 to 3FFF */
DKV3000XYM_VM_B = 53, /* Work memory (handled in bits) */
DKV3000XYM_D = 18, /* Data memory/Input range is 00000 to 65534 */
DKV3000XYM_E = 31, /* Extended data memory/Input range is 00000 to 65534 */
DKV3000XYM_F = 32, /* File register/Input range is 00000 to 32767 */
DKV3000XYM_ZF = 75, /* File register (consecutive number method)/Input range is 000000 to 131071 */
DKV3000XYM_W = 50, /* Link register/Input range is 0000 to 3FFF (hexadecimal) */
DKV3000XYM_RLY_W = 25, /* Relay (00000 to 99900)/Input range is 00000 to 99900 and the last two digits is 00 */
DKV3000XYM_X_W = 38, /* Input relay (0000 to 9990)/Input range is 0000 to 9990 and the last one digit is 0 */
DKV3000XYM_Y_W = 39, /* Output relay (0000 to 9990)/Input range is 0000 to 9990 and the last one digit is 0 */
DKV3000XYM_TM = 19, /* Temporary data memory/Input range is 000 to 511 */
DKV3000XYM_TRM = 20, /* Trimmer/Input range is 0 to 7 */
DKV3000XYM_TS = 21, /* Timer (setting value)/Input range is 0000 to 3999 */
DKV3000XYM_TC = 22, /* Timer (current value)/Input range is 0000 to 3999 */
DKV3000XYM_CS = 23, /* Counter (setting value)/Input range is 0000 to 3999 */
DKV3000XYM_CC = 24, /* Counter (current value)/Input range is 0000 to 3999 */
DKV3000XYM_CTH = 16, /* High-speed counter (current value)/Input range is 0 to 1 */
DKV3000XYM_CTC_W = 17, /* CTC (setting value)/Input range is 0 to 3 */
DKV3000XYM_CM = 29, /* Control memory/Input range is 00000 to 5999 */
DKV3000XYM_CR_W = 100, /* Control relay/Input range is 0000 to 3900, the last two digits is 00 */
DKV3000XYM_Z = 52, /* Index register/Input range is 1 to 12 */
DKV3000XYM_G = 76, /* Extension unit buffer memory/Input range is 0000000 to 4832767 and the first two digits is the unit No. */
DKV3000XYM_VM = 51, /* Work memory */
DKV3000XYM_M_W = 34, /* Internal auxiliary relay/Input range is 00000 to 15984 and only the values divisible by 16 can be set */
DKV3000XYM_L_W = 35, /* Latch relay/Input range is 00000 to 15984 and only the values divisible by 16 can be set */
DKV3000XYM_B_W = 48, /* Link relay/Input range is 0000 to 3FF0 and the last two digits is 0 */
DKV3000XYM_VB_W = 49, /* Work relay (word) */
} DBPlcDevice;

- KV COM+ Library User’s Manual - A-5


2 Device List

KV-1000 Device type definition


typedef enum DBPlcDevice {
/*KV-1000*/
DKV1000_RLY_B = 0, /* Relay/Input range is 00000 to 59915 and the last two digits is 0 to 15 */
DKV1000_CR = 10, /* Control relay/Input range is 0000 to 3915 and the last two digits is 0 to 15 */
DKV1000_T = 7, /* Timer (Contact)/Input range is 0000 to 3999 */
DKV1000_C = 8, /* Counter (Contact)/Input range is 0000 to 3999 */
DKV1000_CTC = 9, /* CTC (Contact)/Input range is 0 to 3 */
DKV1000_MR = 12, /* Internal auxiliary relay/Input range is 00000 to 99915, the last two digits is 00 to 15 and the first three digits is 000 to 999 */
DKV1000_LR = 13, /* Latch relay/Input range is 00000 to 99915, the last two digits is 00 to 15 and the first three digits is 000 to 999 */
DKV1000_DM_B = 30, /* Data memory (handled in bits)/Input range is 0000000 to 6553415 and the last two digits is 0 to 15 */
DKV1000_EM_B = 14, /* Extended data memory (handled in bits)/Input range is 0000000 to 6553415, the last two digits is 00 to 15 and the first five digits
is 00000 to 65534 */
DKV1000_FM_B = 15, /* Extended data memory (handled in bits)/Input range is 0000000 to 3276615, the last two digits is 00 to 15 and the first five digits
is 00000 to 32766 */
DKV1000_DM = 18, /* Data memory/Input range is 00000 to 65534 */
DKV1000_EM = 31, /* Extended data memory/Input range is 00000 to 65534 */
DKV1000_FM = 32, /* Extended data memory/Input range is 00000 to 32766 */
DKV1000_RLY_W = 25, /* Relay (00000 to 59900)/Input range is 00000 to 59900 and the last two digits is 00 */
DKV1000_CR_W = 100, /* Control relay/Input range is 0000 to 3900 and the last two digits is 00 */
DKV1000_TM = 19, /* Temporary data memory/Input range is 000 to 511 */
DKV1000_TRM = 20, /* Trimmer/Input range is 0 to 7 */
Appendices

DKV1000_TS = 21, /* Timer (setting value)/Input range is 0000 to 3999 */


DKV1000_TC = 22, /* Timer (current value)/Input range is 0000 to 3999 */
DKV1000_CS = 23, /* Counter (setting value)/Input range is 0000 to 3999 */
DKV1000_CC = 24, /* Counter (current value)/Input range is 0000 to 3999 */
DKV1000_CTH = 16, /* High-speed counter (current value)/Input range is 0 to 1 */
DKV1000_CTC_W= 17, /* CTC (setting value)/Input range is 0 to 3 */
DKV1000_CM = 29, /* Control memory/Input range is 00000 to 11998 */
DKV1000_Z = 33, /* Index register/Input range is 1 to 12 */

A
DKV1000_MR_W= 34, /* Internal auxiliary relay/Input range is 00000 to 99900 and the last two digits is 00 */
DKV1000_LR_W = 35, /* Latch relay/Input range is 00000 to 99900 and the last two digits is 00 */
Device List

/*KV-1000(XYM) */
DKV1000XYM_RLY_B = 0, /* Relay/Input range is 00000 to 59915 and the last two digits is 0 to 15 */
DKV1000XYM_X = 36, /* Input relay/Input range is 0000 to 599F and the last one digit is 0 to F */
DKV1000XYM_Y = 37, /* Output relay/Input range is 0000 to 599F and the last one digit is 0 to F */
DKV1000XYM_CR = 10, /* Control relay/Input range is 0000 to 3915, the last two digits is 0 to 15 */
DKV1000XYM_T = 7, /* Timer (Contact)/Input range is 0000 to 3999 */
DKV1000XYM_C = 8, /* Counter (Contact)/Input range is 0000 to 3999 */
DKV1000XYM_CTC = 9, /* CTC (Contact)/Input range is 0 to 3 */
DKV1000XYM_M = 12, /* Internal auxiliary relay/Input range is 00000 to 15999 */
DKV1000XYM_L = 13, /* Latch relay/Input range is 00000 to 15999 */
DKV1000XYM_D_B = 30, /* Data memory (handled in bits)/Input range is 0000000 to 6553415, the last two digits is 00 to 15 and the first five digits
is 00000 to 65534 */
DKV1000XYM_E_B = 14, /* Extended data memory (handled in bits)/Input range is 0000000 to 6553415, the last two digits is 00 to 15 and the first
five digits is 00000 to 65534 */
DKV1000XYM_F_B = 15, /* Extended data memory (handled in bits)/Input range is 0000000 to 3276615, the last two digits is 00 to 15 and the first
five digits is 00000 to 32766 */
DKV1000XYM_D = 18, /* Data memory/Input range is 00000 to 65534 */
DKV1000XYM_E = 31, /* Extended data memory/Input range is 00000 to 65534 */
DKV1000XYM_F = 32, /* Extended data memory/Input range is 00000 to 32766 */
DKV1000XYM_RLY_W = 25, /* Relay (00000 to 59900)/Input range is 00000 to 59900 and the last two digits is 00 */
DKV1000XYM_X_W = 38, /* Input relay (0000 to 5990)/Input range is 0000 to 5990 and the last one digit is 0 */
DKV1000XYM_Y_W = 39, /* Output relay (0000 to 5990)/Input range is 0000 to 5990 and the last one digit is 0 */
DKV1000XYM_TM = 19, /* Temporary data memory/Input range is 000 to 511 */
DKV1000XYM_TRM = 20, /* Trimmer/Input range is 0 to 7 */
DKV1000XYM_TS = 21, /* Timer (setting value)/Input range is 0000 to 3999 */
DKV1000XYM_TC = 22, /* Timer (current value)/Input range is 0000 to 3999 */
DKV1000XYM_CS = 23, /* Counter (setting value)/Input range is 0000 to 3999 */
DKV1000XYM_CC = 24, /* Counter (current value)/Input range is 0000 to 3999 */
DKV1000XYM_CTH = 16, /* High-speed counter (current value)/Input range is 0 to 1 */
DKV1000XYM_CTC_W = 17, /* CTC (setting value)/Input range is 0 to 3 */
DKV1000XYM_CM = 29, /* Control memory/Input range is 00000 to 11998 */
DKV1000XYM_CR_W = 100, /* Control relay/Input range is 0000 to 3900 and the last two digits is 00 */
DKV1000XYM_Z = 33, /* Index register/Input range is 1 to 12 */
DKV1000XYM_M_W = 34, /* Internal auxiliary relay/Input range is 00000 to 15984 and only the values divisible by 16 can be set */
DKV1000XYM_L_W = 35, /* Latch relay/Input range is 00000 to 15984 and only the values divisible by 16 can be set */

} DBPlcDevice;

A-6 - KV COM+ Library User’s Manual -


2 Device List

KV-700 Device type definition


typedef enum DBPlcDevice {
/*KV-700*/
DKV700_RLY_B = 0, /* Relay/Input range is 00000 to 59915 and the last two digits is 0 to 15 */
DKV700_CR = 10, /* Control relay/Input range is 0000 to 3915 and the last two digits is 0to 15 */
DKV700_T = 7, /* Timer (Contact)/Input range is 000 to 511 */
DKV700_C = 8, /* Counter (Contact)/Input range is 000 to 511 */
DKV700_CTC = 9, /* CTC (Contact)/Input range is 0 to 3 */
DKV700_DM_B = 30, /* Data memory (handled in bits)/Input range is 0000000 to 3999915 and the last two digits is 0 to 15 */
DKV700_DM = 18, /* Data memory/Input range is 00000 to 39999 */
DKV700_RLY_W = 25, /* Relay (00000 to 59900)/Input range is 00000 to 59900 and the last two digits is 00 */
DKV700_CR_W = 100, /* Control relay (0000 to 3900)/Input range is 0000 to 3900 and the last two digits is 00 */
DKV700_TM = 19, /* Temporary data/Input range is 000 to 511 */
DKV700_TRM = 20, /* Trimmer/Input range is 0 to 7 */
DKV700_TS = 21, /* Timer (setting value)/Input range is 000 to 511 */
DKV700_TC = 22, /* Timer (current value)/Input range is 000 to 511 */
DKV700_CS = 23, /* Counter (setting value)/Input range is 000 to 511 */
DKV700_CC = 24, /* Counter (current value)/Input range is 000 to 511 */
DKV700_CTH = 16, /* High-speed counter (current value)/Input range is 0 to 1 */
DKV700_CTC_W = 17, /* CTC (setting value)/Input range is 0 to 3 */
DKV700_CM = 29, /* Control memory/Input range is 0000 to 3999 */
} DBPlcDevice;

Appendices
A

Device List

- KV COM+ Library User’s Manual - A-7


3 Bit Specification of Word Device

In some cases, Word device can be selected or specified as bit device in property page, property, or
method.
For example, when DM is selected, the device No. is displayed as follows.

Most significant bit Least significant bit


DM0000000 15 0
The lower two digits is 00 to 15
DM00000
Appendices

A
Bit Specification of Word Device

A-8 - KV COM+ Library User’s Manual -


4 Model Change

 Operations accompanied with model change


• Change in PLC property of DBCommManager
• Change in CommManager property of DBDeviceManager
• Change in CommManager property of DBRTLoggingManager
• Change in CommManager property of DBTriggerParamDevice

 Devices subject to model change


PLC property . . . . . . . . . . . . .All the devices registered in DBDeviceManager, DBRTLoggingManager,
and DBTriggerManager referring to DBCommManager which changed
PLC property
CommManager property . . . .All the devices registered in DBDeviceManager, DBRTLoggingManager,
and DBTriggerManager which changed CommManager property

Appendices
 Properties of each device after model change
Depending on the types of devices before model change, conversion may fail at model change. The
following shows the properties of each device after model change is completed.

● When conversion succeeded


• Device type (Kind) . . . . . . .Similar device A
• Device No. (No) . . . . . . . . .Same No. *
• ReadValueValid . . . . . . . . .False

Model Change
• ValueRead . . . . . . . . . . . . .0
• ValueWrite . . . . . . . . . . . . .0
* When Nos. do not exist in the model after change result in conversion failure. They may be converted as a
character string.
Example) "0000" -> "00000"

● When conversion failed


• Device type . . . . . . . . . . . . .254 (DB_NODEV)
• Device No. . . . . . . . . . . . . .""(Empty character string)
• IsReadValueValid . . . . . . . .False
• IsReadEnabled . . . . . . . . . .False
• IsWriteEnabled . . . . . . . . . .False
• ValueRead . . . . . . . . . . . . .0
• ValueWrite . . . . . . . . . . . . .0

- KV COM+ Library User’s Manual - A-9


5 Error Message Lists

The following shows the error message lists of KV COM+ Library.


Error No. is acquired by Err.Number, and error message by Err.Description.

ActiveX

Each object

Error No. Error message Cause Remedy


Because communication
Start communication
0x80040000 Incorrect handle (Connect) is not started,
(Connect).
communication fails.
Appendices

Operation mode is shifted


0x80040001 Program not registered to RUN by SetMode while Transfer Ladder to PLC.
PLC has no Ladder.
Incorrect communication Baudrate settings are Check the settings of
0x80040002
speed specified incorrect baudrate (Peer).
A The specified COM port Check the settings of COM
0x80040003 Incorrect COM port No.
No. is incorrect. port (Peer)
Error Message Lists

SetMode, GetErrorNumber
and ClearError are
Start communication
0x80040004 No connection is made executed without
(Connect).
communication startup
(Connect).
Please set up connection Communication setting is Perform communication
0x80040005
destination (Peer attribute) not completed. setting.
The specified number of
Incorrect number of Check the number of
0x80040006 devices created is not
devices created devices created.
correct.
No CommManager was Target (CommManager) is
0x80040007 Specify CommManager.
assigned. not specified.
No device is registered in Register a device in
0x80040008 No device is held
DBDevices. DBDevices.
ReadAll and WriteAll
Communication stopped. Start communication
0x80040009 cannot be executed while
Access denied. (Connect).
communication is stopped.
The specified device No. is Check the specified device
0x8004000B Incorrect device No.
incorrect. No.
The specified value is
0x8004000C Value out of range Check the specified value.
incorrect.
Writing is done to a timer,
Check whether the
The device was not counter, high-speed
0x8004000D specified device is use in
registered counter or CTC which is
Ladder.
not used in Ladder.
Write protection is enabled
(MEMSW). The setting
0x8004000E Writing prohibited values of timer, counter Cancel write protection.
and CTC cannot be
changed.
CTC (contact) cannot be
CTC device contact cannot CTC (contact) is attempted
0x8004000F turned to ON by
be set. to be turned to ON.
communication command.

A-10 - KV COM+ Library User’s Manual -


5 Error Message Lists

Error No. Error message Cause Remedy


The specified device No. is Check the specified device
0x80040010 Incorrect device No.
incorrect. No.
No PLC properties were
Check the settings of PLC
0x80040011 specified for PLC properties are not set.
properties.
CommManager
Check whether the
The index specified by
0x80040012 Index is out of range specified index exceeds
Item is out of range.
the registered number.
Automatic OFF (OneShot)
Only a user defined trigger Set each property of the
0x80040013 was set by a trigger
can be set up specified type of triggers.
different from any trigger.
Set the name of the trigger
The same name already The name of the trigger
0x80040014 (Name) avoiding

Appendices
exists (Name) is duplicate.
duplication.
The name of the trigger is Enter the name of the
0x80040015 No name was entered
not entered. trigger (Name).
A negative value is
0x80040017
Specify 0 or a greater
value for the cycle
specified for the period
Set 0 or a greater value for
the period (IntervalMSec).
A
(IntervalMSec).

Error Message Lists


The cycle (IntervalMSec) is
Set each property of the
0x80040018 No cyclic trigger set by a trigger different
specified type of triggers.
from a cyclic trigger.
Incorrect time range Time range specification is Check the contents of time
0x80040019
specified specification incorrect. specification.
The specified year condition Check the year condition
0x8004001A Incorrect year specified
(Year) is incorrect. (Year).
The specified month
Check the month condition
0x8004001B Incorrect month specified condition (Month) is
(Month).
incorrect.
The specified date condition Check the date condition
0x8004001C Incorrect date specified
(Day) is incorrect. (Day).
The specified hour condition Check the hour condition
0x8004001D Incorrect hour specified
(Hour) is incorrect. (Hour).
The specified minute
Check the minute condition
0x8004001E Incorrect minute specified condition (Minute) is
(Minute).
incorrect.
The specified second
Check the second
0x8004001F Incorrect second specified condition (Second) is
condition (Second).
incorrect.
Each property of the time
trigger is set by a trigger Set each property of the
0x80040020 No time trigger
different from a time specified type of triggers.
trigger.
Though the weekday
condition (DayOfWeek) is Specify the weekday
0x80040021 No weekday is specified.
enabled, that is not condition.
specified.
Each property of the time
range trigger is set by a Set each property of the
0x80040022 No time range trigger
trigger different from a time specified type of triggers.
range trigger.

- KV COM+ Library User’s Manual - A-11


5 Error Message Lists

Error No. Error message Cause Remedy


The same trigger is
0x80040023 Trigger duplicated specified in combination Specify a different trigger.
triggers.
Loop reference. The object is the trigger
Do not specify the trigger
0x80040024 Specification is not which is being set by
which is being set.
possible combination triggers.
Each property of
combination triggers is set Set each property of the
0x80040025 No combination trigger
by a trigger different from specified type of triggers.
combination triggers.
Two triggers are not
0x80040026 No trigger specified specified in combination Specify two triggers.
triggers (AND only).
Appendices

Each property of an any


trigger is set by a trigger Set each property of the
0x80040027 No any trigger
different from an any specified type of triggers.
trigger.

A 0x80040BF4
Failed to initialize specified The value specified by
Specify a value which is
listed in the connection
PLC ID PLC properties is incorrect.
model list.
Error Message Lists

During communication

Error No. Error message Cause Remedy


The number of
The number of Reduce the number of the
connections reaches the
0x800403E8 connections has reached devices communicated
upper limit available for
upper limit with connected devices.
connected devices.
Check the communication
route and communication
Communication port
0x800403E9 Failed to open the port settings of PC. If the port
cannot be opened.
has already been opened,
close the port once.
0x800403EA Timeout error Check the communication
route and communication
settings of both PC and
Timeout error occurred. connected devices. In an
0x800403EB Timeout environment with a lot of
noise, take measures
against noise.
Check the communication
route and communication
Failed to open Communication port
0x800403EC settings of PC. If the port
Communication port cannot be opened.
has already been opened,
close the port once.
0x800403EE CAN received Check the communication
route and communication
0x800403EF NAK received
settings of both PC and
0x800403F0 Retry over Communication error. connected devices. In an
environment with a lot of
0x800403F1 Retry request noise, take measures
against noise.
The USB port of PC is not Set the USB port of PC to
0x800403F2 USB cannot be used
in usable-state. usable-state.

A-12 - KV COM+ Library User’s Manual -


5 Error Message Lists

Error No. Error message Cause Remedy


0x800403F3 Writing to USB failed Check the communication
route and communication
settings of both PC and
Communication error. connected devices. In an
0x800403F4 Reading from USB failed environment with a lot of
noise, take measures against
noise.
The host name specified in Check the communication
Host name cannot be
0x800403F5 communication settings is not settings and settings of the
resolved
registered. server.
0x800403F6 Send error Sending failed. Check the communication
route and communication
settings of both PC and

Appendices
Cut off from the connected connected devices. In an
0x800403F7 Cut off by counterparty environment with a lot of
device.
noise, take measures against
noise.
Shutdown the program and
0x800403F8 Initialization failed Initialization of DLL failed.
restart the PC. If the problem
is not solved, reinstallation will
A
be necessary.

Error Message Lists


Communication is stopped by
0x800403FA Cancelled by user Resume communication.
the user's operation.
Reached the upper limit of the Reduce the number of the
0x800403FB Max number of sockets number of sockets available devices communicated with
for connected devices. connected devices.
Check the communication
route and communication
settings of both PC and
0x800403FC Serial number error Communication error. connected devices. In an
environment with a lot of
noise, take measures against
noise.
0x800403FD Other sockets error Error in TCP/IP settings. Check TCP/IP settings of PC.
0x800403FE Incorrect received data length Check the communication
route and communication
0x800403FF Too short response
settings of both PC and
0x80040402 Transmission error Communication error. connected devices. In an
0x80040404 Unit error environment with a lot of
noise, take measures against
0x80040406 A transmission error occurred noise.
Check the communication
An error occurred in route between VT3 and PLC,
0x80040409 PLC com. error occurred communication between VT3 and communication settings
and PLC. of each. And check the
specified device contents.
PLC property of
Do not change the connected
Connecting. PLC cannot be DBCommManager under
0x80040BF5 unit type during
changed communication is attempted
communication.
to be changed.
Switching VT3 unit mode
0x8004138C Mode switching of VT3 failed. Check the state of VT3.
failed
An internal error occurred in
0x8004138D An error of VT3 is detected. Check the state of VT3.
on the side of VT3 unit

- KV COM+ Library User’s Manual - A-13


5 Error Message Lists

Other

Error No. Error message Cause Remedy


Installation information was Installation is not finished Shutdown the program and
0x800407D2
not found properly. reinstall.
Incorrect Serial DLL DLL for serial connection
0x800407D4
version cannot be loaded.
Shutdown the program and
DLL for Ethernet restart the PC. If the
Incorrect Ethernet DLL
0x800407D5 connection cannot be problem is not solved,
version
loaded. reinstallation will be
necessary.
DLL for USB connection
0x800407D6 Incorrect USB DLL version
cannot be loaded.
OS resources of PC are Shutdown the program and
0x800407D7 Insufficient OS resources
Appendices

lacking. restart the PC.


Shutdown the program and
restart the PC. If the
DLL loading or reading DLL used for ActiveX
0x800407D8 problem is not solved,
failed cannot be read properly.
reinstallation will be
A necessary.
The time range of time Check the contents of time
0x80040BC3 Incorrect date and time
Error Message Lists

specification is invalid. specification.


Excel or user program
exception detected.
Unexpected operation may
- occur. So please save your Shutdown the program and
An exception is detected.
data and restart the restart the PC.
application.
- Detect exception

A-14 - KV COM+ Library User’s Manual -


5 Error Message Lists

DLL

Constant Value Cause Remedy


Normal termination. Not an
DB_NOERROR 0 -
error.
The number of connections Reduce the number of devices
DB_ERR_CONNECT_FULL 1 reaches the upper limit communicated with connected
available for connected devices. devices.
DB_ERR_INVALID_NAME 2 Reserved -
Shutdown the program and
restart the PC. If the problem is
DB_ERR_LOAD_DLL 3 DLL was not read properly.
not solved, reinstallation will be

Appendices
necessary.
Check the communication route
Communication port cannot be and communication settings of
DB_ERR_OPEN_PORT 4
opened properly. PC. If the port has already been
opened, close the port once.
Because communication is not
A
DB_ERR_INVALID_HANDLE 5 Start communication.
started, communication fails.

Error Message Lists


Mode specification of
DB_ERR_INVALID_MODE 6
DBChangeMode() is invalid.
Check the argument.
DB_ERR_PARAM_NOT_FO Not a parameter for KV-5500/
7
R_ KV700 5000/3000/1000/700.
Operation mode is shifted to
DB_ERR_NO_PRG 9 RUN by DBChangeMode() Transfer Ladder to PLC.
while PLC has no Ladder.
The value of an argument of a
DB_ERR_INVALID_PARAM 10
function is incorrect.
An argument of
DB_ERR_INVALID_TIME 11 DBSetSystemTime() is Check the argument.
incorrect.
DB_ERR_INVALID_DEV_CN Specification of the number of
12
T devices is incorrect.
Writing is performed to a device
which is not used in Ladder
DB_ERR_UNREG_DEV 13 Check the specified device.
(timer, counter and high-speed
counter).
DB_ERR_MIXED_DEV_TYP
14 Reserved -
E
DB_ERR_INVALID_DEV_TY Specification of the number of
15 Check the argument.
PE devices is incorrect.
Write protection of Ladder is
enabled. The setting values of
DB_ERR_PROTECT 16 Cancel write protection.
timer, counter and CTC cannot
be changed.
An argument of
DB_ERR_INVALID_DATETI
17 DBSetSystemTime() is Check the argument.
ME
incorrect.
DB_ERR_LOG_RUNWR 18 Reserved -
DB_ERR_LOG_UNREG 19 Reserved -
DB_ERR_LOG_ANOTHER 20 Reserved -

- KV COM+ Library User’s Manual - A-15


5 Error Message Lists

Constant Value Cause Remedy


DB_ERR_LOG_RUNNING 21 Reserved -
DB_ERR_LOG_TIMESTAMP 22 Reserved -
DB_ERR_LOG_TRIG 23 Reserved -
DB_ERR_LOG_OVERWRIT
24 Reserved -
E
DB_ERR_LOG_EMPTY 25 Reserved -
DB_ERR_LOG_INVALID_ID 26 Reserved -
DB_ERR_INVALID_BANKN Monitor: Specification of bank
27 Check the argument.
O No. is incorrect.
DB_ERR_MON_ODD_BIT 28 Reserved -
Monitor: Monitor registration is
Appendices

DB_ERR_MON_UNREG 29 Perform monitor registration.


not done.
Monitor: The number of reading
DB_ERR_READ_CNT 30 Check the argument.
is incorrect.
DB_ERR_MON_BANK_CNT 31 Reserved -
A Monitor: The number of
DB_ERR_MON_CNT 32 monitor-registered devices is Check the argument.
incorrect.
Error Message Lists

DB_ERR_ALIAS_OPEN 33 Reserved -
DB_ERR_ALIAS_INVALID_I
34 Reserved -
NFO
DB_ERR_ALIAS_READ 35 Reserved -
DB_ERR_ALIAS_NOT_EXIS
36 Reserved -
T
DB_ERR_ALIAS_MAX 37 Reserved -
DB_ERR_CTH_HAS_NOPR
38 Reserved -
ESET
DB_ERR_CTH_HAS_NOCO
39 Reserved -
NTACT
DB_ERR_CTC_HAS_NOCU
40 Reserved -
RRENT
DB_ERR_CTC_SET_CONT CTC (contact) is attempted to
41
ACT be turned to ON.
Conversion of communication
destination character sting <-> CTC (contact) cannot be turned
communication setting to ON by communication
DB_ERR_INVALID_BAUDR command.
42 information structure.
ATE
Communication speed
specification of RS-232C is
incorrect. Check the argument.
DB_ERR_INVALID_STATIO
43 Reserved -
N
DB_ERR_INVALID_PLCID 44 Reserved -
DB_ERR_SERIALDLL DLL for serial connection Shutdown the program and
45
_VERSION cannot be loaded. restart the PC. When the problem
DB_ERR_ETHERNETDLL DLL for Ethernet connection is not solved, reinstallation is
46 necessary.
_VERSION cannot be loaded.

A-16 - KV COM+ Library User’s Manual -


5 Error Message Lists

Constant Value Cause Remedy


DB_ERR_USBDLL Shutdown the program and restart
DLL for USB connection cannot
47 the PC. When the problem is not
_VERSION be loaded.
solved, reinstallation is necessary.
OS resources of PC are Shutdown the program and restart
DB_ERR_OS_RESOURCE 48
insufficient. the PC.
DB_ERR_LOG_STOP 49 Reserved -
DB_ERR_LOG_FLAG 50 Reserved -
DB_ERR_LOG_STAMP 51 Reserved -
DB_ERR_LOG_TRIGGER 52 Reserved -
When handling RLY.CR as word,
DB_ERR_INVALID_DEVNO 53 The device No. is incorrect. set the lower two digits of the
device No. to 0.

Appendices
Conversion of communication
DB_ERR_INVALID destination character sting <->
54 communication setting Check the argument.
_COMPORT information structure. Port No. of
RS-232C is incorrect.
DB_ERR_ALIAS
_ALREADY_EXIST
55 Reserved - A
DB_ERR_READ The records may have increased

Error Message Lists


56 Reading alarm records failed. during reading. Perform reading
_ALARMLOG again.
DB_ERR_INVALID_ALIAS
57 Reserved -
_NAME
DB_ERR_CMD_RESP 58 Communication error.
60 Some components of the path are
DB_ERR_INVALID_PATH Check the contents of the path.
(10002) not directories.
61
DB_ERR_FILE_EXIST The specified file already exists. Change the file name.
(10003)
62
DB_ERR_FILE_NOT_EXIST The specified file does not exist. Check the file name and path.
(10004)
63
DB_ERR_IS_DIRECTORY The specified path is the directory. Check the specified path.
(10005)
64 Check the space of the memory
DB_ERR_NO_SPACE Enough space is not available.
(10006) card.

65 Check the file size. A file whose


A file greater than the maximum
DB_ERR_FBIG size is greater than 256MB cannot
(10007) file size is attempted to write.
be copied.
66 Check the read-only setting of the
DB_ERR_READ_ONLY The file is read-only.
(10008) file.
67
DB_ERR_NOT_EMPTY The directory is not empty. Check data in the directory.
(10009)
68 Check whether a memory card is
DB_ERR_NXIO No memory card is equipped.
(10010) equipped.
69 The layer of the directory is too
DB_ERR_DIRNEST_OVER Move the file to a shallower layer.
(10011) deep.
70 Check whether the file is destroyed
DB_ERR_FILE_FORMAT File error.
(10012) or not.
71 Increase the specified size to a
DB_ERR_FILE_SIZE_0 The file size is 0.
(10013) greater value than 0.

* In (), an error code at the time of using DBMemcard object.

- KV COM+ Library User’s Manual - A-17


5 Error Message Lists

Constant Value Cause Remedy


• Though the file exists, the
specified operation is not
73 Check the access right to the
DB_ERR_OPEN_FILE permitted.
(10001) directory.
• Writing to the directory is not
permitted.
When the connected device is
Memory card access is
DB_ERR_FCMD_NOT_FOR 74 KV-1000/7000, memory card
attempted to be performed to
_KV700 (10015) functions cannot be used. Check
KV-1000/700.
the connection destination PLC.
DB_ERR_TIMEOUT -1 Timeout error occurred.
Check the communication route
DB_ERR_RECEIVE_CAN -2 Communication error.
and communication settings of
DB_ERR_RECEIVE_NAK -3 Communication error. both PC and connected devices.
Appendices

DB_ERR_RETRY_OVER -4 Communication error. In an environment with a lot of


noise, take measures against
DB_ERR_REQ_RETRY -5 Communication error.
noise.
DB_ERR_TIME_OUT -6 Timeout error occurred.
DB_ERR_OVER_RECEIVE
-7 Reserved
A _LENGTH -

DB_ERR_OVER
-8 Reserved -
_MAXPATHNAME
Error Message Lists

Check the communication route


Communication port cannot be and communication settings of
DB_ERR_DONT_OPEN -9
opened. PC. If the port has already been
opened, close the port once.
DB_ERR_OPEN_PTN -10 Reserved -
Communication port is not
DB_ERR_NO_OPENED -11 Start communication.
opened.
DB_ERR_REPS_LESS -12 Reserved -
Check the communication route
and communication settings of
both PC and connected devices.
DB_ERR_REPS_BUFF -13 Communication error.
In an environment with a lot of
noise, take measures against
noise.
The USB port of PC is not in Set the USB port of PC to usable-
DB_ERR_USB_OPEN -14
usable-state. state.
DB_ERR_USB_WRITE -15 Communication error. Check the communication route
and communication settings of
DB_ERR_USB_READ -16 Communication error.
both PC and connected devices.
In an environment with a lot of
DB_ERR_RECV_CMDCOD
-17 Communication error. noise, take measures against
E
noise.
DB_ERR_CPU_TYPE -18 Reserved -
DB_ERR_MODEM_BUSY -19 Reserved -
DB_ERR_MODEM_NO_CA
-20 Reserved -
RRIER
DB_ERR_MODEM_NO_DIA
-21 Reserved -
L

* In (), an error code at the time of using DBMemcard object.

A-18 - KV COM+ Library User’s Manual -


5 Error Message Lists

Constant Value Cause Remedy


DB_ERR_MODEM_NOTFO
-22 Reserved -
UND
DB_ERR_MODEM_OTHER_
-23 Reserved -
ERROR
Check the communication route
and communication settings of
both PC and connected devices.
DB_ERR_RECVSUM_ERR -24 Communication error.
In an environment with a lot of
noise, take measures against
noise.
The host name specified in Check the communication
DB_ERR_IP_UNKNOWN_H
-25 communication settings is not settings and settings of the
OST
registered. server.

Appendices
DB_ERR_IP_SEND -26 Sending failed. Check the communication route
and communication settings of
both PC and connected devices.
Cut off from the connected In an environment with a lot of
DB_ERR_IP_CLOSE -27
device. noise, take measures against
noise. A
Shutdown the program and

Error Message Lists


restart the PC. When the problem
DB_ERR_IP_INITIALIZE -28 Initialization of DLL failed.
is not solved, reinstallation is
necessary.
DB_ERR_IP_UDP_SIZE -29 -
Communication is stopped by
DB_ERR_IP_CANCEL -30 Resume communication.
the user's operation.
Reaches the upper limit of the Reduce the number of the
DB_ERR_IP_SOCKET_MAX -31 number of sockets available for devices communicated with
connected devices. connected devices.
Check the communication route
and communication settings of
both PC and connected devices.
DB_ERR_IP_SEQUNCE -32 Communication error.
In an environment with a lot of
noise, take measures against
noise.
DB_ERR_IP_TIMEOUT_SE
-33 Reserved -
T
DB_ERR_IP_UNITSEARCH
-34 Reserved -
_MAX
DB_ERR_IP_SOCKET -35 Error in TCP/IP settings. Check TCP/IP settings of PC.
DB_ERR_IP_NO_WINSOCK -36 Reserved -
DB_ERR_DEV_UNINIT 65528 Reserved -
DB_ERR_EXCEPTION 65529 Reserved -
DB_ERR_SEND_CONTENT 65530 Communication error. Check the communication route
DB_ERR_RESP_CONTENT 65531 Communication error. and communication settings of
both PC and connected devices.
In an environment with a lot of
DB_ERR_RESP_LEN 65532 Communication error. noise, take measures against
noise.
DB_ERR_INTERNAL 65533 Reserved -
DB_ERR_not_implemented 65534 Reserved -

- KV COM+ Library User’s Manual - A-19


6 About Compatibility

 About installation
It can be installed on a PC with KV COM+ for Excel (KV-DH1E).

 Difference from KV COM+ for Excel (KV-DH1E)


A file created using Excel add-in functions of KV COM+ for Excel cannot be used in KV COM+ Library.

 Difference between different versions of the software


When a user application is created by an older version or later version is run in this version environment
• An application created by an older version is compatible with this version and usable.
• When an application is created with this version or using new functions introduced from this version,
an error occur and the application cannot be run.
• As for an application created by this version, if a later version has compatibility for the application
with older versions, it can be used in the later version.
Appendices

• When an application created by a later version is used in this version, newly added functions cannot
work. If all the functions used in the application are usable in this version, the application can be
used.

A
About Compatibility

A-20 - KV COM+ Library User’s Manual -


7 Index

DBRTLoggingDataCollection
A Object........................................ 4-16, 4-160
About Compatibility .............................. A-20 DBRTLoggingDataValue
About DLL Function ................................5-1 Object........................................ 4-18, 4-166
Access Functions to a Memory Card ....5-43 DBRTLoggingManager Control.............3-31
ActiveX ................................................. A-10 DBRTLoggingManager
ActiveX Control ...................................4-168 Object........................................ 4-13, 4-130
Addition of Trigger Setting.......................3-9 DBTrigger Object .......................... 4-8, 4-93
Alarm.....................................................5-41 DBTriggerManager Control .....................3-8
Appendices ............................................ A-1 DBTriggerManager Object ............ 4-7, 4-84
DBTriggerParamCustom
Object........................................ 4-11, 4-119
B DBTriggerParamDevice

Appendices
Object........................................ 4-12, 4-121
Basic .................................. 3-43, 3-45, 3-50 DBTriggerParamInterval
Before Installation of Object.......................................... 4-9, 4-105
KV COM+ Library....................................1-5 DBTriggerParamLogical
Before Use ..............................................1-1 Object........................................ 4-10, 4-116
Bit Specification of Word Device ............ A-8 DBTriggerParamTimeAt
Object.......................................... 4-9, 4-106

Index
C DBTriggerParamTimeSpan
Object........................................ 4-10, 4-114
Change of Trigger Setting .....................3-21 DBTriggers Object......................... 4-7, 4-87
Communication manager DBValueConverterEx Object...............4-187
Object.......................................... 3-23, 3-32 Deletion of Trigger Setting ....................3-21
Communication Setting ...........................3-3 Details of Properties/Methods/
Configuration and Function .....................2-2 Events ...................................................4-19
Configuration of KV COM+ Library .........2-2 Device ......................................... 3-24, 3-33
Connection Control .................................5-9 Device List.............................................. A-4
Constant, Type and Structure Device Specification..............................3-15
Definition .................................................5-3 Display ........................................ 3-46, 3-51
DLL....................................................... A-15
DLL Function...........................................5-3
D
Data Conversion Function...................4-187 E
DBBarMeter Control..............................3-44
DBBarMeter Object .............................4-169 Error Message Lists ............................. A-10
DBCommandButton Control..................3-42
DBCommandButton Object.................4-168
DBCommManager Control......................3-2
H
DBCommManager Object ............. 4-2, 4-19 How to Set the Path ................................5-2
DBDevice Object........................... 4-6, 4-73 How to Use KV COM+ Library ................2-5
DBDeviceManager Control ...................3-22
DBDeviceManager Object............. 4-4, 4-50
DBDevices Object ......................... 4-5, 4-63 I
DBFanMeter Control .............................3-49
DBFanMeter Object ............................4-170 Include File..............................................5-2
DBMemcardAccess Object ........... 4-3, 4-39 Initialization of DataBuilder.dll .................5-8
DBRTLoggingData Object......... 4-17, 4-162 Install on Windows 7/Vista ..................... A-2
Install on Windows XP ........................... A-2

- KV COM+ Library User’s Manual - A-21


7 Index

Installation of DLL ...................................5-2


Installation of KV COM+ Library..............1-6 T
Trigger......................................... 3-29, 3-40
L
Link Setting .............................................5-2 U
Lists of Properties/Methods/Events.........4-2 USB Driver Installation ........................... A-2
Use of KV COM+ Library
M (on Visual Basic 2005) ............................2-6
Use of KV COM+ Library
Model Change........................................ A-9 (When Using Visual C++)......................2-38
Use of KV COM+ Library on Access.....2-45
Use of KV COM+ Library on Excel........2-41
Appendices

O Use on a Worksheet..............................2-41
Operation Environment ...........................1-3 Use on User Form.................................2-43
Operation Environment and
System Configuration..............................1-3
Operation Mode/State Control ..............5-13
Other Control.........................................5-54
Index

Overview .................................................1-2

P
PLC Trigger...........................................3-38
Program Creation on Visual Studio.........2-6
Program Example -
Asynchronous Monitor ..........................2-20
Program Example - Device Trigger.......2-28
Program Example -
Switching Operation Mode of
KV Series PLC ........................................2-8
Program Example -
Synchronous Monitor ............................2-14
Programming Technique.........................2-1
Property Method Event ...........................4-1
Property Page Setting Method ................3-1

R
Read/Write to a Device .........................5-15

S
Safety Precautions ................................1-10
Scale ........................................... 3-48, 3-53
Software Installation................................1-5
System Configuration..............................1-4

A-22 - KV COM+ Library User’s Manual -


77 Index

MEMO

Appendices
Index

- KV COM+ Library User’s Manual - A-23


Revision History
Printing Date Version Details of Revision

Dec 2010 1st version


Sep 2010 2nd version
Jan 2011 3rd version Official release
Mar 2011 4th version
WARRANTIES AND DISCLAIMERS
(1) KEYENCE warrants the Products to be free of defects in materials and workmanship for a period of
one (1) year from the date of shipment. If any models or samples were shown to Buyer, such mod-
els or samples were used merely to illustrate the general type and quality of the Products and not to
represent that the Products would necessarily conform to said models or samples. Any Products
found to be defective must be shipped to KEYENCE with all shipping costs paid by Buyer or offered
to KEYENCE for inspection and examination. Upon examination by KEYENCE, KEYENCE, at its
sole option, will refund the purchase price of, or repair or replace at no charge any Products found
to be defective. This warranty does not apply to any defects resulting from any action of Buyer,
including but not limited to improper installation, improper interfacing, improper repair, unauthorized
modification, misapplication and mishandling, such as exposure to excessive current, heat, cold-
ness, moisture, vibration or outdoors air. Components which wear are not warranted.
(2) KEYENCE is pleased to offer suggestions on the use of its various Products. They are only
suggestions, and it is Buyer's responsibility to ascertain the fitness of the Products for Buyer’s
intended use. KEYENCE will not be responsible for any damages that may result from the use of
the Products.
(3) The Products and any samples ("Products/Samples") supplied to Buyer are not to be used internally
in humans, for human transportation, as safety devices or fail-safe systems, unless their written
specifications state otherwise. Should any Products/Samples be used in such a manner or misused
in any way, KEYENCE assumes no responsibility, and additionally Buyer will indemnify KEYENCE
and hold KEYENCE harmless from any liability or damage whatsoever arising out of any misuse of
the Products/Samples.
(4) OTHER THAN AS STATED HEREIN, THE PRODUCTS/SAMPLES ARE PROVIDED WITH NO
OTHER WARRANTIES WHATSOEVER. ALL EXPRESS, IMPLIED, AND STATUTORY
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT
OF PROPRIETARY RIGHTS, ARE EXPRESSLY DISCLAIMED. IN NO EVENT SHALL KEYENCE
AND ITS A FFILIATED ENTITIES BE LIABLE TO ANY PERSON OR ENTITY FOR ANY DIRECT,
INDIRECT, INCIDENTAL, PUNITIVE, SPECIAL OR CONSEQUENTIAL DAMAGES (INCLUDING,
WITHOUT LIMITATION, ANY DAMAGES RESULTING FROM LOSS OF USE, BUSINESS
INTERRUPTION, LOSS OF INFORMATION, LOSS OR INACCURACY OF DATA, LOSS OF
PROFITS, LOSS OF SAVINGS, THE COST OF PROCUREMENT OF SUBSTITUTED GOODS,
SERVICES OR TECHNOLOGIES, OR FOR ANY MATTER ARISING OUT OF OR IN
CONNECTION WITH THE USE OR INABILITY TO USE THE PRODUCTS, EVEN IF KEYENCE
OR ONE OF ITS AFFILIATED ENTITIES WAS ADVISED OF A POSSIBLE THIRD PARTY’S
CLAIM FOR DAMAGES OR ANY OTHER CLAIM AGAINST BUYER. In some jurisdictions, some
of the foregoing warranty disclaimers or damage limitations may not apply.

BUYER'S TRANSFER OBLIGATIONS:


If the Products/Samples purchased by Buyer are to be resold or delivered to a third party, Buyer
must provide such third party with a copy of this document, all specifications, manuals, catalogs,
leaflets and written information provided to Buyer pertaining to the Products/Samples.

E1110-2

- KV COM+ Library User’s Manual -

You might also like