CV-X ActiveX Reference Manual
CV-X ActiveX Reference Manual
CV-X Series
ActiveX Control
Reference Manual
Read this manual before use.
Keep this manual in a safe place for future reference.
Introduction
This manual explains the basic usage and operation of CV-X Series ActiveX Control (CVX Control).
Information is provided on the handling and application programming interface of the CVX Control.
Read this manual thoroughly in order to understand how the CVX Control works and to maximize
performance of the system.
Related manuals
Also, read the manual for the CV-X Series that will be connected when using the CVX Control.
Symbols
The following warning symbols are used to ensure safety and to prevent human injury and/or damage to
property when using the system.
DANGER It indicates a hazardous situation which, if not avoided, will result in death or serious injury.
WARNING It indicates a hazardous situation which, if not avoided, could result in death or serious injury.
CAUTION It indicates a hazardous situation which, if not avoided, could result in minor or moderate injury.
It indicates a situation which, if not avoided, could result in product damage as well as property
NOTICE
damage.
Important It indicates cautions and limitations that must be followed during operation.
2
Notation
Unless otherwise noted, the examples in this manual illustrate the use of properties, methods, event
notifications, and source code according to Visual Basic conventions.
Additionally, the following notation is also used where necessary.
Notation Description
Private Sub, True, Long Keywords unique to Visual Basic are in bold.
Connect Strings that should be typed as is are in bold.
filename, varlist Settings, arguments, and other items that should be replaced
with the applicable item are in italics.
object The object keyword refers to an object type of the CVX
Control.
[expressionlist] Optional items that can be omitted are surrounded by square
brackets [ ].
MyString = "Hello, world!" Source code examples are in this font.
General Cautions
DANGER Do not use this product for the purpose of protecting the human body or any part thereof.
• Before starting or operating the system, check to make sure all system functions are working
properly.
CAUTION
• If any Keyence product fails, take all safety precautions to prevent damage before using the system
again.
• If the system is operated beyond its published specifications or if the system is modified, its
functions and performance cannot be guaranteed.
NOTICE
• Please note that when the system is used in combination with other instruments, its functions and
performance may be degraded.
Cautions
• This software is designed to be used by personnel familiar with the CV-X Series Controller, and ActiveX
programming experience using Windows and its corresponding development language.
• For information on developing Windows applications that use ActiveX controls, refer to documentation
from Microsoft Corporation (US) and commercially available literature.
• This software does not support calling an API from multiple threads.
Please call the API from a single thread only.
Trademarks
• Windows Vista, Visual Basic, Visual C++ and Visual C# are registered trademarks of Microsoft
Corporation (US).
• Intel and Intel Core are trademarks of Intel Corporation in the United States and other countries.
• ActiveX is the trademark of the Microsoft Corporation, U.S.A. in the United States and/or other
countries.
• "SD Memory Card" is a registered trademark of the SD Association.
• "QR Code" is the registered trademark of DENSO WAVE INCORPORATED.
Other company names and product names noted in this document are registered trademarks or
trademarks of their respective companies. The TM mark and ® mark have been omitted in this manual.
234GB 3
Software License Agreement
NOTICE TO USER: PLEASE READ THIS SOFTWARE LICENSE AGREEMENT ("THIS AGREEMENT")
CAREFULLY. BY USING ALL OR ANY PORTION OF THE CV-X Series ActiveX Control ("THIS
SOFTWARE"), YOU ARE AGREEING TO BE BOUND BY ALL THE TERMS AND CONDITONS OF THIS
AGREEMENT. IF YOU DO NOT AGREE TO THE TERMS OF THIS AGREEMENT, DO NOT USE THIS
SOFTWARE.
If you install, copy and or use all or a portion of this Software on a device or computer, you will be
deemed to have agreed to all the terms of this Agreement, and this Agreement will come into effect.
1. Definitions
1.1 "Use" or "using" refers to the accessing, installing, downloading, copying, operating and or
otherwise benefiting from the utilization of this Software.
1.2 "This Software" denotes the software and all associated documentation provided by KEYENCE.
1.3 "User" or "User's" infers the company or persons who have had the license to use this Software
granted to them by KEYENCE.
2. Grant of License.
2.1 In compliance with all of the terms and conditions of this Agreement, KEYENCE grants the non-
exclusive and non-transferable license to install and use this Software.
2.2 The granting of the license permits the single reproduction and or copying of this Software for the
User's backing up or archiving purposes.
2.3. This Software maybe installed on multiple devices and computers for the User's benefit and use.
2.4. The transfer of this Software via devices and computers with this Software installed on them by the
User to third parties is permitted. In such a case, the third party who receives this Software may
continue to use this Software in the same manner as the previous User.
2.5. With the transfer of this Software to a third party, the original User may install this Software to
additional devices and computers for further use as required. In such a case, the third party who
receives this Software may continue to use this Software in the same manner as the previous User.
2.6. The User maintains and guarantees that any thirdparties (as detailed in the previous two sections)
who receive and use this Software agree to this license Agreement and comply with all the terms
and conditions.
3. Restrictions.
3.1. This Software may not be modified by the User in any form except from the installation of updates or
new functions provided by KEYENCE.
3.2. The reverse engineering, decompiling or disassembling of this Software by any persons are not
permitted.
3.3. Without the prior permission of KEYENCE, the User may not reproduce or copy this Software for
selling or distributing to a third party
6. Termination.
6.1 Under this Agreement the User's license will automatically terminate if this Software and any
associated copies of this Software are destroyed or voluntarily returned to KEYENCE.
6.2 Under this Agreement the User's license will terminate immediately and automatically without any
notice from KEYENCE if there is any failure to comply with any of the terms and conditions of this
Agreement. Upon termination, the using of this Software shall cease, and all copies (full or partial)
of this Software should be destroyed or returned to KEYENCE.
6.3 Compensation will be sought by KEYENCE should any violation or breach of this Agreement result
in any incurred costs or lost profit to KEYENCE.
7. Governing Law.
7.1 This Agreement will be governed by and construed in accordance with the substantive laws of
Japan.
7.2 If any part of this Agreement is found void and unenforceable, the rest of this Agreement will remain
intact, valid and enforceable according to the associated terms and conditions.
Introduction
Related manuals ..................................................................................................... 2
Symbols .................................................................................................................. 2
Notation ................................................................................................................... 3
General Cautions .................................................................................................... 3
Cautions .................................................................................................................. 3
Trademarks ............................................................................................................. 3
2. Development Steps
2.1. Installing/Uninstalling the ActiveX Control............................................................. 17
2.1.1. Installing the ActiveX Control .................................................................. 17
2.1.2. Uninstalling the ActiveX Control.............................................................. 17
2.2. Loading the CVX Control into the Development Environment .............................. 18
2.3. Place the Control on a form................................................................................... 18
3. API List
3.1. Properties List ....................................................................................................... 20
3.2. Methods List .......................................................................................................... 21
3.3. Events List............................................................................................................. 22
Typical Applications
12.Non-communication Functions
12.1.Reading the Version Number of the CVX Control .............................................. 121
12.2.Adjusting the Position and Size of the CVX Control........................................... 121
12.3.Hiding the Control............................................................................................... 121
12.4.Mouse and Keyboard Event Driven Processing ................................................. 122
12.4.1. Mouse events...................................................................................... 122
12.4.2. Keyboard events ................................................................................. 122
12.5.API Reference .................................................................................................... 123
12.5.1. Version property.................................................................................. 123
Appendix
Error Codes ......................................................................................................... 126
Illegal Characters ................................................................................................ 127
1. Illegal characters for folder names ........................................................ 127
2. Illegal characters for file names ............................................................ 127
Limitations When Using Multiple CVX Controls Simultaneously ......................... 128
1. Remote desktop.................................................................................... 128
2. Results logging, Image logging ............................................................. 129
3. Other Communication Functions (Archived Image Data Transfers, File
Transfers, Non-procedural Commands) ............................................... 130
(1) Operation
Ethernet
PC Program
(2) Processing (4) Result
request notification
API
Properties, Properties,
methods events
CVX Control
(3) Communication,
synchronized operation
Figure 1.1 Typical System Configuration
(1) Users operate the PC Program through dialogs and the command line.
(2) The PC Program makes processing requests to the CVX Control through the API (application
programming interface).
• The API for the CVX Control consists of properties, methods, and events.
• The PC program makes processing requests by setting properties and calling methods.
• Processing and status results are notified to the PC program through events and property values.
(3) The CVX Control works in conjunction with the CV-X Series Controller through a communication link.
(4) The CVX Control notifies processing results to the PC program using the API.
This manual explains the properties, methods, events, and operating specifications of the CVX Control.
CVXCTL.ocx
Before your program can use the CVX Control, the control must be registered in the Windows registry.
See "2.1. Installing/Uninstalling the ActiveX Control" (Page 17) for details on registering the control to the
registry.
• The CVX Control requires a personal computer that meets the following conditions.
Runtime • CPU: Intel® Core™2 Duo 2 GHz or higher processor
environment • RAM: 2 MB or higher
• Available hard disk space: 100 MB or more (additional hard disk space required for
saving received data)
• Communication port: Ethernet interface
• Users should apply Microsoft Visual C++ 2005 redistributable package (x86) SP1
vcredist_x86.exe.
Point An error occurs if you try to add a new function only available in newer versions of the CVX
Control, or place the control on a form for a project developed for an older version.
To resolve this issue, read the article at the URL shown below. (Article in English only. URL current
as of October 2016.)
http://support.microsoft.com/kb/818220/en-us/
• Functions added to newer versions cannot be used in older versions. Therefore, PC programs that use
functions added in newer versions of the CVX Control will not function with an older version of the CVX
Control.
X Development Steps
The following are the steps for developing programs that
APIList use the CVX Control.
(1) Register the CVX Control in the registry.
(2) Launch the Visual Basic development environment
and load the CVX Control to make it available in the
project.
(3) Place the CVX control on a form.
(4) Program your application according to the application
requirements.
2. Development Steps
User support page (user registration and login required)
http://www.keyence.com/special/download/cvx_activex.php
(2) Double-click the downloaded file.
The installer launches and extracts the installation files, and the language select screen appears.
(3) Select the language of the ActiveX Control to be installed, an click [OK].
The [Welcome] screen of the installation wizard appears.
See "Software License Agreement" (Page 4) for details on the user license agreement.
Reference
(5) Select [I accept the terms in the License Agreement], and then click [Next].
The screen in which the installation destination is selected appears.
(6) Proceed to the next operation according to the instructions on the screen.
(7) When the [Installation Complete] screen appears, click [Finish].
Installation of the ActiveX Control is now complete.
When the control has been directly registered in the register without the installer
(1) Check the folder path including the CVXCTL.ocx file.
(2) Execute the following command from the command line (/u option).
REGSVR32 /u [folder path]\CVXCTL.ocx
Point The command must be executed by a user with System Administrator privileges.
You can also display this dialog box by right-clicking on the Toolbox and selecting [Select Item]
Reference
from the shortcut menu.
(3) Locate the [COM Components] tab and place a check in the [CVX Control], then click [OK].
The CVX Control icon is added to the Toolbox.
Point • The control is shown as a black rectangle but during runtime, it changes to the controller's monitor
screen when the remote desktop function is activated.
• You can reposition the control and change the control's size by using the mouse or property
settings. You can also hide the control if the remote desktop function is not being used.
• Up to eight controls can be placed on a single application. Connect each control to a separate
controller in order to communicate with multiple controllers simultaneously.
• See "12. Non-communication Functions" (Page 120) for more details on the CVX Control's position,
Reference
size, and non-display settings.
• See "Limitations When Using Multiple CVX Controls Simultaneously" (Page 128) for limitations that
apply when communicating from multiple CVX Controls.
Development Steps
3. API List
X API List
*1 A later version of the controller is required for some functions. For details, see the explanation for each property.
Properties that have an asterisk or that are not included in the list are standard ActiveX controls.
For further details, read the technical literature from Microsoft Corporation.
3. API List
version
Initialization Initialize 1.0 Initializes the communication function (Page 36).
Connect/ Connect 1.0 Connects to the controller (Page 37).
Disconnect Disconnect 1.0 Disconnects from the controller (Page 38).
Remote StartRemoteDesktop 1.0 Starts the remote desktop (Page 51).
desktop StopRemoteDesktop 1.0 Stops the remote desktop (Page 52).
UpdateRemoteDesktop 1.0 Updates the remote desktop (Page 53).
CaptureRemoteDesktop 1.0 Saves an image of the remote desktop to a file (Page 54).
ClearRemoteDesktop 1.0 Clears the remote desktop screen (Page 55).
Result StartResultLog 2.0 Starts result logging (Page 65).
logging StopResultLog 2.0 Stops result logging (Page 66).
UpdateResultLogData 2.0 Specifies the target for acquiring result data output
(Page 67).
GetResultLogData 2.0 Retrieves result data output (Page 68).
Image StartImageLog 1.0 Starts image logging (Page 76).
logging StopImageLog 1.0 Stops image logging (Page 77).
Archived GetArchivedImageList 1.0 Retrieves an information list of archived image data
image data (Page 86).
acquisition GetArchivedImageInfo 1.0 Retrieves information from the archived image data list
(Page 87).
GetArchivedImage 1.0*1 Retrieves archived image data (Page 88).
File GetInspectList 2.0 Retrieves an information list of inspection data (Page
information 94).
acquisition GetInspectInfo 2.0 Retrieves information from the inspection data list (Page
95).
GetDictionaryList 2.0 Retrieves an information list of library data (Page 96).
GetDictionaryInfo 2.0 Retrieves information from the library list (Page 97).
File transfer/ GetFileList 2.0 Retrieves the information list for files (Page 104).
File deletion GetFileInfo 2.0 Retrieves information from the file list (Page 105).
DownloadFile 2.0 Downloads a file (Page 106).
UploadFile 2.0 Uploads a file (Page 107).
DeleteFile 2.0 Deletes a file (Page 110).
Non- ExecuteCommand 2.0 Executes non-procedural commands. (Synchronous)
procedural ExecuteCommandAsync 2.0 Executes non-procedural commands. (Asynchronous)
commands
*1 A later version of the controller is required for some functions. For details, see the explanation for each method.
Methods not included in the list are standard ActiveX control functions.
For further details, read the technical literature from Microsoft Corporation.
Events that have an asterisk or that are not included in the list are standard ActiveX controls.
For further details, read the technical literature from Microsoft Corporation.
The events listed in this manual as "click", "mouse button (or keyboard) press", or "mouse button (or
Reference
keyboard) release" are defined as follows.
• Click: Press followed by the release of a mouse button.
• Mouse button (or keyboard) press: This is the act of pressing (but not releasing) the mouse button
(or keyboard key).
• Mouse button (or keyboard) release: This is the act of releasing the mouse button (or keyboard key).
Preparations
This chapter explains steps (2), (3), and (5), which are the common procedures for using the
communication functions.
The functions in Step (4) will be explained in chapter 5 and beyond.
Related items
Initialize method (Page 36)
Procedures
(1) Call the Initialize method.
Point Before you connect to the CV-X controller, make sure to set the IP address and port number (for
connections with PC programs) in the controller's global settings, then turn the power on and connect it
to the network.
Related items
Address property (Page 33), Port property (Page 34), Connect method (Page 37), Connected
property (Page 35)
Procedures
(1) Set the Address property and Port property.
(2) Call the Connect method.
Related items
Disconnect method (Page 38), Connected property (Page 35)
Procedures
(1) Call the Disconnect method.
PC Program
CVX Control
If the Connect method is called to connect to another controller when the control is already connected to
a controller, the call will fail (1003 illegal operation error). To connect to another controller, disconnect the
controller that is currently connected first.
To connect to multiple controllers simultaneously, use several CVX Controls as described below and
connect each control to a single controller.
• Place multiple CVX Controls on a single application, or
• Launch multiple instances of an application embedded with a single CVX Control.
PC1
CVX Control 1
PC2
PC Program 2
CVX Control 2
If multiple instances of an application embedded with the CVX Control connect to the same controller
(from the same PC), the most recent connection takes priority. All earlier connections are disconnected.
PC Program 1
CVX Control 1
PC Program 2
(1) PC Program 1 connection succeeds
CVX Control 2 (2) PC Program 2 connection succeeds
(3) PC Program 1 connection disconnects
Figure 4-3. Connecting to the same controller from multiple instances on the same PC
If multiple CVX Controls on the same application connect to the same controller (from the same PC), the
first connection has priority, and all later connections will fail.
PC Program 1
CVX Control 1
Figure 4-4. Connecting to the same controller from multiple controls on the same application
PC Program
CVX Control
Supports concurrent
connections
Figure 4-5. Concurrent Connections with the CV-X Series Simulation-Software and
CV-X Series Terminal-Software
Point Although the controller will maintain concurrent connections, it may not be able to service logging and
other communication functions simultaneously.
See "Limitations When Using Multiple CVX Controls Simultaneously" (Page 128) for limitations that
apply when running these functions from multiple PCs.
This section describes the cause of each error, how the API reacts, and troubleshooting.
• The cause of an error and the error code notified by each method and/or event will differ according
Reference
to the function used. See the API reference on each function for more details on errors.
• See "Error Codes" (Page 126) for a complete list of error codes.
When a communication exception occurs, the CVX Control performs the following actions depending on
the timing of the error.
(1) If the communication exception occurs after calling a method but before the return value
notification, the method's return value will be error code 1100 (communication exception).
(2) If the communication exception occurs while waiting for a process completed event, the event
status code will be error code 1100 (communication exception).
Point • When a communication exception occurs, the connection with the controller is disconnected.
• If an error notification from the API is detected as described above, reconnect to the controller using
the Connect method.
When an execution error occurs, the CVX Control performs the following actions depending on the timing
of the error. The execution error code notified will be a value other than 1100 (communication exception).
(1) If the execution error occurs after calling a method but before the return value notification,
the error code in the return value will identify the error.
(2) If the execution error occurs while waiting for a processing completed event,
the error code in the event status will identify the error.
Point • When an execution error occurs, the method or event handler that caused the error is void.
• The API can still be used because the connection to the controller is maintained.
Function
Sets the IP address of the target CV-X Series Controller as a text string.
• The value can also be read.
• This property is referenced when the Connect method (Page 37) is called.
Syntax
object.Address [ = string ]
Data type
String
Arguments
Initial value
The initial state of this property is null. Be sure to set this property before connecting to the controller.
Related items
Connect method (Page 37)
Function
Sets the port number of the target CV-X Series Controller.
• The value can also be read.
• This property is referenced when the Connect method (Page 37) is called.
See "4.3. Connecting to the Controller" (Page 26) for more details on the use of this property.
Reference
Syntax
object.Port [ = port ]
Data type
Integer
Arguments
Initial value
8502
Related items
Connect method (Page 37)
Function
Indicates the connection status with the controller.
• The value is read-only.
• This property is updated when the communication status changes due to calling the Connect/
Disconnect methods, or when an error occurs.
Point • If the Ethernet cable is unplugged when the connection status is True, the property will not
immediately reflect False.
Syntax
object.Connected
Data type
Boolean
Arguments
Initial value
False
Related items
Connect method (Page 37), Disconnect method (Page 38)
Function
Initializes the communication function of the CVX Control.
• Call this method after launching the application, before using the communication functions.
• The method will fail if sufficient memory cannot be allocated.
• If this method fails, subsequent calls will also fail.
The application must be restarted.
See "4.2. Initializing the Communication Function" (Page 25) for more details on the use of this
Reference
property.
Syntax
object.Initialize() As Integer
Arguments
None
Return value
0 Processing succeeded
1001 Processing failed Failed to allocate sufficient memory.
Related items
None
Function
Connects to the CV-X Series Controller.
• The Address property (Page 33) and Port property (Page 34) must be set beforehand.
• The connection status will be reflected in Connected property (Page 35).
See "4.3. Connecting to the Controller" (Page 26) for more details on the use of this property.
Reference
Syntax
Arguments
None
Return value
0 Processing succeeded
1001 Processing failed Communication functions are not initialized.
Controller does not exist at the destination.
Failed to connect to the specified port.
Communication failure due to a fault in the
communication path.
1002 Illegal argument Incorrect format used for Address and/or Port properties.
1003 Illegal operation A connection to the controller already exists.
Related items
Address property (Page 33), Port property (Page 34), Connected property (Page 35)
Function
Disconnects from the currently connected controller.
• Be sure to disconnect the link before exiting the application.
• The connection status will be reflected in Connected property (Page 35).
See "4.4. Disconnecting From the Controller" (Page 27) for more details on the use of this property.
Reference
Syntax
object.Disconnect ()
Arguments
None
Return value
None
Related items
Connected property (Page 35)
Typical Applications
Issuing Non-Procedural
Commands
Non-communication Functions
Point • If the CV-X controller screen updates very frequently, the communication load due to screen
transfers will increase and may cause update delays.
Point • Although this mode does not reflect all changes on the controller screen, it does allows you to
manage the communication load by controlling the calling frequency of the UpdateRemoteDesktop
method.
• By updating the Remote Desktop less often, you can lessen the impact on the updating speed of the
controller screen.
Procedures
Connect to the controller. (See "4.3. Connecting to the Controller" (Page 26)).
(1) Specify the Auto Update Mode and call StartRemoteDesktop method (Page 51).
When the screen update completes, the OnRemoteDesktopUpdated event (Page 56) occurs.
Procedures
Connect to the controller. (See "4.3. Connecting to the Controller" (Page 26)).
(1) Specify the Manual Update Mode and call StartRemoteDesktop method (Page 51).
(2) Call the UpdateRemoteDesktop method (Page 53).
The controller sends the monitor screen which updates the Remote Desktop.
Procedures
This procedure assumes the Remote Desktop has been started using the StartRemoteDesktop
method (See "5.2. Operating in Auto Update Mode" (Page 42) and "5.3. Operating in Manual Update
Mode" (Page 43)).
(1) Call the StopRemoteDesktop method.
If you call StopRemoteDesktop while waiting for the OnRemoteDesktopUpdated event (in the case
Related items
StartRemoteDesktop method (Page 51), EnableRemoteMouseOperation property (Page 50)
Procedures
(1) Enable remote mouse operation by setting the EnableRemoteMouseOperation property (Page
50).
Remote mouse operation is not dependent on the Remote Desktop operating mode (Auto or
Manual).
(2) Start the Remote Desktop by calling the StartRemoteDesktop method (Page 51).
Screen operation with the mouse is enabled at this time.
Procedures
(1) Call the CaptureRemoteDesktop method.
Procedures
(1) Call the ClearRemoteDesktop method.
The screen shown on the CVX Control is initialized (to a black screen), regardless of the status of
the connection with the controller, or Remote Desktop.
Function
Indicates the operating status of the Remote Desktop function (read-only).
This property is updated when the StartRemoteDesktop method (Page 51) and StopRemoteDesktop
method (Page 52) are called to start and stop the Remote Desktop.
Syntax
Data type
Boolean
Arguments
Initial value
False
Related items
StartRemoteDesktop method (Page 51), StopRemoteDesktop method (Page 52)
Function
Toggles mouse operation between enable and disable. (The value can also be read.)
Specifying True enables screen operation via mouse.
• See "5.5. Operating the Controller via the Mouse" (Page 46) for more details on the use of this
Reference
feature.
Syntax
object.EnableRemoteMouseOperation [ = enable ]
Data type
Boolean
Arguments
Initial value
False
Related items
None
Function
Starts the Remote Desktop function.
The operating status will be reflected in RemoteDesktopStarted property (Page 49).
Point • If Auto Update Mode has been specified, screen transfers will begin. The
OnRemoteDesktopUpdated event (Page 56) is notified each time the screen update
completes.
• No screen data is transferred if the Manual Update Mode is specified. Transfer the screen data
by calling the UpdateRemoteDesktop method (Page 53).
• The remote desktop function cannot start if the VNC client is connected to the controller.
Syntax
object.StartRemoteDesktop(ByVal mode As Short) As Integer
Arguments
mode Specify the operating mode for the Remote Desktop function.
0: Auto Update Mode
1: Manual Update Mode
Return value
0 Processing succeeded
1001 Processing failed Communication functions are not initialized.
The controller is not connected.
1002 Illegal argument Argument value is out of range.
1003 Illegal operation The Remote Desktop is already running.
1100 Communication Communication failure due to a fault in the
exceptions communication path.
Related items
OnRemoteDesktopUpdated event (Page 56), RemoteDesktopStarted property (Page 49)
Function
Stops the Remote Desktop function.
The operating status will be reflected in RemoteDesktopStarted property (Page 49).
See "5.4. Stopping the Remote Desktop" (Page 45) for more details on the use of this property.
Reference
Syntax
object.StopRemoteDesktop() As Integer
Arguments
None
Return value
0 Processing succeeded
1001 Processing failed Communication functions are not initialized.
The controller is not connected.
1003 Illegal operation The Remote Desktop is not running.
A screen update triggered by the UpdateRemoteDesktop
method is still in progress (waiting for the
OnRemoteDesktopUpdated event).
1100 Communication Communication failure due to a fault in the
exceptions communication path.
Related items
RemoteDesktopStarted property (Page 49)
Function
Retrieves the monitor screen of the controller and updates the Remote Desktop screen.
The OnRemoteDesktopUpdated event (Page 56) is notified when the screen update completes.
Point This method functions only if Remote Desktop was started in Manual Update Mode by calling the
StartRemoteDesktop method (Page 51).
See "5.3. Operating in Manual Update Mode" (Page 43) for more details on the use of this feature.
Reference
Syntax
Arguments
None
Return value
0 Processing succeeded
1001 Processing failed Communication functions are not initialized.
The controller is not connected.
1003 Illegal operation The Remote Desktop is not running.
The Remote Desktop is running in Auto Update Mode.
A screen update triggered by the UpdateRemoteDesktop
method is still in progress (waiting for the
OnRemoteDesktopUpdated event).
1100 Communication Communication failure due to a fault in the
exceptions communication path.
Related items
StartRemoteDesktop method (Page 51), OnRemoteDesktopUpdated event (Page 56)
Function
Saves the contents of the currently displayed Remote Desktop as a bitmap image file.
The file is saved as a 24-bit color bitmap file and the size is 1024 x 768 pixels.
Point • This method can be executed regardless of the status of the connection with the controller, or
the Remote Desktop.
• If a file already exists it will be overwritten (or an error will occur if the file is set to read-only).
See "5.6. Saving an Image of the Remote Desktop Screen to a File" (Page 47) for more details on
Reference
the use of this property.
Syntax
object.CaptureRemoteDesktop (ByVal dstFile As String) As Integer
Arguments
dstFile Specify the full path to the destination for the bitmap image file.
Enter up to 255 characters.
Specify "bmp" as the extension (the CVX Control does not check extensions).
For characters that cannot be used in file names, see "Illegal Characters" (Page
127).
Return value
0 Processing succeeded
1001 Processing failed File save failed.
1002 Illegal argument Illegal number of characters in path (NULL or exceeded
maximum character count).
Illegal file naming format.
1004 Out of space Not enough disk space available.
Related items
None
Function
Initializes the currently displayed Remote Desktop screen (to a black screen).
Point This method can be executed regardless of the status of the connection with the controller, or the
Remote Desktop.
See "5.7. Clearing the Remote Desktop Screen" (Page 48) for more details on the use of this
Reference
property.
Syntax
object.ClearRemoteDesktop()
Return value
None
Related items
None
Function
This event occurs when the screen update of the Remote Desktop is completed.
Point • In Auto Update Mode, this event is sent each time the controller screen is transferred after
calling the StartRemoteDesktop method (Page 51).
• In Manual Update Mode, this event is sent when the screen transfer is completed as a result of
calling the UpdateRemoteDesktop method (Page 53).
See "5.2. Operating in Auto Update Mode" (Page 42) and "5.3. Operating in Manual Update Mode"
Reference
(Page 43) for more details on the use of this feature.
Syntax
Private Sub object_OnRemoteDesktopUpdated(ByVal sender As Object, _
ByVal e As _
AxCVXLib._DCVXEvents-OnRemoteDesktopUpdatedEvent) _
Handles object.OnRemoteDesktopUpdated
Arguments
Processing result
0 Processing succeeded
1100 Communication Communication failure due to a fault in the
exceptions communication path.
Related items
StartRemoteDesktop method (Page 51), UpdateRemoteDesktop method (Page 53)
X Receiving Results Data Output • The logged data can be saved as a file on the PC.
• The results are retrieved as text and numerical data
which can be used as feed back for display or control
Receiving Image Data Output
purposes.
Non-communication Functions
Procedures
Connect to the controller. (Refer to "4.3. Connecting to the Controller" (Page 26)).
(1) Notify the controller to start logging results.
Specify the operating mode (whether to save to a file) and the base folder these files should be
saved in. Call the StartResultLog method to notify the controller to start logging results.
(2) From this point on, the controller outputs data as set in "PC Program" in the Output Settings.
The timing of the data outputs comes at the end of the program flow.
(3) The OnResultLogDataReceived event occurs each time data is received. The processing result
and program setting number can be obtained from this event.
PC
Related items
UpdateResultLogData method (Page 67), GetResultLogData method (Page 68)
Procedures
Start results logging. (Refer to "6.1. To Start Receiving Results Data Output" (Page 58)).
(1) Update data to be retrieved.
Calling the UpdateResultLogData method designates the most recent data, which was received
by the results logging function, for retrieval.
(2) Retrieve the received data.
Specify the items in the Output Item Settings and call the GetResultLogData method to retrieve
the corresponding items in the received data.
PC
PC Program
CVX Control
…
Receiving data
from controller
The arguments for the GetResultLogData method, itemNo, arrayNo, and memberNo, must be set
according to the output settings. This is illustrated below.
To retrieve the value of [Cluster Count. 5th Blob Area Result], set
To retrieve the value of [Cluster Count. 18th Blob Major Axis Angle Result], set
Procedures
Start results logging. (Refer to "6.1. To Start Receiving Results Data Output" (Page 58)).
(1) Call the StopResultLog method.
(2) When results logging stops, the OnResultLogStopped event occurs.
Point If data is being received when the StopResultLog method is called, results logging will stop after
one measurement count's worth of data is received.
Function
Indicates the operating status of the results logging function (read-only).
This property is updated when the StartResultLog method (Page 65) and OnResultLogDataReceived
event (Page 69) are called to start and stop result logging.
Point Even if results logging stops automatically due to a processing error in the
OnResultLogDataReceived event, this property will be updated.
Syntax
object.ResultLogStarted
Data type
Boolean
Arguments
Initial value
False
Related items
StartResultLog method (Page 65), OnResultLogDataReceived event (Page 69)
Function
Starts the result logging function.
The operating status will be reflected in ResultLogStarted property (Page 64).
The OnResultLogDataReceived event (Page 69) will notify you when results data output has been
received.
Point The received data can be saved to a file depending on how the data is to be used.
• Refer to "6.1. To Start Receiving Results Data Output" (Page 58) for more details on the use of
Reference
this feature.
• Refer to "Limitations When Using Multiple CVX Controls Simultaneously" (Page 128) for
limitations that apply when using this function from multiple CVX Controls.
Arguments
Return value
0 Processing succeeded
1001 Processing failed Communication functions are not initialized.
The controller is not connected.
The controller is already logging results to another PC
Program.
1002 Illegal argument Illegal number of characters in folder name (NULL or
exceeded maximum character count).
Illegal folder naming format.
1003 Illegal operation Results logging is already in progress.
1100 Communication Communication failure due to a fault in the
exceptions communication path.
Related items
OnResultLogDataReceived event (Page 69), ResultLogStarted property (Page 64)
Function
Stops the result logging function.
This method only posts a request. The OnResultLogStopped event (Page 70) notifies when result
logging has stopped.
Refer to "6.3. To Stop Receiving Results Data Output" (Page 63) for more details on the use of this
Reference
feature.
Syntax
object.StopResultLog() As Integer
Arguments
None
Return value
0 Processing succeeded
1001 Processing failed Communication functions are not initialized.
The controller is not connected.
1003 Illegal operation Results logging has not been started.
1100 Communication Communication failure due to a fault in the
exceptions communication path.
Related items
When results logging stops, the OnResultLogStopped event (Page 70) occurs.
Function
Sets aside the most recent data that will be the target when GetResultLogData method calls for data
retrieval.
Refer to "6.2. Retrieving Results Data Output" (Page 60) for more details on the use of this feature.
Reference
Syntax
object.UpdateResultLogData As Integer
Arguments
None
0 Processing succeeded
1001 Processing failed Communication functions are not initialized.
1003 Illegal operation Logging has not been started.
1009 No target data Target data not found.
Related items
GetResultLogData method (Page 68)
Function
Retrieves the most recently received results data.
This method retrieves data as text strings and numerical data specified in the Output Item Settings
by specifying four indexes.
Point The target data for retrieving must be designated beforehand with the UpdateResultLogData
method.
Refer to "6.2. Retrieving Results Data Output" (Page 60) for more details on the use of this feature.
Reference
Syntax
object.GetResultLogData(ByVal itemNo As Integer, _
ByVal arrayNo As Integer, ByVal memberNo As Integer, _
ByRef text As String, ByRef data As Double) As Integer
Arguments
itemNo Specify the output item number specified in output settings (0 to 255).
arrayNo Specify the array number in the output items. (Specify the position from the first
array starting at 0.)
Specify 0 if no arrays were set in the output items.
memberNo Specify the member number of the output item (0 to 5).
Specify 0 when there is no member.
Ouput item
Member Position/ Plane type Robot coordinates
Date Position
number Angle information XYZRz XYZRxRyRz
0 Year X X X inclination X X
1 Month Y Y Y inclination Y Y
2 Day - Angle Z slices Z Z
3 Hour - - - Rz Rx
4 Minute - - - - Ry
5 Second - - - - Rz
text Contains a string of up to 255 characters formatted as specified in the output settings.
Contains null (empty) if the method fails.
data Contains the numeric data in the output.
Set with -1 if the method fails or if the output contains only text string data.
Return value
0 Processing succeeded
1001 Processing failed Communication functions are not initialized.
1002 Illegal argument Number of output item, array, or member is out of range.
1003 Illegal operation Logging has not been started.
The target data for retrieval has not been specified.
Specify it with the UpdateResultLogData.
1009 No target data No target data
Related items
UpdateResultLogData method (Page 67)
Function
Occurs each time the control receives data from the controller.
The event notifies the program setting number and destination file name of the received data.
Point If the processing result in this event is an error, results logging stops automatically.
Refer to "6.1. To Start Receiving Results Data Output" (Page 58) for more details on the use of this
Reference
feature.
Syntax
Private Sub object_OnResultLogDataReceived (ByVal sender As Object, _
ByVal e As AxCVXLib._DCVXEvents_OnResultLogDataReceivedEvent) _
Arguments
Processing result
0 Processing succeeded
1001 Processing failed Access to the destination file failed.
1004 Out of space Not enough memory space at destination.
1100 Communication Communication failure due to a fault in the
exceptions communication path.
Related items
StartResultLog method (Page 65)
Function
Occurs when the results logging stops as a result of the StopResultLog method.
Refer to "6.3. To Stop Receiving Results Data Output" (Page 63) for more details on the use of this
Reference
feature.
Syntax
Private Sub object_OnResultLogStopped (ByVal sender As Object, _
ByVal e As AxCVXLib._DCVXEvents_OnResultLogStoppedEvent) _
Handles object.OnResultLogStopped
Arguments
Processing result
0 Processing succeeded
1100 Communication Communication failure due to a fault in the
exceptions communication path.
Related items
StopResultLog method (Page 66), ResultLogStarted property (Page 64)
Issuing Non-Procedural
Commands
Non-communication Functions
Procedures
Connect to the controller. (Refer to "4.3. Connecting to the Controller" (Page 26)).
(1) Notify the controller to start logging images.
Specify the base folder where these files should be saved in. Call the StartImageLog method to
notify the controller to start logging images.
(2) From this point on, the controller outputs image data.
The timing of the data outputs is at the end of the flow.
(3) The OnImageLogDataReceived event occurs each time data is received from the controller. The
processing result and program setting number can be obtained from this event.
PC
Procedures
Start image logging. (Refer toe "7.1. To Start Receiving Image Output Data" (Page 72)).
(1) Call the StopImageLog method.
(2) When image logging stops, the OnImageLogStopped event occurs.
Point If data is being received when the StopImageLog method is called, image logging will stop after
one measurement count's worth of data is received.
Function
Indicates the operating status of the image logging function (read-only).
This property is updated when the StartImageLog method (Page 76) and OnImageLogStopped
event (Page 79) are called to start and stop image logging.
Point Even if image logging stops automatically due to a processing error in the
OnImageLogDataReceived event, this property will be updated.
Syntax
object.ImageLogStarted
Arguments
Initial value
False
Related items
StartImageLog method (Page 76), OnImageLogStopped event (Page 79)
Function
Starts the image logging function.
The operating status will be reflected in ImageLogStarted property (Page 75).
The OnImageLogDataReceived event (Page 78) will notify you when image data output has been
received.
• Refer to "7.1. To Start Receiving Image Output Data" (Page 72) for more details on the use of
Reference
this feature.
• Refer to "Limitations When Using Multiple CVX Controls Simultaneously" (Page 128) for
limitations that apply when using this function from multiple CVX Controls.
Syntax
object.StartImageLog (ByVal folder As String) As Integer
Arguments
folder Specify the full path of the destination for the received data file.
Folder SD2 is created under this base folder, and the file is created according to
the file naming rule.
Enter up to 255 characters.
For those characters that cannot be used in folder names, see "Illegal Characters"
(Page 127).
Return value
0 Processing succeeded
1001 Processing failed Communication functions are not initialized.
The controller is not connected.
The controller is already logging images to another PC
Program.
1002 Illegal argument Illegal number of characters in file name (NULL or
exceeded maximum character count).
Illegal folder naming format.
1003 Illegal operation Image logging is already in progress.
1100 Communication Communication failure due to a fault in the
exceptions communication path.
Related items
OnImageLogDataReceived event (Page 78), ImageLogStarted property (Page 75)
Function
Stops the image logging function.
This method only posts a request. The OnImageLogStopped event (Page 79) notifies when image
logging has stopped.
Refer to "7.2. To Stop Receiving Image Output Data" (Page 74) for more details on the use of this
Reference
feature.
Syntax
object.StopImageLog() As Integer
Arguments
None
Return value
Related items
When image logging stops, the OnImageLogStopped event (Page 79) occurs.
Function
Occurs each time the control receives image output data from the controller.
The event notifies the program setting number and destination file name of the received data.
Point If the processing result in this event is an error, image logging stops automatically.
Refer to "7.1. To Start Receiving Image Output Data" (Page 72) for more details on the use of this
Reference
feature.
Syntax
Private Sub object_OnImageLogDataReceived (ByVal sender As Object, _
ByVal e As AxCVXLib._DCVXEvents_OnImageLogDataReceivedEvent) _
Handles object.OnImageLogDataReceived
Arguments
state Contains the processing result. See "Processing result" for details.
driveNo Contains the SD card number.
Set with -1 if retrieval fails.
1:SD1
2: SD2
settingNo Contains the current program setting number (0 to 999).
Set with -1 if retrieval fails.
conditionType Specify the Archive condition number 0 or 1.
0: Latest Archive
1: Total NG Archive
prcCount Contains the measurement count that was output.
Set with -1 if retrieval fails.
Processing result
0 Processing succeeded
1001 Processing failed Access to the destination file failed.
1004 Out of space Not enough memory space at destination.
1100 Communication Communication failure due to a fault in the
exceptions communication path.
Related items
StartImageLog method (Page 76)
Function
Occurs when image logging stops as a result of the StopImageLog method (Page 77).
Refer to "7.2. To Stop Receiving Image Output Data" (Page 74) for more details on the use of this
Reference
feature.
Syntax
Private Sub object_OnImageLogStopped (ByVal sender As Object, _
ByVal e As AxCVXLib._DCVXEvents_OnImageLogStoppedEvent) _
Handles object.OnImageLogStopped
Arguments
Processing result
0 Processing succeeded
1100 Communication Communication failure due to a fault in the
exceptions communication path.
Related items
StopImageLog method (Page 77), ImageLogStarted property (Page 75)
Receiving Results Data Output on archived image data stored in the controller.
• Users can retrieve stored image data and save them to
a file.
Receiving Image Data Output
• This function allows developers to create an application
that retrieves and displays the information list of
X Retrieving Archived Image Data
archived image data currently stored in the controller.
Users can select the desired measurement count and
Retrieving Information of retrieve the corresponding data.
Setting Files
• In order to use this function, users must
Point
understand the archive function.
Sending/Receiving/Deleting For details on the archive function, see the
Related items
GetArchivedImageList method (Page 86), GetArchivedImageInfo method (Page 87)
Procedures
Connect to the controller. (Refer to "4.3. Connecting to the Controller" (Page 26)).
(1) Transfer the information list for archived image data.
Calling the GetArchivedImageList method transfers the information list for the archived image
data stored in the controller's internal memory and obtains the number of items in the list.
(2) Call the GetArchivedImageInfo method to retrieve data for each item in the list transferred in (1).
Specify the index for the list items and call the number of list items in a loop.
PC Program
Information list
Figure 9-1. Retrieving the information list for archived image data
Related items
GetArchivedImage method (Page 88), OnArchivedImageTransferred event (Page 90)
Procedures
Connect to the controller. (Refer to "4.3. Connecting to the Controller" (Page 26)).
(1) Start transferring image data.
Call the GetArchivedImage method. The data transfer will start.
(2) When the data transfer is complete, the OnArchivedImageTransferred event occurs.
The processing results and type of data transferred is notified through an event.
PC
Figure 9-2. Transferring archived image data (image and results data)
When the data transfer is complete, a message box appears showing the results of the transfer.
Function
Indicates the operating status of the archived image data retrieval function (GetArchivedImage
method (Page 88)) (read-only).
This property is updated when the GetArchivedImage method is called, and when the
OnArchivedImageTransferred event (Page 90) is notified.
Syntax
object.ArchivedImageTransferBusy
Data type
Boolean
Arguments
Initial value
False
Related items
GetArchivedImage method (Page 88), OnArchivedImageTransferred event (Page 90)
Function
Retrieves the number of information lists available for archived image data stored in the controller for
the specified archive conditions.
Point • Use GetArchivedImageInfo method (Page 87) to retrieve information about each list item.
• If the controller is not in online Run mode, or the controller or another PC Program is accessing
the archived image data, an error will occur.
• Refer to "8.1. Retrieving History Lists" (Page 81) for more details on the use of this feature.
Reference
• Refer to "Limitations When Using Multiple CVX Controls Simultaneously" (Page 128) for
limitations that apply when using this function from multiple CVX Controls.
Syntax
object.GetArchivedImageList(ByVal conditionNo As Integer, ByRef num As Integer) As Integer
Arguments
Return value
0 Processing succeeded
1001 Processing failed Communication functions are not initialized.
The controller is not connected.
Another PC program (CVX Control) is accessing the
archived image data.
1003 Illegal operation The controller is not in Online Run mode.
Retrieving archived image data (GetArchivedImage).
1006 Processing in progress The controller is accessing archived image data.
(Image Archive dialog, Statistics dialog, Non-procedural
command)
1100 Communication Communication failure due to a fault in the
exceptions communication path.
Related items
GetArchivedImageInfo method (Page 87)
Function
Retrieves the data for each list item (measurement count) from the archived image data information
list obtained with the GetArchivedImageList method (Page 86).
Refer to "8.1. Retrieving History Lists" (Page 81) for more details on the use of this feature.
Reference
Syntax
object.GetArchivedImageInfo(ByVal index As Integer, ByRef prcCount As Integer, _
ByRef date As Date, ByRef isSavedDrive As Integer, _
ByRef isSavedComm As Integer) As Integer
Arguments
Return value
0 Processing succeeded
1002 Illegal argument List number is out of range.
1003 Illegal operation All GetArchivedImageList methods have failed.
Related items
GetArchivedImageList method (Page 86)
Function
Retrieves image data stored in the controller and saves it to a file in the user-selected file format of
JPEG or bitmap (with compression ratio).
This method only posts a request. An event is notified when the operation is completed.
The operating status will be reflected in ArchivedImageTransferBusy property (Page 85).
• Refer to "8.2. Retrieving Archived Image Data" (Page 83) for more details on the use of this
Reference
feature.
• Refer to "Limitations When Using Multiple CVX Controls Simultaneously" (Page 128) for
limitations that apply when using this function from multiple CVX Controls.
• The LumiTrax mode is supported on controller firmware versions 3.1.0000 or later.
• The multi-spectral mode is supported on controller firmware versions 4.1.0000 or later.
Syntax
object.GetArchivedImage(ByVal conditionNo As Integer, ByVal prcCount As Integer,
ByVal cameraNo As Integer, ByVal captureNo As Integer, ByVal lightingNo As Integer,
ByVal dstFile As String, ByVal format As Integer) As Integer
Arguments
Return value
0 Processing succeeded
1001 Processing failed Communication functions are not initialized.
The controller is not connected.
Another PC program (CVX Control) is accessing the
archived image data.
The destination drive is read-only.
1002 Illegal argument Archive condition number or measurement count or
camera number is out of range.
Illegal number of characters in file name (NULL or
exceeded maximum character count).
Illegal file naming format.
1003 Illegal operation The controller is not in Online Run mode.
Retrieving archived image data (includes other CVX
Controls) (GetArchivedImage).
1006 Processing in progress The controller is accessing archived image data.
(Image Archive dialog, Statistics dialog, Non-procedural
command)
1009 No target data No archived image data found.
1100 Communication Communication failure due to a fault in the
exceptions communication path.
Related items
When processing is completed, the OnArchivedImageTransferred event (Page 90) occurs.
Event results
0 Processing succeeded
1001 Processing failed Access to the destination file failed.
Not enough memory space at destination.
1100 Communication Communication failure due to a fault in the
exceptions communication path.
Function
Occurs when archived image data transfer {GetArchivedImage method (Page 88)} is completed.
Point This event is common for multiple methods. To distinguish which method the event refers to, check
the arguments.
See "8.2. Retrieving Archived Image Data" (Page 83) for more details on the use of this feature.
Reference
Syntax
Private Sub object_OnArchivedImageTransferred(ByVal sender As Object, _
ByVal e As AxCVXLib._DCVXEvents_OnArchivedImageTransferredEvent) _
Handles object.OnArchivedImageTransferred
Arguments
Processing result
0 Processing succeeded
For details on errors, see the [Event results] for each method.
Related items
GetArchivedImage method (Page 88), ArchivedImageTransferBusy property (Page 85)
Receiving Results Data Output • In order to use the functions in this chapter,
Point
users must understand exactly what settings
Receiving Image Data Output files are.
For details on the various settings files, refer to
the related manuals.
Retrieving Archived Image Data • The communication link must be setup before
you can use the functions in this chapter.
X Retrieving Information of Read "4. Common Settings for Communications"
(Page 24) to initialize communication functions
Setting Files and connect to the controller.
• Refer to "Limitations When Using Multiple CVX
Sending/Receiving/Deleting Controls Simultaneously" (Page 128) for
limitations that apply when using this function
Files
from multiple CVX Controls.
• When uploading files, the firmware version of
Issuing Non-Procedural
Non-communication Functions
Related items
GetInspectList method (Page 94), GetInspectInfo method (Page 95), GetDictionaryList method
(Page 96) and GetDictionaryInfo method (Page 97).
Procedures
Connect to the controller. (Refer to "4.3. Connecting to the Controller" (Page 26)).
(1) Transfer the information list for program settings.
Calling the GetInspectList method transfers the list for the program setting files stored on the SD
card in the controller and allows retrieval of the number of items in the list.
(2) Call the GetInspectInfo method to retrieve the data for each item in the list transferred in (1).
Specify the index of the list item and call this method in a loop for the number of items in the list.
PC
PC Program
Information list
Function
Retrieves a list of information on program setting data from the controller.
To retrieve information for each item in the list, use the GetInspectInfo method (Page 95).
• Refer to "9.1.1. Retrieving Information Lists" (Page 92) for more details on the use of this feature.
Reference
• Refer to "Limitations When Using Multiple CVX Controls Simultaneously" (Page 128) for
limitations that apply when using this function from multiple CVX Controls.
Syntax
object.GetInspectList(ByRef num As Integer) As Integer
Arguments
Return value
0 Processing
succeeded
1001 Processing failed Communication functions are not initialized.
The controller is not connected.
1003 Illegal operation Settings file upload/download in progress (including other
ActiveX controls)
(download/upload of any type).
1100 Communication Communication failure due to a fault in the communication
exceptions path.
Related items
GetInspectInfo method (Page 95)
Function
Retrieves data from the program settings information list retrieved with the GetInspectList method
(Page 94).
Refer to "9.1.1. Retrieving Information Lists" (Page 92) for more details on the use of this feature.
Reference
Syntax
object.GetInspectInfo(ByVal index As Integer,
ByVal languageId As Integer, ByRef driveNo As Integer, _
ByRef settingNo As Integer ByRef name As String) As Integer
Arguments
Return value
0 Processing succeeded
1002 Illegal argument List number is out of range.
1003 Illegal operation All calls to the GetInspectList method (Page 94) have
failed.
Related items
GetInspectList method (Page 94)
Function
Retrieves a numbered list of library files from the controller.
To retrieve information in the list, use the GetDictionaryInfo method (Page 97).
Refer to "Limitations When Using Multiple CVX Controls Simultaneously" (Page 128) for limitations
Reference
that apply when using this function from multiple CVX Controls.
Syntax
object.GetDictionaryList(ByRef num As Integer) As Integer
Arguments
Return value
0 Processing
succeeded
1001 Processing failed Communication functions are not initialized.
The controller is not connected.
1003 Illegal operation Settings file upload/download in progress (including other
ActiveX controls).
(download/upload of any type).
1100 Communication Communication failure due to a fault in the communication
exceptions path.
Related items
GetDictionaryInfo method (Page 97)
Function
Retrieves data from the library settings number list retrieved with the GetDictionaryList method (Page
96).
Syntax
object.GetDictionaryInfo(ByVal index As Integer, ByRef dicNo As Integer) As Integer
Arguments
Return value
0 Processing
succeeded
1002 Illegal argument List number is out of range.
1003 Illegal operation All calls to the GetDictionaryList method (Page 96) have
Related items
GetDictionaryList method (Page 96)
Receiving Results Data Output • Hereinafter, the act of transferring files on the controller's
SD card to the PC will be referred to as "downloading",
and from the PC to the SD card as "uploading".
Receiving Image Data Output
• The API allows you to verify which files to send/receive
by retrieving a list of files in a specified folder on the SD
Retrieving Archived Image Data
card in the controller.
• For example, developers can create an application that
Retrieving Information of retrieves and displays this list allowing users to select
Setting Files the actual file to download/upload.
• The controller can send/receive data files (program
X Sending/Receiving/Deleting settings, registered images, library settings, global
settings, learning data) which are required to perform
Files
inspections.
• Files specified by the controller can be deleted.
Issuing Non-Procedural
Commands Point
• The communication link must be setup before
you can use the functions in this chapter. Read
"4. Common Settings for Communications"
Non-communication Functions (Page 24) to initialize communication functions
and connect to the controller.
• Refer to "Limitations When Using Multiple CVX
Controls Simultaneously" (Page 128) for
limitations that apply when using this function
from multiple CVX Controls.
Related items
GetFileList method (Page 104), GetFileInfo method (Page 105)
Procedures
Connect to the controller. (Refer to "4.3. Connecting to the Controller" (Page 26)).
(1) Transfer the file list.
Specify the folder on the SD card in the controller, and then call the GetFileList method to transfer
the list for the files in the folder and allow retrieval of the number of items in the list.
(2) Call the GetFileInfo method to retrieve the data for each item in the list transferred in (1).
Specify the index of the list item and call this method in a loop for the number of items in the list.
PC
Information list
The locations and file names where the setting data files are stored are as follows.
Reference
Related items
DownloadFile method (Page 106), UploadFile method (Page 107), OnFileTransferred event (Page 109)
Procedures
Connect to the controller. (Refer to "4.3. Connecting to the Controller" (Page 26)).
(1) Start downloading (or uploading).
Specify the file name at the source and destination, then call the DownloadFile method (or
UploadFile method) to start the file transfer.
(2) When the file transfer is complete, the OnFileTransferred event occurs.
The event notifies the processing results and type of transfer performed.
The second subroutine starts transferring the file "UL_sample_src.txt" on the PC when the
Bn_UploadFile button is clicked. The file will be named "UL_sample_dst.txt" at the destination (SD
card in the controller).
srcFile = “SD2:\cv-x\DL_sample_src.txt”
'downloading starts
dstFile = “C:\cv-x\DL_sample_dst.txt”
state = CVX.DownloadFile(srcFile, dstFile)
srcFile = “C:\cv-x\UL_sample_src.txt”
'uploading starts
dstFile = “SD2:\cv-x\UL_sample_dst.txt”
state = CVX.UploadFile(srcFile, dstFile)
Function
Indicates whether the file transfer (DownloadFile method (Page 106), UploadFile method (Page 107))
is in progress (read-only).
This property is updated when the file retrieval method is called, and when the OnFileTransferred
event (Page 109) is notified.
Syntax
object.FileTransferBusy
Data type
Boolean
Arguments
Initial value
False
Function
Retrieves the number of lists sent by the controller. These lists provide information on the folders and
files under the user-specified folder.
Retrieve the data for each folder and file by calling the GetFileInfo method (Page 105).
Point • This method can retrieve up to 1,000 lists (in random order).
• The list contains the current directory ".".
• If an SD card drive (SD1, SD2) or a USB HDD is specified, the list will contain the volume label
if one has been assigned.
• Refer to "10.1. Retrieving a File List" (Page 99) for more details on the use of this feature.
Reference
• Refer to "Limitations When Using Multiple CVX Controls Simultaneously" (Page 128) for
limitations that apply when using this function from multiple CVX Controls.
Syntax
object.GetFileList(ByVal folder As String, ByRef num As Integer) As Integer
Arguments
folder Specify the full path to the folder the list is to be retrieved for.
Specify the drive name as "SD1:\", "SD2:\" or "USB:\".
Enter up to 255 characters.
num Contains the number of file lists that were retrieved (0 to 1000).
Set to -1 if retrieval fails.
Return value
0 Processing
succeeded
1001 Processing failed Communication functions are not initialized.
The controller is not connected.
1002 Illegal argument Illegal number of characters in folder name (NULL or
exceeded maximum character count).
1003 Illegal operation File upload/download in progress (all forms of uploads/
downloads including those handled by other ActiveX
controls)
1007 Not available The SD card has not been inserted or the USB HDD has not
been connected.
1009 No target data The specified folder does not exist.
1100 Communication Communication failure due to a fault in the communication
exceptions path.
Related items
GetFileInfo method (Page 105)
Function
Retrieves the data for each list item (folder or file) from the file information list retrieved with the
GetFileList method (Page 104).
Refer to "10.1. Retrieving a File List" (Page 99) for more details on the use of this feature.
Reference
Syntax
object.GetFileInfo(ByVal index As Integer, ByRef name As String, _
ByRef kind As Short, ByRef attribute As Integer, _
ByRef date As Date, ByRef size As Long) As Long
Arguments
Return value
0 Processing
succeeded
1002 Illegal argument List number is out of range.
1003 Illegal operation All calls to the GetFileList method (Page 104) have failed.
Related items
GetFileList method (Page 104)
Function
Downloads a file from the SD card or USB HDD in the controller.
This method only posts a request. An event is notified when the operation is completed.
The operating status will be reflected in FileTransferBusy property (Page 103).
• Refer to "10.2. Sending/Receiving Files" (Page 101) for more details on the use of this feature.
Reference
• Refer to "Limitations When Using Multiple CVX Controls Simultaneously" (Page 128) for
limitations that apply when using this function from multiple CVX Controls.
Syntax
object.DownloadFile(ByVal srcFile As String, ByVal dstFile As String) As Integer
Arguments
srcFile Specify the full path of the file name at the source (on the controller).
Specify the drive name as "SD1:\", "SD2:\" or "USB:\".
Enter up to 255 characters.
dstFile Specify the full path of the file name at the destination (on the PC).
Enter up to 255 characters.
Return value
0 Processing
succeeded
1001 Processing failed Communication functions are not initialized.
The controller is not connected.
The destination drive is read-only.
Not enough memory space at destination.
A folder with the specified file name already exists.
The SD card is being accessed by another communication
function.
1002 Illegal argument Illegal number of characters in file name (NULL or
exceeded maximum character count).
Illegal file naming format.
1003 Illegal operation File upload/download in progress (all forms of uploads/
downloads including those handled by other ActiveX controls)
1007 Not available The SD card has not been inserted or the USB HDD has not
been connected.
1009 No target data File does not exist at the source.
1100 Communication Communication failure due to a fault in the communication
exceptions path.
Related items
When processing is completed, the OnFileTransferred event (Page 109) occurs.
Event results
0 Processing
succeeded
1001 Processing failed Access to the destination file failed.
1004 Out of space Not enough available space at destination.
1100 Communication Communication failure due to a fault in the communication
exceptions path.
Function
Uploads a file to the SD card or USB HDD in the controller.
• This method only posts a request. An event is notified when the operation is completed.
• The operating status will be reflected in FileTransferBusy property (Page 103).
• Refer to "10.2. Sending/Receiving Files" (Page 101) for more details on the use of this feature.
Reference
• Refer to "Limitations When Using Multiple CVX Controls Simultaneously" (Page 128) for
limitations that apply when using this function from multiple CVX Controls.
Syntax
object.UploadFile(ByVal srcFile As String, ByVal dstFile As String) As Integer
Arguments
srcFile Specify the full path of the file name at the source (on the PC).
Enter up to 255 characters.
dstFile Specify the full path of the file name at the destination (on the controller).
Specify the drive name as "SD1:\", "SD2:\" or "USB:\".
Enter up to 255 characters.
For characters that cannot be used in file names, refer to "Illegal Characters" (Page 127).
0 Processing
succeeded
1001 Processing failed Communication functions are not initialized.
The controller is not connected.
A folder with the specified file name already exists.
The destination drive is read-only.
The SD card is being accessed by another communication
function.
1002 Illegal argument Illegal number of characters in file name (NULL or
exceeded maximum character count).
Illegal file naming format.
1003 Illegal operation File upload/download in progress (all forms of uploads/
downloads including those handled by other ActiveX
controls)
1007 Not available The SD card has not been inserted or the USB HDD has not
been connected.
1009 No target data File does not exist at the source.
1100 Communication Communication failure due to a fault in the communication
exceptions path.
Related items
When processing is completed, the OnFileTransferred event (Page 109) occurs.
Event results
0 Processing
succeeded
1001 Processing failed Access to the destination file failed.
1004 Out of space Not enough space on the SD card or USB HDD.
1100 Communication Communication failure due to a fault in the communication
exceptions path.
Function
This event occurs when the file transfer (DownloadFile method (Page 106), UploadFile method (Page
107)) is completed.
Point This event is common for multiple methods. To distinguish which method the event refers to, check
the arguments.
Refer to "10.2. Sending/Receiving Files" (Page 101) for more details on the use of this feature.
Reference
Syntax
Private Sub object_OnFileTransferred (ByVal sender As Object, _
ByVal e As AxCVXLib._DCVXEvents_OnFileTransferredEvent) _
Handles object.OnFileTransferred
Arguments
Processing result
0 Processing succeeded
For details on errors, refer to the [Event results] for each method.
Related items
DownloadFile method (Page 106), UploadFile method (Page 107), FileTransferBusy property (Page
103)
10.3.7.DeleteFile method
Function
Deletes files from the controller's SD card or USB HDD.
When an empty folder is specified, folder deletion is also possible.
Syntax
object.DeleteFile(ByVal dstFile As String) As Integer
Argument
dstFile Specify the full pathname of the file to be deleted.Up to 255 characters can be
entered.
Specify "SD1:\", "SD2:\" or "USB:\" for the drive name.
For characters that cannot be used in file names, refer to "Illegal Characters" in
"Appendix".
Return value
0 Processing succeeded
1001 Processing failed Communication functions are not initialized.
The controller is not connected.
The destination drive is read-only.
Another communication function is accessing the memory
card of the controller.
1002 Illegal argument The number of the characters of the file name is out of
range. (Null or exceeding maximum character count)
1007 Unavailable The SD card has not been inserted or the USB HDD has not
been connected.
1009 No target data The specified file for deletion does not exist.
1100 Communication exceptions Communication failure due to a fault in the communication
path.
Event results
0 Processing succeeded
1001 Processing failed Access to the destination file failed.
1100 Communication exceptions Communication failure due to a fault in the communication
path.
Receiving Results Data Output • The non-procedural commands are a set of useful
functions that allow users to control and send/retrieve
data and status results from the connected CV-X
Receiving Image Data Output
controller.
• Refer to the following pages for details on the use of each of these methods.
Reference
• The following commands take a while to be executed. Therefore, ExecuteCommandAsync method
is recommended to execute them.
• Save Program SS
• Change programs PW
• Image Registration BS
• Save statistical data TS
• Save archived image HS
• Image capture BC
Procedures
Connect to the controller. (Refer to "4.3. Connecting to the Controller" (Page 26)).
(1) Call the ExecuteCommand method.
(2) The following code retrieves the execution result from the return value.
Procedures
Connect to the controller. (Refer to "4.3. Connecting to the Controller" (Page 26)).
(1) Call the ExecuteCommandAsync method and send the non-procedural command (BC).
(2) When the command is executed and the response is received, the OnCommandFinished event
occurs.
The OnCommandFinished event is common for all asynchronous methods.
The event notifies the processing results and type of command.
Upon receiving the command response, the code displays a message box showing the result and
type of transfer performed.
Point • Errors caused by a non-procedural command will have a value of (2000 + error code for the
non-procedural command).
• For details on non-procedural command error causes, refer to the related manuals.
11.3.1.CommandBusy property
Function
Indicates whether an asynchronous method is in progress (read-only).
This property is updated when an asynchronous method is called, and when the
OnCommandFinished event (Page 119) is notified.
Syntax
object.CommandBusy
Data type
Boolean
Arguments
Initial value
False
Related items
OnCommandFinished event (Page 119)
11.3.2.ExecuteCommand method
Function
Executes the specified non-procedural command.
This method always receives a response whether the command executes successfully or not.
• Refer to "11.1.1. Executing synchronous methods" (Page 112) for more details on the use of this
Reference
feature.
• The controller version must support the target non-procedural command in order to execute
this method.
Syntax
object.ExecuteCommand(ByVal command As String, _
ByRef response As String) As Integer
Arguments
Return value
0 Processing
Related items
None
11.3.3.ExecuteCommandAsync method
Function
Executes the specified non-procedural command.
All commands will be executed asynchronously.
Syntax
object.ExecuteCommandAsync(ByVal command As String) As Integer
Argument
Return value
0 Processing succeeded
1001 Processing failed Communication functions are not initialized.
The controller is not connected.
1002 The number of the characters of the command is out of range. (Null or exceeding the
maximum character count)
2022 Argument error According to the specifications of the non-procedural commands.
2003 Execution error According to the specifications of the non-procedural commands.
Related items
When the CommandBusy property and execution are completed, the OnCommandFinished event
occurs.
11.3.4.OnCommandFinished event
Function
Occurs when the asynchronous function that makes use of the non-procedural command service is
completed.
• This event is common for multiple methods. To distinguish which method the event refers to,
Reference
check the arguments.
• Refer to "11.1.2. Executing asynchronous methods" (Page 114) for more details on the use of
this feature.
Syntax
Private Sub object_OnCommandFinished (ByVal sender As Object, _
ByVal e As AxCVXLib._DCVXEvents_OnCommandFinishedEvent) _
Handles object.OnCommandFinished
Arguments
state Contains the processing result. Refer to "Processing result" for details.
command Contains the command assigned by ExecuteCommandAsync.
Event results
0 Processing succeeded
For details on errors, refer to the [Event results] for each method.
Retrieving Information of
Setting Files
Sending/Receiving/Deleting
Files
Issuing Non-Procedural
Commands
X Non-communication Functions
For technical details on properties, read the technical literature from Microsoft Corporation.
Reference
For technical details on properties, refer to the technical literature from Microsoft Corporation.
Reference
12.4.1.Mouse events
Button press
MouseDownEvent event
Button release
MouseUpEvent event
Click
ClickEvent event
Double click
DblClick event
Move
MouseMoveEvent event
12.4.2.Keyboard events
Key press:
KeyDownEvent event
Key release:
KeyUpEvent event
• For technical details on properties, refer to the technical literature from Microsoft Corporation.
Reference
12.5.1.Version property
Function
Indicates the version of the CVX Control (read-only).
Syntax
object.Version
Data type
String
Arguments
string Contains the version of the CVX Control as a text string delimited by periods.
(Example: "1.0")
Initial value
Version of CVX Control (fixed value)
Related items
None
Appendix
Error Codes
If an error occurs while a function is executing, the CVX Control will identify the error in the method's
return value or in the event status. The following list shows the errors notified by the CVX Control.
*1 These error codes can occur for different reasons depending on the function.
See the method and event definitions for details on errors that can occur for each function.
*2 If a communication exception (1100) occurs, the connection is disconnected.
Reconnect to the controller.
*3 Errors caused by a non-procedural command will have a value of (2000 + error code for the non-procedural
command).
Point The use of a period or space as a single text string is also not allowed.
1. Remote desktop
No limitations apply when executing the remote desktop function from multiple CVX Controls at the same
time.
In the example shown below, both CVX Controls can execute the remote desktop function at the same
time.
PC1
PC Program 1
CVX Control 1
(1)
PC2
(2)
PC Program 2
(1) PC Program 1 connection succeeds
CVX Control 2 (2) PC Program 2 connection succeeds
Point Controller screen updates may be delayed because the controller has to transfer screens to each control.
Multiple CVX Controls placed on the same application form can be used to execute separate controllers.
PC Program
CVX Control 1
(1)
CVX Control 2
(2)
Point The same limitation that applies to the CVX Control also applies to the CV-X Series Terminal-Software
which can log results and images.
Only one logging function can be used for a single controller at one time.
If the logging start method (StartResultLog method, etc.) is called while logging is already in progress,
the return value will notify error code 1001 (Processing failed error).
PC1
PC Program 1
CVX Control 1
(1)
PC2
(2)
PC Program 2
(1) PC Program 1 results logging start succeeds
CVX Control 2 (2) PC Program 2 results logging start fails
Multiple CVX Controls placed on the same application form can be used to execute separate controllers
similar to operation with the remote desktop function.
PC Program
CVX Control 1
(1)
CVX Control 2
(2)
As with the logging function, only one communication function can be used for a single controller at one
time.
If another communication function (DownloadFile method, etc.) is called while a communication function
is already in progress, the return value will notify error code 1001 (CV-H1X Processing failed error).
PC1
PC Program 1
CVX Control 1
(1)
PC2
(2)
PC Program 2
(1) PC Program 1 settings data transfer
CVX Control 2 succeeds
(2) PC Program 2 settings data transfer fails
Unlike the remote desktop function and logging functions, a single application with multiple CVX Controls
can only execute one communication function at a time, even if each control is linked to a separate
controller.
If another communication function (UploadFile method, etc.) is called while a communication function is
already in progress, the return value will notify error code 1003 (Illegal operation error).
PC Program
CVX Control 1
(1)
CVX Control 2
(2)
Revision History
(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 models 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, coldness, 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 AFFILIATED 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.
E 1101-3
Specifications are subject to change without notice.
KEYENCE CORPORATION
1-3-14, Higashi-Nakajima, Higashi-Yodogawa-ku, Osaka, 533-8555, Japan PHONE: +81-6-6379-2211 www.keyence.com
AUSTRIA FRANCE ITALY POLAND TAIWAN
Phone: +43 22 36-3782 66-0 Phone: +33 1 56 37 78 00 Phone: +39-02-6688220 Phone: +48 71 36861 60 Phone: +886-2-2721-8080
BELGIUM GERMANY KOREA ROMANIA THAILAND
Phone: +32 1 528 1222 Phone: +49 6102 36 89-0 Phone: +82-31-789-4300 Phone: +40 269-232-808 Phone: +66-2-369-2777
BRAZIL HONG KONG MALAYSIA SINGAPORE UK & IRELAND
Phone: +55-11-3045-4011 Phone: +852-3104-1010 Phone: +60-3-7883-2211 Phone: +65-6392-1011 Phone: +44-1908-696900
CANADA HUNGARY MEXICO SLOVAKIA USA
Phone: +1-905-366-7655 Phone: +36 1 802 73 60 Phone: +52-55-8850-0100 Phone: +421 2 5939 6461 Phone: +1-201-930-0100
CHINA INDIA NETHERLANDS SLOVENIA VIETNAM
Phone: +86-21-3357-1001 Phone: +91-44-4963-0900 Phone: +31 40 20 66 100 Phone: +386 1-4701-666 Phone: +84-4-3772-5555
CZECH REPUBLIC INDONESIA PHILIPPINES SWITZERLAND
Phone: +420 222 191 483 Phone: +62-21-2966-0120 Phone: +63-(0)2-981-5000 Phone: +41 43-45577 30
A4WW1-MAN-1037
Copyright (c) 2015 KEYENCE CORPORATION. All rights reserved. 124271E 1067-8 234GB Printed in Japan