KEYENCE LJ-V7000 User Manual

376GB
LJ-V7000 Series Communication Library
Reference Manual
Please read this manual before use.
After reading this manual, store it in a safe place where it can be used at any time.

Contents

1 Software License Agreement.................................................................................................................. 5
3 Operating Environment ........................................................................................................................... 6
4 USB Driver ................................................................................................................................................ 6
5 File Structure............................................................................................................................................ 6
6 Incorporating the Library ........................................................................................................................ 7
6.1 File structure .................................................................................................................................... 7
6.2 Linking ............................................................................................................................................. 7
6.2.1 C++ .................................................................................................................................... 7
6.2.2 C#/VB.NET.......................................................................................................................... 7
7 Types......................................................................................................................................................... 7
8 Constant, Structure Definitions.............................................................................................................. 8
8.1 Constant definitions ......................................................................................................................... 8
8.2 Structure definitions ....................................................................................................................... 11
8.3 Callback function interface definition ............................................................................................ 22
9 Functions................................................................................................................................................ 25
9.1 Function list.................................................................................................................................... 25
9.1.1 Operations for the DLL .....................................................................................................25
9.1.2 Establish/disconnect the communication path with the controller ................................... 25
9.1.3 System control.................................................................................................................. 25
9.1.4 Measurement control........................................................................................................25
9.1.5 Functions related to modifying or reading settings .......................................................... 26
9.1.6 Acquiring measurement results ....................................................................................... 26
9.1.7 Storage function related ...................................................................................................27
9.1.8 High-speed data communication related......................................................................... 27
9.2 Function reference......................................................................................................................... 28
9.2.1 Operations for the DLL .....................................................................................................28
9.2.2 Establish/disconnect the communication path with the controller ................................... 29
9.2.3 System control.................................................................................................................. 29
9.2.4 Measurement control........................................................................................................31
9.2.5 Functions related to modifying or reading settings .......................................................... 33
9.2.6 Acquiring measurement results ....................................................................................... 37
9.2.7 Store function related ....................................................................................................... 41
9.2.8 High-speed data communication related......................................................................... 45
9.2.9 Supplement ...................................................................................................................... 47
10 Common Return Codes ......................................................................................................................... 60
10.1 Return codes returned by the communication library................................................................... 60
10.2 Return codes returned from the controller .................................................................................... 60
11 Sample Program .................................................................................................................................... 61
11.1 User interface specification........................................................................................................... 61
11.2 Save file format .............................................................................................................................. 63
3LJ-V7000_COM_RM_E
376GB
12 Appendix................................................................................................................................................. 65
12.1 Sending/Receiving Settings .......................................................................................................... 65
12.2 Batch sending/receiving................................................................................................................ 65
12.3 Details of Items for Sending/Receiving Settings ........................................................................... 66
12.4 Examples of sending/receiving measurement mode settings....................................................... 86
13 Using the high-speed data communication command ...................................................................... 87
13.1 Preparation for high-speed data communication.......................................................................... 87
13.2 High-speed communication without using the batch setting ........................................................ 88
13.3 High-speed communication using the batch function .................................................................. 89
Revision History............................................................................................................................................ 92
4 LJ-V7000_COM_RM_E

1 Software License Agreement

NOTICE TO USER: PLEASE READ THIS SOFTWARE LICENSE AGREEMENT (THIS “AGREEMENT”)
CAREFULLY. BY USING ALL OR ANY PORTION OF THIS “SOFTWARE”, YOU ARE AGREEING TO BE
BOUND BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO ANY
TERMS OF THIS AGREEMENT, DO NOT USE THIS SOFTWARE.
1. Grant of License.
Conditioned upon compliance with all of the terms and conditions of this Agreement, KEYENCE grants you a
nonexclusive and nontransferable license.
2. Restrictions
Except for installation of updates or new functions provided by KEYENCE, you may not modify or add any
function to this Software.
a) You may not reverse engineer, decompile or disassemble this Software.
b) You may not create derivative works based on this Software.
c) Other than expressly stated by KEYENCE, you may not resell, retransfer, rent or otherwise redistribute this
Software to any third parties. However, you may redistribute this Software with the application that you
developed using this Software.
3. Intellectual Property Rights.
Except as expressly stated herein, KEYENCE reserves all right, title and interest in this Software, and all
associated copyrights, trademarks, and other intellectual property rights therein.
4. Disclaimer.
Keyence is licensing this Software to you “AS IS” and without any warranty of any kind. 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.
5. Support
KEYNCE shall not provide technical support in accordance with this Software including the use of this
Software.
6. Termination.
6.1 Your license under this Agreement will terminate automatically if you destroy this Software and the
copy of this Software in your possession or voluntarily return this Software to us.
6.2 Your license under this Agreement will terminate automatically without any notice from KEYENCE if you
fail to comply with any of the terms and conditions of this Agreement. Promptly upon termination, you
shall cease all use of this Software and destroy all copies, full or partial, of this Software in your
possession or control.
6.3 You will compensate KEYENCE for costs or any lost profits caused by your violation or breach of any
term of this Agreement.
7. Governing Law.
This Agreement will be governed by and construed in accordance with the substantive laws of Japan without
regards to the principles of conflicts of law.
5LJ-V7000_COM_RM_E

2 Introduction

The LJ-V7000 Series communication library provides a communication interface for controlling the LJ-V7000
Series from a user application (Win32 DLL). For specific ways to use the communication library, refer to the
sample program.

