5dll functions overview, 6return codes, 7dll functions usage examples – Lenze P94DLL01A User Manual

Page 8

Advertising
background image

8

P94DLL01A

5

DLL Functions Overview

Every aspect of the PositionServo drive can be manipulated by writing or reading the variable(s) inside
the drive. All variables are addressable by their respective index number. See the full list of variables in
the Appendix A “Complete list of variables” in PositionServo Model Programming Manual (Document No
PM94P01).
Every variable can be interpreted as a  bit integer or as DOUBLE. For Read/Write, and Set/Get functions,
there are two function versions to read/write variables as integer or double precision types. Each variable
has its native format inside the drive, regardless of how the value was sent. The received value will be cast
to its natural format by the drive.
All variables are located in RAM but some of them have a non-volatile copy in the EPM (Electronic Program-
ming Module) memory. The DLL library provides two types of functions for writing such variables. One
type (SET) changes only RAM (run time) copy of the variables when the other (WRITE) changes both – the
run time copy in RAM and the non-volatile copy in EPM. At the drive reboot, the variables which have non-
volatile copies will be initialized with the values stored in EPM.
Two types of functions are also provided for reading. One type (GET) reads the RAM (run time) value of the
variables. The other (READ) reads the non-volatile variable value from EPM.
SET and GET function types also include LIST function versions. The corresponding LIST functions write or
read a sequential list of the variables up to 10 variables in one function call.

6

Return Codes

Table 1 lists the return codes, their abbreviation and description.

Table 1: PositionServo DLL Return Codes

Abbreviation

Code

Description

EC_CMD_NS

0

Command is not specified

EC_OK

1

Command is performed OK

EC_VALUE_TOOSMALL

-1

Value for variable is too small. Value is boosted and accepted

EC_VALUE_TOOBIG



Value for variable is too big. Truncated and accepted

EC_INVALID_HANDLE

100

Invalid handle

EC_TIMEOUT

101

Request is timed out

EC_COMPORT_ENABLED

00

COM port is enabled

EC_COMPORT_FAILED

01

Failed to open/operate the specified COM port

7

DLL Functions Usage Examples

Sample projects with the complete source codes are provided for demonstration purposes of DLL function
usage. Two sets of source codes written in Visual Basic and Visual C++ are available under the MotionView
help folder “…\Help\940 Communication DLL Library\940 Communication DLL Source Codes”.

Advertising