3 Operating Environment

Windows 7 (Home Premium/Professional/Ultimate)
OS
CPU Core i3 2.3 GHz or faster
Memory 2 GB or more
Windows Vista (Home Basic/Home Premium/Business/Ultimate)
Windows XP (SP2 or later) (Home Edition/Professional Edition)
Secondary cache memory
Free drive space 10 GB or more
Interface
*1 Operation is not guaranteed with connections via a USB hub
*2 Operation is not guaranteed with connections to a LAN or via a router
2 MB or more
A PC equipped with either of the interfaces below.
*1
USB 2.0/1.1
, Ethernet 1000BASE-T/100BASE-TX
*2

3.1 Execution environment

This section describes the necessary environment to execute applications that use the LJ-V7000 Series
communication library.

3.1.1 Microsoft C runtime library

The Microsoft C runtime library is required for the DLL to operate.
Run vcredist_x86.exe included on the installation media to install the library.

3.1.2 Microsoft .NET Framework

The Microsoft .NET Framework is required to run the sample application.
Run NetFx20SP2_x86.exe included on the installation media to install the library.

4 USB Driver

Install and use LJ-Navigator2 for the USB driver.

5 File Structure

LJV7_IF.dll The DLL.
LJV7_IF.lib The import library for LJV7_IF.dll.
LJV7_ErrorCode.h The header file that defines the error codes.
LJV7_IF.h The header file that defines the LJV7_IF.dll interface.
Source
The folder for the sample source code. The source code for the sample program created in C#.
6 LJ-V7000_COM_RM_E

6 Incorporating the Library

6.1 File structure

The files required at execution are listed below.
Place these folders/files in the same folder as the executable file.
• LJV7_IF.dll

6.2 Linking

6.2.1 C++

6.2.1.1 Linking
The library can be linked implicitly or explicitly.
To implicitly link the library, link with "LJV7_IF.lib".
* "LJV7_IF.lib" was built with Visual C++ 2008 SP1.
6.2.1.2 Include files
Include the following header files in the necessary source files.
• LJV7_IF.h
• LJV7_ErrorCode.h

6.2.2 C#/VB.NET

Call each interface using the DllImport attribute.
When passing a structure as an interface argument, specify the StructLayout attribute and pass a structure
of the same memory structure as the DLL.
For details, refer to the NativeMethods class (NativeMethods.cs) in the sample.
The processing to call each function has been implemented.

7 Types

In this document, variable types are described according to the following definitions.
CHAR Signed 8-bit integer
BYTE Unsigned 8-bit integer
SHORT Signed 16-bit integer
WORD Unsigned 16-bit integer
LONG Signed 32-bit integer
DWORD Unsigned 32-bit integer
FLOAT Single precision floating point number (32 bits)
DOUBLE Double precision floating point number (64 bits)
7LJ-V7000_COM_RM_E

8 Constant, Structure Definitions

8.1 Constant definitions

Name Setting value storage level designation
Typedef enum {
LJV7IF_SETTING_DEPTH_WRITE = 0x00, // Write settings area
Definition
Description
Comment
LJV7IF_SETTING_DEPTH_RUNNING = 0x01, // Running settings area LJV7IF_SETTING_DEPTH_SAVE = 0x02 // Save area
} LJV7IF_SETTING_DEPTH;
This enumeration designates the operation target level in functions that modify or read settings. For details on the setting value storage level, refer to "9.2.9.3 Write processing for settings".
The controller retains three sets of settings data. Those levels are used in the applications below.
Write settings area
Settings that do not affect operation. In order to not allow an error in controller operations from inconsistencies in settings that occur temporarily when changing multiple settings, the operation of the controller can be changed without causing an error by reflecting the settings from this area to the running settings area after writing the settings to this area.
Running settings area
The settings the controller is using in its operation. When the controller starts, this area is initialized with the settings in the save area.
Save area
The settings that are saved even when the controller's power is turned off.
Name Initialization target setting item designation
Typedef enum {
LJV7IF_INIT_SETTING_TARGET_PRG0 = 0x00, // Program 0 LJV7IF_INIT_SETTING_TARGET_PRG1 = 0x01, // Program 1 LJV7IF_INIT_SETTING_TARGET_PRG2 = 0x02, // Program 2 LJV7IF_INIT_SETTING_TARGET_PRG3 = 0x03, // Program 3 LJV7IF_INIT_SETTING_TARGET_PRG4 = 0x04, // Program 4 LJV7IF_INIT_SETTING_TARGET_PRG5 = 0x05, // Program 5 LJV7IF_INIT_SETTING_TARGET_PRG6 = 0x06, // Program 6
Definition
Description
Comment
LJV7IF_INIT_SETTING_TARGET_PRG7 = 0x07, // Program 7 LJV7IF_INIT_SETTING_TARGET_PRG8 = 0x08, // Program 8 LJV7IF_INIT_SETTING_TARGET_PRG9 = 0x09, // Program 9 LJV7IF_INIT_SETTING_TARGET_PRG10 = 0x0A, // Program 10 LJV7IF_INIT_SETTING_TARGET_PRG11 = 0x0B, // Program 11 LJV7IF_INIT_SETTING_TARGET_PRG12 = 0x0C, // Program 12 LJV7IF_INIT_SETTING_TARGET_PRG13 = 0x0D, // Program 13 LJV7IF_INIT_SETTING_TARGET_PRG14 = 0x0E, // Program 14 LJV7IF_INIT_SETTING_TARGET_PRG15 = 0x0F, // Program 15
} LJV7IF_INIT_SETTING_TARGET;
This enumeration designates which settings to initialize in settings initialization function.
-
8 LJ-V7000_COM_RM_E
Name Definition that indicates the validity of a measurement value
Typedef enum {
LJV7IF_MEASURE_DATA_INFO_VALID = 0x00, // Normal measurement data
Definition
LJV7IF_MEASURE_DATA_INFO_ALARM = 0x01, // Measurement alarm data LJV7IF_MEASURE_DATA_INFO_WAIT = 0x02 // Judgment wait data
} LJV7IF_MEASURE_DATA_INFO;
Description
Comment
Name Definition that indicates the tolerance judgment result of the measurement value
Definition
Description
Comment
Name Get profile target buffer designation
Definition
This enumeration indicates the validity or invalidity of the measurement value.
-
Typedef enum {
LJV7IF_JUDGE_RESULT _HI = 0x01, // HI LJV7IF_JUDGE_RESULT _GO = 0x02, // GO LJV7IF_JUDGE_RESULT _LO = 0x04 // LO
} LJV7IF_JUDGE_RESULT;
This enumeration indicates the tolerance judgment result for the measurement value in bit units.
If the measurement value is measurement alarm data, the judgment result is 0x05 (both HI and LO bits are 1).
Typedef enum {
LJV7IF_PROFILE_BANK_ACTIVE = 0x00, // Active surface LJV7IF_PROFILE_BANK_INACTIVE = 0x01 // Inactive surface
} LJV7IF_PROFILE_BANK;
Description
Comment
Name Get profile position specification method designation (batch measurement: off)
Definition
Description
When the memory allocation is "double buffer" in the get profile command, this enumeration designates which surface to get the profiles from.
"Active surface" refers to the surface of the buffer that profile data is being written onto. For further details, refer to "9.2.9.2 Internal memory".
Typedef enum {
LJV7IF_PROFILE_POS_CURRENT = 0x00, // From current LJV7IF_PROFILE_POS_OLDEST = 0x01, // From oldest LJV7IF_PROFILE_POS_SPEC = 0x02, // Specify position
} LJV7IF_PROFILE_POS;
In the get profile command, this enumeration indicates the specification method for the profiles to get out of the profile data retained in the controller. In get profile, the profiles are stored from oldest to newest.
From current
Gets the current profiles. The end of the acquired profiles becomes the current profile.
From oldest
Gets the oldest profile. The head of the acquired profiles becomes the oldest profile.
Specify position
Gets the specified number of profiles from the specified profile position. The head of the acquired profiles becomes the profiles at the specified position.
Comment
For the specified number of profiles, refer to the individual structure definitions.
9LJ-V7000_COM_RM_E
Name Get profile batch data position specification method designation (batch measurement: on)
Typedef enum {
LJV7IF_BATCH_POS_CURRENT = 0x00, // From current LJV7IF_BATCH_POS_SPEC = 0x02, // Specify position
Definition
Description
LJV7IF_BATCH_POS_COMMITED = 0x03, // From current after batch
commitment
LJV7IF_BATCH_POS_CURRENT_ONLY = 0x04 // Current only
} LJV7IF_BATCH_POS;
In the get batch profile command, this enumeration indicates the specification method for the profiles to get in what batch out of the batch data retained in the controller. In get profile, the profiles are stored from oldest to newest.
From current
Gets the profiles in the current batch data.
Specify position
Gets the profiles in the batch data with the specified number.
From current after batch commitment
Gets the profiles in the current batch data after commitment.
Current only
Gets one current profile in the current batch data.
Comment
Name Number of OUT settings
Definition
Description
Comment
Name Number of simultaneously connectable controllers
Definition
Description
Comment
For the specified number of profiles, refer to the individual structure definitions.
Const static LONG LJV7IF_OUT_COUNT = 16;
This constant indicates the number of OUT settings.
-
Const static LONG LJV7IF_DEVICE_COUNT = 6;
This constant is the upper limit for the number of controllers that can simultaneously communicate.
-
10 LJ-V7000_COM_RM_E

8.2 Structure definitions

Name Ethernet settings structure
Typedef struct {
BYTE abyIpAddress[4];
Definition
Description
WORD wPortNo; BYTE reserve[2];
} LJV7IF_ETHERNET_CONFIG;
This structure contains the settings passed during an Ethernet communication connection.
abyIpAddress
The IP address of the controller to connect to. For 192.168.0.1: Set abyIpAddress[0]=192, abyIpAddress[1]=168, and so on.
wPortNo(in)
The port number of the controller to connect to.
Comment
Name Date/time structure
Definition
Description
Comment
-
Typedef struct {
BYTE byYear; BYTE byMonth; BYTE byDay; BYTE byHour; BYTE byMinute; BYTE bySecond; BYTE reserve[2];
} LJV7IF_TIME;
The date/time for the controller.
byYear Year. Set from 0 to 99, which means 2000 to 2099. byMonth Month.1 to 12. byDay Day.1 to 31. byHour Hour.0 to 23. byMinute Minute.0 to 59. bySecond Second.0 to 59.
-
11LJ-V7000_COM_RM_E
Name Setting item designation structure
Typedef struct {
BYTE byType; BYTE byCategory; BYTE byItem;
Definition
BYTE reserve; BYTE byTarget1; BYTE byTarget2; BYTE byTarget3; BYTE byTarget4;
} LJV7IF_TARGET_SETTING;
Information for specifying target setting items.
byType, byCategory, byItem
When modifying or reading a setting, these variables are used to specify the target setting
Description
item.
byTarget1, byTarget2, byTarget3, byTarget4
These variables are used when specifying further details for the setting item. For example, when configuring OUT measurement mode, these are used to specify the OUT number.
Comment
For details, see the appendix.
Name Measurement results structure
Typedef struct {
BYTE byDataInfo;
Definition
BYTE byJudge; BYTE reserve[2]; FLOAT fValue;
} LJV7IF_MEASURE_DATA;
Measurement value and judgment results.
byDatainfo
This variable indicates whether or not the measurement value (fValue) is valid, and if it is not a valid value, what kind of data it is. See LJV7IF_MEASURE_DATA_INFO.
byJudge
Tolerance judgment result. See LJV7IF_JUDGE_RESULT.
Description
fValue
Measurement value. The unit used for measurement values is the minimum display unit set for Target OUT in program settings. When the minimum display unit is 1 mm to 0.001 mm, the measurement value unit is [mm]. When 1 um to 0.1 um, the measurement value unit is [um]. The unit for sectional areas is
2
, and the unit for angles is deg.
mm When not a valid value, a large negative value is stored (-10
10
).
Comment
-
12 LJ-V7000_COM_RM_E
Name Profile information structure
Typedef struct {
BYTE byProfileCnt; BYTE byEnvelope; BYTE reserve[2];
Definition
WORD wProfDataCnt; BYTE reserve2[2]; LONG lXStart; LONG lXPitch;
} LJV7IF_PROFILE_INFO;
Information related to the profile.
byProfileCnt
Wheter dicates the amount of profile data stored. (When 2 head/combine (wide) is off, 2 profile data units is stored, otherwise 1 profile data unit is stored.)
byEnvelope
Description
Whether profile compression (time axis) is on. 0: off, 1: on.
wProfDataCnt
Profile data count (initial setting: 800).
lXStart
1st point X coordinate.
lXPitch
Profile data X direction interval.
Comment
lXStart and lXPitch are stored in 0.01 μm units.
Name Profile header information structure
Typedef struct {
DWORD reserve;
Definition
DWORD dwTriggerCnt; DWORD dwEncoderCnt; DWORD reserve2[3];
} LJV7IF_PROFILE_HEADER;
The header information added to the profile.
reserve
7th bit: Indicates whether the encoder's Z phase has been entered. (*)
Description
㪊㪈
dwTriggerCnt
㪍㪌㪋㪊㪉㪈㪇
Indicates which number trigger from the start of measurements this profile is. (Trigger counter)
dwEncoderCnt
The encoder count when the trigger was issued. (Encoder counter)
Other than when settings are modified or the program is switched, the trigger counter and the encoder counter are reset at the following times.
Comment
• When the memory is cleared in high-speed mode (profile only)
• When laser emission stops and is restarted with the LASER_OFF terminal
• When laser emission is allowed after it was prohibited with the REMOTE terminal
㪙㪪㪣㪙㪪
*: About the Z-phase flag
This flag can be used when the controller is version 3.0 or later. This flag is turned ON when Z-phase ON input is received during the period between the previous trigger input (or the start of measurement if there was no previous trigger input) and the current trigger input.
13LJ-V7000_COM_RM_E
Example: Single phase 1x multiplier encoder trigger with no skipping
A phase ON
Z phase ON
Encoder count Z-phase flag
Note: When the Z-phase input uses a negative logic encoder, set the TRG minimum input time, which is a common measurement
setting, to 7 μs. With negative logic, the Z-phase flag turns ON as shown in the following figure.
A phase ON
Z phase ON
Encoder count Z-phase flag
OFF
OFF
OFF
OFF
1
OFF
1
OFF
2
ON
2
ON
3
ON
3
ON
4
OFF
4
OFF
5
ON
5
OFF
Name Profile footer information structure
Typedef struct {
Definition
DWORD reserve;
} LJV7IF_PROFILE_FOOTER;
Description
The footer information added to the profile.
None (reserved only).
Comment
-
Name High-speed mode get profile request structure (batch measurement: off)
Typedef struct {
BYTE byTargetBank; BYTE byPosMode; BYTE reserve[2];
Definition
DWORD dwGetProfNo; BYTE byGetProfCnt; BYTE byErase; BYTE reserve[2];
} LJV7IF_GET_PROFILE_REQ;
The get profile designation information when the operation mode is "high-speed (profile only)" and batch measurements are off in the get profile command.
byTargetBank
Specifies whether to get the profiles from the active surface or whether to get the profiles from the inactive surface. See LJV7IF_PROFILE_BANK. (P.9)
byPosMode
Specifies the get profile position specification method. See LJV7IF_PROFILE_POS.
Description
dwGetProfNo
When byPosMode is LJV7IF_PROFILE_POS_SPEC, specifies the profile number for the profile to get.
byGetProfCnt
The number of profiles to read.
byErase
Specifies whether or not to erase the profile data that was read and the profile data older than that. 0: Do not erase, 1: erase
Comment
If the communication buffer is insufficient, the number of profiles specified by byGetProfCnt may not be acquired. In this situation, the maximum number of profiles that can be acquired is returned.
14 LJ-V7000_COM_RM_E
Name High-speed mode get profile request structure (batch measurement: on)
Typedef struct {
BYTE byTargetBank; BYTE byPosMode; BYTE reserve[2];
Definition
Description
DWORD dwGetBatchNo; DWORD dwGetProfNo; BYTE byGetProfCnt; BYTE byErase; BYTE reserve[2];
} LJV7IF_GET_BATCH_PROFILE_REQ;
The get profile designation information when the operation mode is "high-speed (profile only)" and batch measurements are on in the get profile command.
byTargetBank
Specifies whether to get the profiles from the active surface or whether to get the profiles from the inactive surface. See LJV7IF_PROFILE_BANK. (P.9)
byPosMode
Specifies the get profile position specification method. See LJV7IF_BATCH_POS.
dwGetBatchNo
When byPosMode is LJV7IF_BATCH_POS_SPEC, specifies the batch number for the profile to get.
dwGetProfNo
Specifies the profile number to start getting profiles from in the specified batch number.
byGetProfCnt
The number of profiles to read.
byErase
Specifies whether or not to erase the batch data that was read and the batch data older than that. 0: Do not erase, 1: erase
Comment
If the communication buffer is insufficient, the number of profiles specified by byGetProfCnt may not be acquired. In this situation, the maximum number of profiles that can be acquired is returned.
15LJ-V7000_COM_RM_E
Name Advanced mode get profile request structure (batch measurement: on)
Typedef struct {
BYTE byPosMode; BYTE reserve[3];
Definition
Description
Comment
DWORD dwGetBatchNo; DWORD dwGetProfNo; BYTE byGetProfCnt; BYTE reserve[3];
} LJV7IF_GET_BATCH_PROFILE_ADVANCE_REQ;
The get profile designation information when the operation mode is "advanced (with OUT measurement)" and batch measurements are on in the get batch profile command.
byPosMode
Specifies the get profile position specification method. See LJV7IF_BATCH_POS.
dwGetBatchNo
When byPosMode is LJV7IF_BATCH_POS_SPEC, specifies the batch number for the profiles to get.
dwGetProfNo
Specifies the profile number for the profiles to get.
byGetProfCnt
The number of profiles to read.
If the communication buffer is insufficient, the number of profiles specified by byGetProfCnt may not be acquired. In this situation, the maximum number of profiles that can be acquired is returned.
Name High-speed mode get profile response structure (batch measurement: off)
Typedef struct {
DWORD dwCurrentProfNo; DWORD dwOldestProfNo;
Definition
Description
Comment
DWORD dwGetTopProfNo; BYTE byGetProfCnt; BYTE reserve[3];
} LJV7IF_GET_PROFILE_RSP;
The profile information returned for the get profiles command when the operation mode is "high-speed (profile only)" and batch measurements are off.
dwCurrentProfNo
The profile number at the current point in time.
dwOldestProfNo
The profile number for the oldest profile held by the controller.
dwGetTopProfNo
The profile number for the oldest profile out of those that were read this time.
byGetProfCnt
The number of profiles that were read this time.
-
16 LJ-V7000_COM_RM_E
Name High-speed mode get profile response structure (batch measurement: on)
Typedef struct {
DWORD dwCurrentBatchNo; DWORD dwCurrentBatchProfCnt; DWORD dwOldestBatchNo; DWORD dwOldestBatchProfCnt;
Definition
Description
DWORD dwGetBatchNo; DWORD dwGetBatchProfCnt; DWORD dwGetBatchTopProfNo; BYTE byGetProfCnt; BYTE byCurrentBatchCommited; BYTE reserve[2];
} LJV7IF_GET_BATCH_PROFILE_RSP;
The profile information returned for the get profiles command when the operation mode is "high-speed (profile only)" and batch measurements are on.
dwCurrentBatchNo
The batch number at the current point in time.
dwCurrentBatchProfCnt
The number of profiles in the newest batch.
dwOldestBatchNo
The batch number for the oldest batch held by the controller.
dwOldestBatchProfCnt
The number of profiles in the oldest batch held by the controller.
dwGetBatchNo
The batch number that was read this time.
dwGetBatchProfCnt
The number of profiles in the batch that was read this time.
dwGetBatchTopProfNo
Indicates what number profile in the batch is the oldest profile out of the profiles that were read this time.
byGetProfCnt
The number of profiles that were read this time.
byCurrentBatchCommited
Indicates if the batch measurements for the newest batch number has finished. 0: Not finished, 1: finished
Comment
-
17LJ-V7000_COM_RM_E
Name Advanced mode get profile response structure (batch measurement: on)
Typedef struct {
DWORD dwGetBatchNo; DWORD dwGetBatchProfCnt;
Definition
Description
DWORD dwGetBatchTopProfNo; BYTE byGetProfCnt; BYTE reserve[3];
} LJV7IF_GET_BATCH_PROFILE_ADVANCE_RSP;
The profile information returned for the get profiles command when the operation mode is "advanced mode (with OUT measurement)" and batch measurements are on.
dwGetBatchNo
The batch number that was read this time.
dwGetBatchProfCnt
The number of profiles in the batch that was read this time.
dwGetBatchTopProfNo
Indicates what number profile in the batch is the oldest profile out of the profiles that were read this time.
byReadProfCnt
The number of profiles that were read this time.
Comment
Name Get storage status request structure
Definition
Description
Comment
Name Get storage status response structure
Definition
-
Typedef struct {
DWORD dwReadArea;
}LJV7IF_GET_ STRAGE_STATUS_REQ;
Get target designation information in the get storage status command.
dwReadArea
The storage surface to read.
• When the memory allocation setting is "double buffer" 0: Active surface, 1: Surface A, 2: Surface B
• When the memory allocation setting is "entire area (overwrite)", fixed as 1
• When the memory allocation setting is "entire area (do not overwrite)" 0: Active surface, surface specification (1 to 999)
"Active surface" refers to the surface of the buffer that profile data is being written onto. For further details, refer to "9.2.9.2 Internal memory".
Typedef struct {
DWORD dwSurfaceCnt; DWORD dwActiveSurface;
} LJV7IF_GET_STRAGE_STATUS_RSP;
Description
Comment
The storage status information returned for the get storage status command.
dwSurfaceCnt
Storage surface count
dwActiveSurface
The active storage surface. When the active program has storage off, 0.
For details about "Storage surface", refer to "9.2.9.2.2 For operation mode: advanced (with OUT measurement)".
18 LJ-V7000_COM_RM_E
Name Storage information structure
Typedef struct {
BYTE byStatus; BYTE byProgramNo;
Definition
Description
BYTE byTarget; BYTE reserve[5]; DWORD dwStorageCnt;
} LJV7IF_ STORAGE_INFO;
Information related to the storage status.
byStatus
Storage status. 0: Empty (Takes on this value when the target surface has not operated even once in a
program with storage on)
1: Storing (only the active storage surface can be 1) 2: Storage complete
byProgramNo
The program number for the relevant storage surface.
byTarget
Storage target.0: Data storage, 2: profile storage, 3: batch profile storage. However, when batch measurements are on and profile compression (time axis) is on, 2: profile storage is stored.
dwStorageCnt
Storage count (batch count when batch is on)
Comment
Name Get storage data request structure
Definition
Description
Comment
For details about "Storage surface", refer to "9.2.9.2.2 For operation mode: advanced (with OUT measurement)".
Typedef struct {
BYTE reserve[4]; DWORD dwSurface; DWORD dwStartNo; DWORD dwDataCnt;
} LJV7IF_GET_STORAGE_REQ;
The get data designation information in the get data storage data command and the get profile storage data command.
dwSurface
Storage surface to read.
dwStartNo
The data number to start reading.
dwDataCnt
The number of items to read.
For details about "Storage surface", refer to "9.2.9.2.2 For operation mode: advanced (with OUT measurement)".
19LJ-V7000_COM_RM_E
Name Get batch profile storage request structure
Typedef struct {
BYTE reserve[4]; DWORD dwSurface;
Definition
Description
DWORD dwGetBatchNo; DWORD dwGetBatchTopProfNo; BYTE byGetProfCnt; BYTE reserved[3];
} LJV7IF_GET_BATCH_PROFILE_STORAGE_REQ;
Get data designation information in the get batch storage data command.
dwSurface
Storage surface to read.
dwGetBatchNo
Batch number to read.
dwGetBatchTopProfNo
Specifies from what profile number in the batch to get the data.
byGetProfCnt
The number of profiles to read.
Comment
Name Get storage data response structure
Definition
Description
Comment
For details about "Storage surface", refer to "9.2.9.2.2 For operation mode: advanced (with OUT measurement)".
Typedef struct {
DWORD dwStartNo; DWORD dwDataCnt; LJV7IF_TIME stBaseTime;
} LJV7IF_GET_STORAGE_RSP;
The get data information returned for the get storage data command and the get profile storage command.
dwStartNo
The data number to start reading.
dwDataCnt
The number of items to read.
stBaseTime
Base time.
For details about base time, refer to "9.2.9.10 Time data added to storage data".
20 LJ-V7000_COM_RM_E
Name Get batch profile storage response structure
Typedef struct {
DWORD dwGetBatchNo; DWORD dwGetBatchProfCnt;
Definition
Description
DWORD dwGetBatchTopProfNo; BYTE byGetProfCnt; BYTE reserve[3]; LJV7IF_TIME stBaseTime;
} LJV7IF_GET_BATCH_PROFILE_STORAGE_RSP;
The get data information returned for the get batch profile storage command.
dwGetBatchNo
The batch number that was read this time.
dwGetBatchProfCnt
The number of profiles in the batch that was read this time.
dwGetBatchTopProfNo
Indicates what number profile in the batch is the oldest profile out of the profiles that were read this time.
byGetProfCnt
The number of profiles that were read this time.
stBaseTime
Base time.
Comment
Name High-speed communication prep start request structure
Definition
Description
Comment
-
Typedef struct {
BYTE bySendPos; BYTE reserve[3];
} LJV7IF_HIGH_SPEED_PRE_START_REQ;
High-speed communication start preparation request command
bySendPos
Send start position. 0: From previous send complete position (from oldest data if 1st time), 1: From oldest data (reacquire), 2: From next data
-
21LJ-V7000_COM_RM_E

8.3 Callback function interface definition

void (*pCallBack)(
Format
Parameters
BYTE* pBuffer, DWORD dwSize, DWORD dwCount, DWORD dwNotify, DWORD dwUser);
pBuffer(in)
A pointer to the buffer that stores the profile data. The profile data is stored in this buffer with "LJV7IF_PROFILE_HEADER - signed 32-bit profile data - LJV7IF_PROFILE_FOOTER" as a single unit of profile data, and only the number of profiles that could be acquired (dwCount) are returned.
dwSize(in)
The size in BYTEs per single unit of the profile "LJV7IF_PROFILE_HEADER - signed 32­bit profile data - LJV7IF_PROFILE_FOOTER" contained in pBuffer.
dwCount(in)
The number of profiles stored in pBuffer.
dwNotify(in)
Notification of an interruption in high-speed communication or a break in batch measurements. For details, see "8.3.1 Supplement".
dwUser(in)
User information set when high-speed communication was initialized.
Return value
Explanation
None
When using the high-speed communication function, this callback function is called when data is received and when there is a change in the communication state. This callback function is called from a thread other than the main thread. Take care to only implement storing profile data in a thread save buffer in the callback function. As the thread used to call the callback function is the same as the thread used to receive data, the processing time of the callback function affects the speed at which data is received, and may stop communication from being performed properly in some environments. Refer to the sample program for details. Profile data is stored in 0.01 μm units.
22 LJ-V7000_COM_RM_E

8.3.1 Supplement

8.3.1.1 dwNotify parameter
This section describes the dwNotify parameter used in the callback function.
In high-speed communication, the callback function is called when any number of events occur, in
addition to when profile data is received. These events can be checked with the dwNotify
parameter.
dwNotify = 0: Indicates that profile data is being communicated correctly. Refer to the table below
for values other than 0.
: May be returned.: Will not be returned.
Batch
off
Batch
on
LSB 0 Continuous send was stopped (stop by command) 
1
Continuous send was stopped (automatic stop)
2
Continuous send was stopped (automatic stop)
*1
*2


3 Reserved 4 Reserved 5 Reserved 6 Reserved 7 Reserved 8 Send interrupted by clear memory 
9 Reserved 10 Reserved 11 Reserved 12 Reserved 13 Reserved 14 Reserved 15 Reserved
16
Finished sending the batch measurement amount of data
*3

17 Reserved 18 Reserved 19 Reserved 20 Reserved 21 Reserved 22 Reserved 23 Reserved 24 Reserved 25 Reserved 26 Reserved 27 Reserved 28 Reserved 29 Reserved 30 Reserved
MSB 31 Reserved
*1 The setting was modified
*2 The program was switched
*3 However, when REMOTE OFF/LASER OFF is turned ON, profiles up to the one currently
being sent are forwarded, so some of the batch measurement data may not be forwarded.
23LJ-V7000_COM_RM_E
Bit 0 to 2 and bit 8 indicate that continuous send was stopped.
To restart continuous send, start the high-speed data communication in the following order:
"Finalize high-speed data communication" "Disconnect ethernet communication" "Start
ethernet communication" "Initialize ethernet high-speed communication" "Request preparation
for Ethernet high-speed data communication".
Bit 16 is only valid when batch measurements are on.
When batch measurements are on, the batch measurements can be ended even when the
configured batch count is not fulfilled. Therefore, the callback function is notified with this bit on in
order to determine the break in batch data.
24 LJ-V7000_COM_RM_E

9 Functions

9.1 Function list

9.1.1 Operations for the DLL

These functions are processed normally even when the controller is in the system error state.
Function name Overview
LJV7IF_Initialize Initializes the DLL
LJV7IF_Finalize Performs the termination processing for the DLL
LJV7IF_GetVersion Gets the DLL version

9.1.2 Establish/disconnect the communication path with the controller

These functions are processed normally even when the controller is in the system error state.
Function name Overview
LJV7IF_UsbOpen Establishes a USB connection
LJV7IF_EthernetOpen Establishes an Ethernet connection
LJV7IF_CommClose
Disconnects the connection (both USB and Ethernet)

9.1.3 System control

Excluding LJV7IF_RetrunToFactorySetting, these functions are processed normally even when the controller
is in the system error state. LJV7IF_RetrunToFactorySetting may fail in the system error state (when a head is
not connected, etc.).
Function name Overview
LJV7IF_RebootController Reboots the controller
LJV7IF_RetrunToFactorySetting Returns the controller to the factory settings
LJV7IF_GetError Gets the controller system error information
LJV7IF_ClearError Clears the controller system error

9.1.4 Measurement control

Processing for these functions fails when the controller is in the system error state.
Function name Overview
LJV7IF_Trigger Issues a trigger
LJV7IF_StartMeasure Starts measurements
LJV7IF_StopMeasure Stops measurements
LJV7IF_AutoZero Issues auto zero
LJV7IF_Timing Issues timing
LJV7IF_Reset Issues a reset
LJV7IF_ClearMemory Clears the internal memory
25LJ-V7000_COM_RM_E

9.1.5 Functions related to modifying or reading settings

Processing for these functions fails when the controller is in the system error state.
Function name Overview
LJV7IF_SetSetting Sends a setting to the controller
LJV7IF_GetSetting Gets a setting from the controller
LJV7IF_InitializeSetting Initializes a controller setting
LJV7IF_ReflectSetting
LJV7IF_RewriteTemporarySetting
LJV7IF_CheckMemoryAccess
LJV7IF_SetTime Sets the date/time for the controller
LJV7IF_GetTime Gets the date/time for the controller
LJV7IF_ChangeActiveProgram Changes the active program number
LJV7IF_GetActiveProgram Gets the active program number
Reflects the contents of the write settings area in the running settings area and the save area
Overwrites the contents of the write settings area with the settings in the running settings area and the save area
Checks whether or not settings are being saved to the save area

9.1.6 Acquiring measurement results

Processing for these functions fails when the controller is in the system error state.
Function name Overview
LJV7IF_GetMeasurementValue Gets measurement values
LJV7IF_GetProfile
Gets profiles when the operation mode is "high­speed (profile only)"
LJV7IF_GetBatchProfile
LJV7IF_GetProfileAdvance
LJV7IF_GetBatchProfileAdvance
Gets profiles when the operation mode is "high­speed (profile only)" * Use LJV7IF_GetProfile when Compression (time
axis) is on.
Gets profiles when the operation mode is "advanced (with OUT measurement)"
Gets profiles when the operation mode is "advanced (with OUT measurement)" * Use LJV7IF_GetProfileAdvance when
Compression (time axis) is on.
26 LJ-V7000_COM_RM_E

9.1.7 Storage function related

Processing for these functions fails when the controller is in the system error state.
Function name Overview
LJV7IF_StartStorage Starts storage
LJV7IF_StopStorage Stops storage
LJV7IF_GetStorageStatus Gets the storage status
LJV7IF_GetStorageData
LJV7IF_GetStorageProfile
LJV7IF_GetStorageBatchProfile
Gets the stored data when the storage target is "OUT value"
Gets the stored profiles when the storage target is "Profiles"
Gets the stored profiles when the storage target is "Profiles" * Use LJV7IF_GetStorageProfile when
Compression (time axis) is on.

9.1.8 High-speed data communication related

Processing for these functions fails when the controller is in the system error state.
Function name Overview
LJV7IF_HighSpeedDataUSBCommunicationInitalize
LJV7IF_HighSpeedDataEthernetCommunicationInitalize
LJV7IF_PreStartHighSpeedDataCommunication
LJV7IF_StartHighSpeedDataCommunication Starts high-speed data communication
Performs the initialization required for high-speed data communication (USB)
Performs the initialization required for high-speed data communication (Ethernet)
Requests preparation before starting high-speed data communication
LJV7IF_StopHighSpeedDataCommunication Stops high-speed data communication
LJV7IF_HighSpeedDataCommunicationFinalize
Performs high-speed data communication termination processing
27LJ-V7000_COM_RM_E

9.2 Function reference

The type of the return value for the functions where there is a possibility of an error occurring is LONG.
Normally, 0 (ERR_NONE) is returned, and the return code is expressed in the lower 2 bytes (the upper 2
bytes are reserved).
For the common return codes for functions, see "10 Common Return Codes". For the individual return codes
for functions, see the function description in this chapter. The return codes are listed as the lower 2 bytes in
hexadecimal (example: 0x0100).

9.2.1 Operations for the DLL

Initialize DLL
Format LONG LJV7IF_Initialize(void);
Parameters -
Return value No individual return code
Explanation This function initializes the DLL. (Always run this function)
Supported version 1.00
Finalize DLL
Format LONG LJV7IF_Finalize(void);
Parameters -
Return value No individual return code
Explanation
Supported version 1.00
This function performs the termination processing for the DLL. (Always run this function)
Get DLL version
Format DWORD LJV7IF_GetVersion(void);
Parameters -
Return value DLL version
This function gets the DLL version. The version is expressed as a hexadecimal number. Viewed as hexadecimal, the 4th digit is the major version, the 3rd digit is the minor version, the 2nd digit is the revision, and the 1st digit is the build. For example, the initial version
Explanation
(1.2.3.4) is expressed as 0x1234.
The major version is incremented when the DLL's backward compatibility is lost. The minor revision is incremented when the version is updated with additional functions.
Supported version 1.00
28 LJ-V7000_COM_RM_E

9.2.2 Establish/disconnect the communication path with the controller

For communication devices, see "9.2.9.1 Communication devices".
USB communication connection
Format LONG LJV7IF_UsbOpen(LONG lDeviceId);
Parameters
Return value No individual return code
Explanation
Supported version 1.00
lDeviceId(in)
Specifies the communication device to communicate with.
This function establishes a connection with the controller so that the library can communicate with a USB-connected controller.
Ethernet communication connection
Format
Parameters
Return value No individual return code
Explanation
Supported version 1.00
LONG LJV7IF_EthernetOpen (LONG lDeviceId, LJV7IF_ETHERNET_CONFIG* pEthernetConfig);
lDeviceId(in)
Specifies the communication device to communicate with.
pEthernetConfig(in)
Ethernet communication settings. For each member, see "8 Constant, Structure Definitions"
This function establishes a connection with the controller so that the library can communicate with an Ethernet-connected controller.
Disconnect communication path
Format LONG LJV7IF_CommClose(LONG lDeviceId);
Parameters
Return value No individual return code
Explanation
Supported version 1.00
lDeviceId(in)
Specifies the communication device to communicate with.
This function closes the USB or Ethernet connection. Even if this function is called when a connection has not been established, an error does not occur.

9.2.3 System control

For communication devices, see "9.2.9.1 Communication devices".
Reboot the controller
Format LONG LJV7IF_RebootController(LONG lDeviceId);
Parameters
Return value 0x80A0: Accessing the save area
Explanation
lDeviceId(in)
Specifies the communication device to communicate with.
This function reboots the controller and connected devices. An error occurs while accessing the save area.
Supported version 1.00
29LJ-V7000_COM_RM_E
Loading...
+ 65 hidden pages