EPOS Command Library (P. 164 - 167)
EPOS Command Library (P. 164 - 167)
TABLE OF CONTENTS
2 Introduction 9
3 Initialization Functions 13
3.1 Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.2 Info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.3 Advanced Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4 Configuration Functions 35
4.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.2 Advanced Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5 Operation Functions 63
5.1 Operation Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
5.2 State Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
5.3 Error Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
5.4 Motion Info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
5.5 Profile Position Mode (PPM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
5.6 Profile Velocity Mode (PVM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
5.7 Homing Mode (HM). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.8 Interpolated Position Mode (IPM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
5.9 Position Mode (PM). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
5.10 Velocity Mode (VM). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
EPOS positioning controllers are considered as partly completed machinery according to EU Directive 2006/42/EC, Article 2,
Clause (g) and are intended to be incorporated into or assembled with other machinery or other partly completed
machinery or equipment.
Therefore, you must not put the device into service,…
• unless you have made completely sure that the other machinery fully complies with the EU directive’s requirements!
• unless the other machinery fulfills all relevant health and safety aspects!
• unless all respective interfaces have been established and fulfill the herein stated requirements!
Notation Explanation
Best Practice
Gives advice on the easiest and best way to proceed.
Material Damage
Points out information particular to potential damage of equipment.
Topic Reference
Eclipse http://eclipse.org/
Not all functions are supported by all devices as they are dependent on the
device version and the firmware version.
Functions
For details separate documents «Firmware Specification» and «Hardware
Reference» of the respective positioning controller.
IXXAT www.ixxat.de
Kvaser www.kvaser.com
maxon www.maxongroup.com
Microsoft Developer
http://msdn.microsoft.com/
Network (MSDN)
National Instruments
www.ni.com/can
(NI)
Not all objects are supported by all devices as they are dependent on the
device version and the firmware version.
Objects
For details separate documents «Firmware Specification» and «Hardware
Reference» of the respective positioning controller.
Vector www.vector-informatik.com
CANopen®
© CiA CAN in Automation e.V, DE-Nuremberg
CiA®
Jetson™
© NVIDIA Corporation, USA-Santa Clara CA
NVIDIA®
LabVIEW™
© National Instruments Corporation, USA-Austin TX
LabWindows™
NI-CAN™
© National Instruments Corporation, USA-Austin TX
NI-XNET™
Visual Basic®
Visual C#® © Microsoft Corporation, USA-Redmond WA
Visual C++®
1.8 Copyright
This document is protected by copyright. Any further use (including reproduction, translation, microfilming,
and other means of electronic data processing) without prior written approval is not permitted. The men-
tioned trademarks belong to their respective owners and are protected under intellectual property rights.
© 2020 maxon. All rights reserved. Subject to change without prior notice.
CCMC | EPOS Command Library | Edition 2020-04 | DocID rel9435
maxon motor ag
Brünigstrasse 220 +41 41 666 15 00
CH-6072 Sachseln www.maxongroup.com
2 INTRODUCTION
Supplier Products
2.4.2 Gateway
Size Size
Name Data type Range Comment
Bits Bytes
char, __int8 signed integer 8 1 −128…127
BYTE unsigned integer 8 1 0…256
short signed integer 16 2 −32'768…32'767
WORD unsigned integer 16 2 0…65'535
32 4 −2'147'483'648…2'147'483'647
long signed integer Range
64 8 −2'147'483'648…2'147'483'647
independent of OS
DWORD unsigned integer 32 4 0…4'294'967'295
TRUE = 1
BOOL signed integer 32 4
FALSE = 0
pointer to an 32 4 0…4'294'967'295
HANDLE Depending on OS
object 64 8 0…18'446'744'073'709'551'615
3 INITIALIZATION FUNCTIONS
Availability of functions
The availability of certain functions depends on the used hardware. For an overview “Appendix A —
Hardware vs. Functions” on page 11-173.
3.1 Communication
3.1.1 VCS_OpenDevice
FUNCTION
HANDLE VCS_OpenDevice(char* DeviceName, char* ProtocolStackName, char* InterfaceName, char*
PortName, DWORD* pErrorCode)
DESCRIPTION
VCS_OpenDevice opens the port to send and receive commands. Ports can be RS232, USB, and
CANopen interfaces.
For correct designations on DeviceName, ProtocolStackName, InterfaceName, and PortName, use the
functions VCS_GetDeviceNameSelection, VCS_GetProtocolStackNameSelection, VCS_GetInterfa-
ceNameSelection, and VCS_GetPortNameSelection.
For gateway topologies use function VCS_OpenSubDevice.
PARAMETERS
RETURN PARAMETERS
PROGRAMMING EXAMPLE
For gateway topologies use OpenSubDevice (chapter “3.1.8 VCS_OpenSubDevice” on page 3-19).
3.1.2 VCS_OpenDeviceDlg
FUNCTION
HANDLE VCS_OpenDeviceDlg(DWORD* pErrorCode)
DESCRIPTION
VCS_OpenDeviceDlg recognizes available interfaces capable to operate with EPOS and opens the
selected interface for communication. Select “EPOS4” for IDX drives. Not available with Linux.
RETURN PARAMETERS
3.1.3 VCS_SetProtocolStackSettings
FUNCTION
BOOL VCS_SetProtocolStackSettings(HANDLE KeyHandle, DWORD Baudrate, DWORD Timeout,
DWORD* pErrorCode)
DESCRIPTION
VCS_SetProtocolStackSettings writes the communication parameters. For exact values on available baud
rates, use function VCS_GetBaudRateSelection.
For correct communication, use the same baud rate as the connected device.
In gateway topologies for subdevice use VCS_SetGatewaySettings instead.
PARAMETERS
RETURN PARAMETERS
PROGRAMMING EXAMPLE
3.1.4 VCS_GetProtocolStackSettings
FUNCTION
BOOL VCS_GetProtocolStackSettings(HANDLE KeyHandle, DWORD* pBaudrate, DWORD*
pTimeout, DWORD* pErrorCode)
DESCRIPTION
VCS_GetProtocolStackSettings returns the baud rate and timeout communication parameters.
In gateway topologies for subdevice use VCS_GetGatewaySettings instead.
PARAMETERS
RETURN PARAMETERS
3.1.5 VCS_FindDeviceCommunicationSettings
FUNCTION
BOOL VCS_FindDeviceCommunicationSettings(HANDLE* pKeyHandle, char* pDeviceName, char*
pProtocolStackName, char* pInterfaceName, char* pPortName, WORD SizeName, DWORD*
pBaudrate, DWORD* pTimeout, WORD* pNodeId, int DialogMode, DWORD* pErrorCode)
DESCRIPTION
VCS_FindDeviceCommunicationSettings searches the communication setting parameters. Parameters can
be defined to accelerate the process. The search will be terminated as the first device is found. Not avail-
able with Linux.
PARAMETERS
RETURN PARAMETERS
3.1.6 VCS_CloseAllDevices
FUNCTION
BOOL VCS_CloseAllDevices(DWORD* pErrorCode)
DESCRIPTION
VCS_CloseAllDevices closes all opened ports for devices and subdevices and releases them for other
applications. If no opened ports are available, the function returns “0”.
RETURN PARAMETERS
3.1.7 VCS_CloseDevice
FUNCTION
BOOL VCS_CloseDevice(HANDLE KeyHandle, DWORD* pErrorCode)
DESCRIPTION
VCS_CloseDevice closes the port and releases it for other applications. If no opened ports are available,
the function returns “0”.
PARAMETERS
RETURN PARAMETERS
3.1.8 VCS_OpenSubDevice
FUNCTION
HANDLE VCS_OpenSubDevice(HANDLE DeviceHandle, char* DeviceName, char*
ProtocolStackName, DWORD* pErrorCode)
Description
VCS_OpenSubDevice opens the subdevice connected to the gateway device to send and receive com-
mands.
PARAMETERS
RETURN PARAMETERS
PROGRAMMING EXAMPLE
3.1.9 VCS_OpenSubDeviceDlg
FUNCTION
HANDLE VCS_OpenSubDeviceDlg(HANDLE DeviceHandle, DWORD* pErrorCode)
Description
VCS_OpenSubDeviceDlg recognizes available subdevices capable to operate with the gateway device and
opens the selected device for communication. Select “EPOS4” for IDX drives. Not available with Linux.
PARAMETERS
RETURN PARAMETERS
3.1.10 VCS_SetGatewaySettings
FUNCTION
BOOL VCS_SetGatewaySettings(HANDLE KeyHandle, DWORD Baudrate, WORD* pErrorCode)
Description
VCS_SetGatewaySettings writes the gateway communication parameters to the device, stores them, and
resets the gateway device.
The function does not set the communication parameters to all devices on the bus.
For correct communication, use the same baud rate as the connected devices.
PARAMETERS
RETURN PARAMETERS
3.1.11 VCS_GetGatewaySettings
FUNCTION
BOOL VCS_GetGatewaySettings(HANDLE KeyHandle, DWORD* pBaudrate, DWORD* pErrorCode)
Description
VCS_GetGatewaySettings returns the baud rate gateway communication parameter.
PARAMETERS
RETURN PARAMETERS
3.1.12 VCS_FindSubDeviceCommunicationSettings
FUNCTION
BOOL VCS_FindSubDeviceCommunicationSettings(HANDLE DeviceHandle, HANDLE* pKeyHandle,
char* pDeviceName, char* pProtocolStackName, WORD SizeName, DWORD* pBaudrate, WORD*
pNodeId, int DialogMode, DWORD* pErrorCode)
Description
VCS_FindSubDeviceCommunicationSettings searches the subdevice communication setting parameters.
The parameters can be defined to accelerate the process. The search will be terminated as the first device
is found. Not available with Linux.
PARAMETERS
RETURN PARAMETERS
3.1.13 VCS_CloseAllSubDevices
FUNCTION
BOOL VCS_CloseAllSubDevices(HANDLE DeviceHandle, DWORD* pErrorCode)
Description
VCS_CloseAllSubDevices closes all opened subdevices and releases them for other applications.
PARAMETERS
RETURN PARAMETERS
3.1.14 VCS_CloseSubDevice
FUNCTION
BOOL VCS_CloseSubDevice(HANDLE KeyHandle, DWORD* pErrorCode)
Description
VCS_CloseSubDevice closes the subdevice and releases it for other applications.
PARAMETERS
RETURN PARAMETERS
3.2 Info
3.2.1 VCS_GetErrorInfo
FUNCTION
BOOL VCS_GetErrorInfo(DWORD ErrorCodeValue, char* pErrorInfo, WORD MaxStrSize)
DESCRIPTION
VCS_GetErrorInfo returns the error information on the executed function from a received error code. It
returns communication and library errors (but not device error descriptions). For error codes chapter “8
Error Overview” on page 8-145.
PARAMETERS
RETURN PARAMETERS
3.2.2 VCS_GetDriverInfo
FUNCTION
BOOL VCS_GetDriverInfo(char* pLibraryName, WORD MaxStrNameSize, char* pLibraryVersion, WORD
MaxStrVersionSize, DWORD* pErrorCode)
DESCRIPTION
VCS_GetDriverInfo returns the name and version from the «EPOS Command Library».
PARAMETERS
RETURN PARAMETERS
3.2.3 VCS_GetVersion
FUNCTION
BOOL VCS_GetVersion(HANDLE KeyHandle, WORD NodeId, WORD* pHardwareVersion, WORD*
pSoftwareVersion, WORD* pApplicationNumber, WORD* pApplicationVersion, DWORD* pErrorCode)
DESCRIPTION
VCS_GetVersion returns the firmware version.
PARAMETERS
RETURN PARAMETERS
3.3.1 VCS_GetDeviceNameSelection
FUNCTION
BOOL VCS_GetDeviceNameSelection(BOOL StartOfSelection, char* pDeviceNameSel, WORD
MaxStrSize, BOOL* pEndOfSelection, DWORD* pErrorCode)
DESCRIPTION
VCS_GetDeviceNameSelection returns all available device names.
PARAMETERS
RETURN PARAMETERS
PROGRAMMING EXAMPLE
3.3.2 VCS_GetProtocolStackNameSelection
FUNCTION
BOOL VCS_GetProtocolStackNameSelection(char* DeviceName, BOOL StartOfSelection, char*
pProtocolStackNameSel, WORD MaxStrSize, BOOL* pEndOfSelection, DWORD* pErrorCode)
DESCRIPTION
VCS_GetProtocolStackNameSelection returns all available protocol stack names.
PARAMETERS
RETURN PARAMETERS
PROGRAMMING EXAMPLE
3.3.3 VCS_GetInterfaceNameSelection
FUNCTION
BOOL VCS_GetInterfaceNameSelection(char* DeviceName, char* ProtocolStackName, BOOL
StartOfSelection, char* pInterfaceNameSel, WORD MaxStrSize, BOOL* pEndOfSelection, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetInterfaceNameSelection returns all available interface names.
PARAMETERS
RETURN PARAMETERS
PROGRAMMING EXAMPLE
3.3.4 VCS_GetPortNameSelection
FUNCTION
BOOL VCS_GetPortNameSelection(char* DeviceName, char* ProtocolStackName, char*
InterfaceName, BOOL StartOfSelection, char* pPortSel, WORD MaxStrSize, BOOL* pEndOfSelection,
DWORD* pErrorCode)
DESCRIPTION
VCS_GetPortNameSelection returns all available port names.
PARAMETERS
RETURN PARAMETERS
PROGRAMMING EXAMPLE
3.3.5 VCS_ResetPortNameSelection
FUNCTION
BOOL VCS_ResetPortNameSelection(char* DeviceName, char* ProtocolStackName, char*
InterfaceName, DWORD* pErrorCode)
DESCRIPTION
VCS_ResetPortNameSelection reinitializes the port enumeration.
PARAMETERS
RETURN PARAMETERS
3.3.6 VCS_GetBaudRateSelection
FUNCTION
BOOL VCS_GetBaudrateSelection(char* DeviceName, char* ProtocolStackName, char*
InterfaceName, char* PortName, BOOL StartOfSelection, DWORD* pBaudrateSel, BOOL*
pEndOfSelection, DWORD* pErrorCode)
DESCRIPTION
VCS_GetBaudrateSelection returns all available baud rates for the connected port.
PARAMETERS
RETURN PARAMETERS
PROGRAMMING EXAMPLE
3.3.7 VCS_GetKeyHandle
FUNCTION
BOOL VCS_GetKeyHandle(char* DeviceName, char* ProtocolStackName, char* InterfaceName, char*
PortName, HANDLE* pKeyHandle, DWORD* pErrorCode)
DESCRIPTION
VCS_GetKeyHandle returns the key handle from the opened interface.
PARAMETERS
RETURN PARAMETERS
pKeyHandle HANDLE* Handle for port access, if parameters are correct; otherwise 0
pErrorCode DWORD* Error information on the executed function
3.3.8 VCS_GetDeviceName
FUNCTION
BOOL VCS_GetDeviceName(HANDLE KeyHandle, char* pDeviceName, WORD MaxStrSize, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetDeviceName returns the device name to corresponding handle.
PARAMETERS
RETURN PARAMETERS
3.3.9 VCS_GetProtocolStackName
FUNCTION
BOOL VCS_GetProtocolStackName(HANDLE KeyHandle, char* pProtocolStackName, WORD
MaxStrSize, DWORD* pErrorCode)
DESCRIPTION
VCS_GetProtocolStackName returns the protocol stack name to corresponding handle.
PARAMETERS
RETURN PARAMETERS
3.3.10 VCS_GetInterfaceName
FUNCTION
BOOL VCS_GetInterfaceName(HANDLE KeyHandle, char* pInterfaceName, WORD MaxStrSize,
DWORD* pErrorCode)
DESCRIPTION
VCS_GetInterfaceName returns the interface name to corresponding handle.
PARAMETERS
RETURN PARAMETERS
3.3.11 VCS_GetPortName
FUNCTION
BOOL VCS_GetPortName(HANDLE KeyHandle, char* pPortName, WORD MaxStrSize, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetPortName returns the port name to corresponding handle.
PARAMETERS
RETURN PARAMETERS
4 CONFIGURATION FUNCTIONS
For detailed information on the objects separate document «Firmware Specification».
Availability of functions
The availability of certain functions depends on the used hardware. For an overview “Appendix A —
Hardware vs. Functions” on page 11-173.
4.1 General
4.1.1 VCS_ImportParameter
FUNCTION
BOOL VCS_ImportParameter(HANDLE KeyHandle, WORD NodeId, char* pParameterFileName, BOOL
ShowDlg, BOOL ShowMsg, DWORD* pErrorCode)
DESCRIPTION
VCS_ImportParameter writes parameters from a file to the device. Not available with Linux.
PARAMETERS
RETURN PARAMETERS
PROGRAMMING EXAMPLE
4.1.2 VCS_ExportParameter
FUNCTION
BOOL VCS_ExportParameter(HANDLE KeyHandle, WORD NodeId, char* pParameterFileName, char*
pFirmwareFileName, char* pUserID, char* pComment, BOOL ShowDlg, BOOL ShowMsg, DWORD*
pErrorCode)
DESCRIPTION
VCS_ExportParameter reads all device parameters and writes them to the file. Not available with Linux.
PARAMETERS
RETURN PARAMETERS
PROGRAMMING EXAMPLE
4.1.3 VCS_SetObject
FUNCTION
BOOL VCS_SetObject(HANDLE KeyHandle, WORD NodeId, WORD ObjectIndex, BYTE
ObjectSubIndex, void* pData, DWORD NbOfBytesToWrite, DWORD* pNbOfBytesWritten, DWORD*
pErrorCode)
DESCRIPTION
VCS_SetObject writes an object value at the given index and subindex.
For information on object index, object subindex, and object length separate document «Firmware Speci-
fication».
PARAMETERS
RETURN PARAMETERS
4.1.4 VCS_GetObject
FUNCTION
BOOL VCS_GetObject(HANDLE KeyHandle, WORD NodeId, WORD ObjectIndex, BYTE
ObjectSubIndex, void* pData, DWORD NbOfBytesToRead, DWORD* pNbOfBytesRead, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetObject reads an object value at the given index and subindex.
For information on object index, object subindex, and object length separate document «Firmware Speci-
fication».
PARAMETERS
RETURN PARAMETERS
4.1.5 VCS_Restore
FUNCTION
BOOL VCS_Restore(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_Restore restores all default parameters.
PARAMETERS
RETURN PARAMETERS
4.1.6 VCS_Store
FUNCTION
BOOL VCS_Store(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_Store stores all parameters.
PARAMETERS
RETURN PARAMETERS
4.1.7 VCS_UpdateFirmware
FUNCTION
BOOL VCS_UpdateFirmware (HANDLE KeyHandle, WORD NodeId, char *pBinaryFile,
BOOL ShowDlg, BOOL ShowHistory, BOOL ShowMsg, DWORD *pErrorCode)
DESCRIPTION
VCS_UpdateFirmware is used to update the binary code for the controller firmware. Not available with
Linux.
PARAMETERS
RETURN PARAMETERS
PROGRAMMING EXAMPLE
4.2.1 Motor
4.2.1.1 VCS_SetMotorType
FUNCTION
BOOL VCS_SetMotorType(HANDLE KeyHandle, WORD NodeId, WORD MotorType, DWORD*
pErrorCode)
DESCRIPTION
VCS_SetMotorType writes the motor type.
PARAMETERS
RETURN PARAMETERS
4.2.1.2 VCS_SetDcMotorParameter
FUNCTION
BOOL VCS_SetDcMotorParameter(HANDLE KeyHandle, WORD NodeId, WORD NominalCurrent, WORD
MaxOutputCurrent, WORD ThermalTimeConstant, DWORD* pErrorCode)
DESCRIPTION
VCS_SetDcMotorParameter writes all DC motor parameters.
PARAMETERS
RETURN PARAMETERS
4.2.1.3 VCS_SetEcMotorParameter
FUNCTION
BOOL VCS_SetEcMotorParameter(HANDLE KeyHandle, WORD NodeId, WORD NominalCurrent, WORD
MaxOutputCurrent, WORD ThermalTimeConstant, BYTE NbOfPolePairs, DWORD*
pErrorCode)
DESCRIPTION
VCS_SetEcMotorParameter writes all EC motor parameters.
PARAMETERS
RETURN PARAMETERS
4.2.1.4 VCS_GetMotorType
FUNCTION
BOOL VCS_GetMotorType(HANDLE KeyHandle, WORD NodeId, WORD* pMotorType, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetMotorType reads the motor type.
PARAMETERS
RETURN PARAMETERS
4.2.1.5 VCS_GetDcMotorParameter
FUNCTION
BOOL VCS_GetDcMotorParameter(HANDLE KeyHandle, WORD NodeId, WORD* pNominalCurrent,
WORD* pMaxOutputCurrent, WORD* pThermalTimeConstant, DWORD* pErrorCode)
DESCRIPTION
VCS_GetDcMotorParameter reads all DC motor parameters.
PARAMETERS
RETURN PARAMETERS
4.2.1.6 VCS_GetEcMotorParameter
FUNCTION
BOOL VCS_GetEcMotorParameter(HANDLE KeyHandle, WORD NodeId, WORD* pNominalCurrent,
WORD* pMaxOutputCurrent, WORD* pThermalTimeConstant, BYTE* pNbOfPolePairs, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetEcMotorParameter reads all EC motor parameters.
PARAMETERS
RETURN PARAMETERS
4.2.2 Sensor
4.2.2.1 VCS_SetSensorType
FUNCTION
BOOL VCS_SetSensorType(HANDLE KeyHandle, WORD NodeId, WORD SensorType, DWORD*
pErrorCode)
DESCRIPTION
VCS_SetSensorType writes the sensor type.
PARAMETERS
RETURN PARAMETERS
4.2.2.2 VCS_SetIncEncoderParameter
FUNCTION
BOOL VCS_SetIncEncoderParameter(HANDLE KeyHandle, WORD NodeId, DWORD
EncoderResolution, BOOL InvertedPolarity, DWORD* pErrorCode)
DESCRIPTION
VCS_SetIncEncoderParameter writes the incremental encoder parameters.
PARAMETERS
RETURN PARAMETERS
4.2.2.3 VCS_SetHallSensorParameter
FUNCTION
BOOL VCS_SetHallSensorParameter(HANDLE KeyHandle, WORD NodeId, BOOL InvertedPolarity,
DWORD* pErrorCode)
DESCRIPTION
VCS_SetHallSensorParameter writes the Hall sensor parameter.
PARAMETERS
RETURN PARAMETERS
4.2.2.4 VCS_SetSsiAbsEncoderParameterEx
FUNCTION
BOOL VCS_SetSsiAbsEncoderParameterEx(HANDLE KeyHandle, WORD NodeId, WORD DataRate,
WORD NbOfMultiTurnDataBits, WORD NbOfSingleTurnDataBits, WORD NbOfSpecialDataBits, BOOL
InvertedPolarity, WORD Timeout, WORD PowerupTime, DWORD* pErrorCode)
DESCRIPTION
VCS_SetSsiAbsEncoderParameterEx writes all parameters for EPOS4 SSI absolute encoder.
PARAMETERS
RETURN PARAMETERS
4.2.2.5 VCS_SetSsiAbsEncoderParameter
FUNCTION
BOOL VCS_SetSsiAbsEncoderParameter(HANDLE KeyHandle, WORD NodeId, WORD DataRate, WORD
NbOfMultiTurnDataBits, WORD NbOfSingleTurnDataBits, BOOL InvertedPolarity, DWORD* pErrorCode)
DESCRIPTION
VCS_SetSsiAbsEncoderParameter writes all parameters for SSI absolute encoder.
PARAMETERS
RETURN PARAMETERS
4.2.2.6 VCS_GetSensorType
FUNCTION
BOOL VCS_GetSensorType(HANDLE KeyHandle, WORD NodeId, WORD* pSensorType, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetSensorType reads the sensor type.
PARAMETERS
RETURN PARAMETERS
4.2.2.7 VCS_GetIncEncoderParameter
FUNCTION
BOOL VCS_GetIncEncoderParameter(HANDLE KeyHandle, WORD NodeId, DWORD*
pEncoderResolution, BOOL* pInvertedPolarity, DWORD* pErrorCode)
DESCRIPTION
VCS_GetIncEncoderParameter reads the incremental encoder parameters.
PARAMETERS
RETURN PARAMETERS
4.2.2.8 VCS_GetHallSensorParameter
FUNCTION
BOOL VCS_GetHallSensorParameter(HANDLE KeyHandle, WORD NodeId, BOOL* pInvertedPolarity,
DWORD* pErrorCode)
DESCRIPTION
VCS_GetHallSensorParameter reads the Hall sensor parameters.
PARAMETERS
RETURN PARAMETERS
4.2.2.9 VCS_GetSsiAbsEncoderParameter
FUNCTION
BOOL VCS_GetSsiAbsEncoderParameter(HANDLE KeyHandle, WORD NodeId, WORD* pDataRate,
WORD* pNbOfMultiTurnDataBits, WORD* pNbOfSingleTurnDataBits, BOOL* pInvertedPolarity, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetSsiAbsEncoderParameter reads all parameters from SSI absolute encoder.
PARAMETERS
RETURN PARAMETERS
4.2.2.10 VCS_GetSsiAbsEncoderParameterEx
FUNCTION
BOOL VCS_GetSsiAbsEncoderParameterEx(HANDLE KeyHandle, WORD NodeId, WORD* pDataRate,
WORD* pNbOfMultiTurnDataBits, WORD* pNbOfSingleTurnDataBits, WORD* pNbOfSpecialDataBits,
BOOL* pInvertedPolarity, WORD* pTimeout, WORD* pPowerupTime, DWORD* pErrorCode)
DESCRIPTION
VCS_GetSsiAbsEncoderParameterEx reads all parameters from EPOS4 SSI absolute encoder.
PARAMETERS
RETURN PARAMETERS
4.2.3 Safety
4.2.3.1 VCS_SetMaxFollowingError
FUNCTION
BOOL VCS_SetMaxFollowingError(HANDLE KeyHandle, WORD NodeId, DWORD MaxFollowingError,
DWORD* pErrorCode)
DESCRIPTION
VCS_SetMaxFollowingError writes the maximal allowed following error parameter.
PARAMETERS
RETURN PARAMETERS
4.2.3.2 VCS_GetMaxFollowingError
FUNCTION
BOOL VCS_GetMaxFollowingError(HANDLE KeyHandle, WORD NodeId, DWORD*
pMaxFollowingError, DWORD* pErrorCode)
DESCRIPTION
VCS_GetMaxFollowingError reads the maximal allowed following error parameter.
PARAMETERS
RETURN PARAMETERS
4.2.3.3 VCS_SetMaxProfileVelocity
FUNCTION
BOOL VCS_SetMaxProfileVelocity(HANDLE KeyHandle, WORD NodeId, DWORD MaxProfileVelocity,
DWORD* pErrorCode)
DESCRIPTION
VCS_SetMaxProfileVelocity writes the maximal allowed velocity. The velocity is interpreted according to the
currently configured velocity unit.
PARAMETERS
RETURN PARAMETERS
4.2.3.4 VCS_GetMaxProfileVelocity
FUNCTION
BOOL VCS_GetMaxProfileVelocity(HANDLE KeyHandle, WORD NodeId, DWORD*
pMaxProfileVelocity, DWORD* pErrorCode)
DESCRIPTION
VCS_GetMaxProfileVelocity reads the maximal allowed velocity. The velocity is interpreted according to the
currently configured velocity unit.
PARAMETERS
RETURN PARAMETERS
4.2.3.5 VCS_SetMaxAcceleration
FUNCTION
BOOL VCS_SetMaxAcceleration(HANDLE KeyHandle, WORD NodeId, DWORD MaxAcceleration,
DWORD* pErrorCode)
DESCRIPTION
VCS_SetMaxAcceleration writes the maximal allowed acceleration/deceleration.
PARAMETERS
RETURN PARAMETERS
4.2.3.6 VCS_GetMaxAcceleration
FUNCTION
BOOL VCS_GetMaxAcceleration(HANDLE KeyHandle, WORD NodeId, DWORD* pMaxAcceleration,
DWORD* pErrorCode)
DESCRIPTION
VCS_GetMaxAcceleration reads the maximal allowed acceleration/deceleration.
PARAMETERS
RETURN PARAMETERS
4.2.4.1 VCS_SetControllerGain
FUNCTION
VCS_SetControllerGain(HANDLE KeyHandle, WORD NodeId, WORD EController, WORD EGain,
DWORD64 Value, DWORD* pErrorCode)
DESCRIPTION
VCS_SetControllerGain writes the controller gain.
PARAMETERS
RETURN PARAMETERS
4.2.4.2 VCS_GetControllerGain
FUNCTION
VCS_GetControllerGain(HANDLE KeyHandle, WORD NodeId, WORD EController, WORD EGain,
DWORD64* pValue, DWORD* pErrorCode)
DESCRIPTION
VCS_SetControllerGain reads the controller gain.
PARAMETERS
RETURN PARAMETERS
4.2.5 Inputs/Outputs
4.2.5.1 VCS_DigitalInputConfiguration
FUNCTION
BOOL VCS_DigitalInputConfiguration(HANDLE KeyHandle, WORD NodeId, WORD DigitalInputNb, WORD
Configuration, BOOL Mask, BOOL Polarity, BOOL ExecutionMask, DWORD* pErrorCode)
DESCRIPTION
VCS_DigitalInputConfiguration sets the parameter for one digital input.
PARAMETERS
RETURN PARAMETERS
4.2.5.2 VCS_DigitalOutputConfiguration
FUNCTION
BOOL VCS_DigitalOutputConfiguration(HANDLE KeyHandle, WORD NodeId, WORD DigitalOutputNb,
WORD Configuration, BOOL State, BOOL Mask, BOOL Polarity, DWORD* pErrorCode)
DESCRIPTION
VCS_DigitalOutputConfiguration sets parameter for one digital output.
PARAMETERS
RETURN PARAMETERS
4.2.5.3 VCS_AnalogInputConfiguration
FUNCTION
BOOL VCS_AnalogInputConfiguration(HANDLE KeyHandle, WORD NodeId, WORD AnalogInputNb,
WORD Configuration, BOOL ExecutionMask, DWORD* pErrorCode)
DESCRIPTION
VCS_AnalogInputConfiguration sets the configuration parameter for one analog input.
PARAMETERS
RETURN PARAMETERS
4.2.5.4 VCS_AnalogOutputConfiguration
FUNCTION
BOOL VCS_AnalogOutputConfiguration(HANDLE KeyHandle, WORD NodeId, WORD AnalogOutputNb,
WORD Configuration, DWORD* pErrorCode)
DESCRIPTION
VCS_AnalogOutputConfiguration sets the configuration parameter for one analog output.
PARAMETERS
RETURN PARAMETERS
4.2.6 Units
4.2.6.1 VCS_SetVelocityUnits
FUNCTION
BOOL VCS_SetVelocityUnits(HANDLE KeyHandle, WORD NodeId, BYTE VelDimension, char
VelNotation, DWORD* pErrorCode)
DESCRIPTION
VCS_SetVelocityUnits writes velocity unit parameters.
PARAMETERS
RETURN PARAMETERS
4.2.6.2 VCS_GetVelocityUnits
FUNCTION
BOOL VCS_GetVelocityUnits(HANDLE KeyHandle, WORD NodeId, BYTE* pVelDimension, char*
pVelNotation, DWORD* pErrorCode)
DESCRIPTION
VCS_GetVelocityUnits reads velocity unit parameters.
PARAMETERS
RETURN PARAMETERS
5 OPERATION FUNCTIONS
Availability of functions
The availability of certain functions depends on the used hardware. For an overview “Appendix A —
Hardware vs. Functions” on page 11-173.
5.1.1 VCS_SetOperationMode
FUNCTION
BOOL VCS_SetOperationMode(HANDLE KeyHandle, WORD NodeId, __int8 Mode, DWORD*
pErrorCode)
DESCRIPTION
VCS_SetOperationMode sets the operation mode. Modes marked with a triple asterisk (***) are automati-
cally mapped to EPOS4-compatible firmware operation modes as to Table 5-20.
PARAMETERS
RETURN PARAMETERS
5.1.2 VCS_GetOperationMode
FUNCTION
BOOL VCS_GetOperationMode(HANDLE KeyHandle, WORD NodeId, __int8* pMode, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetOperationMode returns the activated operation mode.
PARAMETERS
RETURN PARAMETERS
Operation mode
pMode __int8*
(Table 5-19)
pErrorCode DWORD* Error information on the executed function
5.2.1 VCS_ResetDevice
FUNCTION
BOOL VCS_ResetDevice(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_ResetDevice is used to send the NMT service “Reset Node”. Command is without acknowledge.
PARAMETERS
RETURN PARAMETERS
5.2.2 VCS_SetState
FUNCTION
BOOL VCS_SetState(HANDLE KeyHandle, WORD NodeId, WORD State, DWORD* pErrorCode)
DESCRIPTION
VCS_SetState reads the actual state machine state.
PARAMETERS
RETURN PARAMETERS
5.2.3 VCS_SetEnableState
FUNCTION
BOOL VCS_SetEnableState(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_SetEnableState changes the device state to “enable”.
PARAMETERS
RETURN PARAMETERS
5.2.4 VCS_SetDisableState
FUNCTION
BOOL VCS_SetDisableState(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_SetDisableState changes the device state to “disable”.
PARAMETERS
RETURN PARAMETERS
5.2.5 VCS_SetQuickStopState
FUNCTION
BOOL VCS_SetQuickStopState(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_SetQuickStopState changes the device state to “quick stop”.
PARAMETERS
RETURN PARAMETERS
5.2.6 VCS_ClearFault
FUNCTION
BOOL VCS_ClearFault(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_ClearFault changes the device state from “fault” to “disable”.
PARAMETERS
RETURN PARAMETERS
5.2.7 VCS_GetState
FUNCTION
BOOL VCS_GetState(HANDLE KeyHandle, WORD NodeId, WORD* pState, DWORD* pErrorCode)
DESCRIPTION
VCS_GetState reads the new state of the state machine.
PARAMETERS
RETURN PARAMETERS
5.2.8 VCS_GetEnableState
FUNCTION
BOOL VCS_GetEnableState(HANDLE KeyHandle, WORD NodeId, BOOL* pIsEnabled, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetEnableState checks if the device is enabled.
PARAMETERS
RETURN PARAMETERS
1: Device enabled
pIsEnabled BOOL*
0: Device not enabled
pErrorCode DWORD* Error information on the executed function
5.2.9 VCS_GetDisableState
FUNCTION
BOOL VCS_GetDisableState(HANDLE KeyHandle, WORD NodeId, BOOL* pIsDisabled, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetDisableState checks if the device is disabled.
PARAMETERS
RETURN PARAMETERS
1: Device disabled
pIsDisabled BOOL*
0: Device not disabled
pErrorCode DWORD* Error information on the executed function
5.2.10 VCS_GetQuickStopState
FUNCTION
BOOL VCS_GetQuickStopState(HANDLE KeyHandle, WORD NodeId, BOOL* pIsQuickStopped, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetQuickStopState returns the device state quick stop.
PARAMETERS
RETURN PARAMETERS
5.2.11 VCS_GetFaultState
FUNCTION
BOOL VCS_GetFaultState(HANDLE KeyHandle, WORD NodeId, BOOL* pIsInFault, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetFaultState returns the device state fault. Get error information if the device is in fault state
(“Error Handling” on page 5-71).
PARAMETERS
RETURN PARAMETERS
5.3.1 VCS_GetNbOfDeviceError
FUNCTION
BOOL VCS_GetNbOfDeviceError(HANDLE KeyHandle, WORD NodeId, BYTE* pNbDeviceError, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetNbOfDeviceError returns the number of actual errors that are recorded.
PARAMETERS
RETURN PARAMETERS
PROGRAMMING EXAMPLE
5.3.2 VCS_GetDeviceErrorCode
FUNCTION
BOOL VCS_GetDeviceErrorCode(HANDLE KeyHandle, WORD NodeId, BYTE ErrorNumber, DWORD*
pDeviceErrorCode, DWORD* pErrorCode)
DESCRIPTION
VCS_GetDeviceErrorCode returns the error code of the selected error number.
PARAMETERS
RETURN PARAMETERS
PROGRAMMING EXAMPLE
5.4.1 VCS_GetMovementState
FUNCTION
BOOL VCS_GetMovementState(HANDLE KeyHandle, WORD NodeId, BOOL* pTargetReached, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetMovementState checks if the drive has reached target.
PARAMETERS
RETURN PARAMETERS
5.4.2 VCS_GetPositionIs
FUNCTION
BOOL VCS_GetPositionIs(HANDLE KeyHandle, WORD NodeId, long* pPositionIs, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetPositionIs returns the position actual value.
PARAMETERS
RETURN PARAMETERS
5.4.3 VCS_GetVelocityIs
FUNCTION
BOOL VCS_GetVelocityIs(HANDLE KeyHandle, WORD NodeId, long* pVelocityIs, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetVelocityIs reads the velocity actual value. The velocity is interpreted according to the currently
configured velocity unit.
PARAMETERS
RETURN PARAMETERS
5.4.4 VCS_GetVelocityIsAveraged
FUNCTION
BOOL VCS_GetVelocityIsAveraged(HANDLE KeyHandle, WORD NodeId, long* pVelocityIsAveraged,
DWORD* pErrorCode)
DESCRIPTION
VCS_GetVelocityIsAveraged reads the velocity actual averaged value. The velocity is interpreted according
to the currently configured velocity unit.
PARAMETERS
RETURN PARAMETERS
5.4.5 VCS_GetCurrentIs
FUNCTION
BOOL VCS_GetCurrentIs(HANDLE KeyHandle, WORD NodeId, short* pCurrentIs, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetCurrentIs returns the current actual value.
PARAMETERS
RETURN PARAMETERS
5.4.6 VCS_GetCurrentIsAveraged
FUNCTION
BOOL VCS_GetCurrentIsAveraged(HANDLE KeyHandle, WORD NodeId, short* pCurrentIsAveraged,
DWORD* pErrorCode)
DESCRIPTION
VCS_GetCurrentIsAveraged returns the current actual averaged value.
PARAMETERS
RETURN PARAMETERS
5.4.7 VCS_WaitForTargetReached
FUNCTION
BOOL VCS_WaitForTargetReached(HANDLE KeyHandle, WORD NodeId, DWORD Timeout, DWORD*
pErrorCode)
DESCRIPTION
VCS_WaitForTargetReached waits until the state is changed to target reached or until the time is up.
PARAMETERS
RETURN PARAMETERS
5.5.1 VCS_ActivateProfilePositionMode
FUNCTION
BOOL VCS_ActivateProfilePositionMode(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_ActivateProfilePositionMode changes the operational mode to “profile position mode”.
PARAMETERS
RETURN PARAMETERS
5.5.2 VCS_SetPositionProfile
FUNCTION
BOOL VCS_SetPositionProfile(HANDLE KeyHandle, WORD NodeId, DWORD ProfileVelocity, DWORD
ProfileAcceleration, DWORD ProfileDeceleration, DWORD* pErrorCode)
DESCRIPTION
VCS_SetPositionProfile sets the position profile parameters.
PARAMETERS
RETURN PARAMETERS
5.5.3 VCS_GetPositionProfile
FUNCTION
BOOL VCS_GetPositionProfile(HANDLE KeyHandle, WORD NodeId, DWORD* pProfileVelocity, DWORD*
pProfileAcceleration, DWORD* pProfileDeceleration, DWORD* pErrorCode)
DESCRIPTION
VCS_GetPositionProfile returns the position profile parameters.
PARAMETERS
RETURN PARAMETERS
5.5.4 VCS_MoveToPosition
FUNCTION
BOOL VCS_MoveToPosition(HANDLE KeyHandle, WORD NodeId, long TargetPosition, BOOL
Absolute, BOOL Immediately, DWORD* pErrorCode)
DESCRIPTION
VCS_MoveToPosition starts movement with position profile to target position.
PARAMETERS
RETURN PARAMETERS
5.5.5 VCS_GetTargetPosition
FUNCTION
BOOL VCS_GetTargetPosition(HANDLE KeyHandle, WORD NodeId, long* pTargetPosition, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetTargetPosition returns the profile position mode target value.
PARAMETERS
RETURN PARAMETERS
5.5.6 VCS_HaltPositionMovement
FUNCTION
BOOL VCS_HaltPositionMovement(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_HaltPositionMovement stops the movement with profile deceleration.
PARAMETERS
RETURN PARAMETERS
5.5.7.1 VCS_EnablePositionWindow
FUNCTION
BOOL VCS_EnablePositionWindow(HANDLE KeyHandle, WORD NodeId, DWORD PositionWindow,
WORD PositionWindowTime, DWORD* pErrorCode)
DESCRIPTION
VCS_EnablePositionWindow activates the position window.
PARAMETERS
RETURN PARAMETERS
5.5.7.2 VCS_DisablePositionWindow
FUNCTION
BOOL VCS_DisablePositionWindow(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_DisablePositionWindow deactivates the position window.
PARAMETERS
RETURN PARAMETERS
5.6.1 VCS_ActivateProfileVelocityMode
FUNCTION
BOOL VCS_ActivateProfileVelocityMode(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_ActivateProfileVelocityMode changes the operational mode to “profile velocity mode”.
PARAMETERS
RETURN PARAMETERS
5.6.2 VCS_SetVelocityProfile
FUNCTION
BOOL VCS_SetVelocityProfile(HANDLE KeyHandle, WORD NodeId, DWORD ProfileAcceleration,
DWORD ProfileDeceleration, DWORD* pErrorCode)
DESCRIPTION
VCS_SetVelocityProfile sets the velocity profile parameters.
PARAMETERS
RETURN PARAMETERS
5.6.3 VCS_GetVelocityProfile
FUNCTION
BOOL VCS_GetVelocityProfile(HANDLE KeyHandle, WORD NodeId, DWORD* pProfileAcceleration,
DWORD* pProfileDeceleration, DWORD* pErrorCode)
DESCRIPTION
VCS_GetVelocityProfile returns the velocity profile parameters.
PARAMETERS
RETURN PARAMETERS
5.6.4 VCS_MoveWithVelocity
FUNCTION
BOOL VCS_MoveWithVelocity(HANDLE KeyHandle, WORD NodeId, long TargetVelocity, DWORD*
pErrorCode)
DESCRIPTION
VCS_MoveWithVelocity starts the movement with velocity profile to target velocity. The velocity is inter-
preted according to the currently configured velocity unit.
PARAMETERS
RETURN PARAMETERS
5.6.5 VCS_GetTargetVelocity
FUNCTION
BOOL VCS_GetTargetVelocity(HANDLE KeyHandle, WORD NodeId, long* pTargetVelocity, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetTargetVelocity returns the profile velocity mode target value. The velocity is interpreted according
to the currently configured velocity unit.
PARAMETERS
RETURN PARAMETERS
5.6.6 VCS_HaltVelocityMovement
FUNCTION
BOOL VCS_HaltVelocityMovement(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_HaltVelocityMovement stops the movement with profile deceleration.
PARAMETERS
RETURN PARAMETERS
5.6.7.1 VCS_EnableVelocityWindow
FUNCTION
BOOL VCS_EnableVelocityWindow(HANDLE KeyHandle, WORD NodeId, DWORD VelocityWindow,
WORD VelocityWindowTime, DWORD* pErrorCode)
DESCRIPTION
VCS_EnableVelocityWindow activates the velocity window.
PARAMETERS
RETURN PARAMETERS
5.6.7.2 VCS_DisableVelocityWindow
FUNCTION
BOOL VCS_DisableVelocityWindow(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_DisableVelocityWindow deactivates the velocity window.
PARAMETERS
RETURN PARAMETERS
5.7.1 VCS_ActivateHomingMode
FUNCTION
BOOL VCS_ActivateHomingMode(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_ActivateHomingMode changes the operational mode to “homing mode”.
PARAMETERS
RETURN PARAMETERS
5.7.2 VCS_SetHomingParameter
FUNCTION
BOOL VCS_SetHomingParameter(HANDLE KeyHandle, WORD NodeId, DWORD
HomingAcceleration, DWORD SpeedSwitch, DWORD SpeedIndex, long HomeOffset, WORD
CurrentThreshold, long HomePosition, DWORD* pErrorCode)
DESCRIPTION
VCS_SetHomingParameter writes all homing parameters. The parameter units depend on (position, veloc-
ity, acceleration) notation index.
PARAMETERS
RETURN PARAMETERS
5.7.3 VCS_GetHomingParameter
FUNCTION
BOOL VCS_GetHomingParameter(HANDLE KeyHandle, WORD NodeId, DWORD*
pHomingAcceleration, DWORD* pSpeedSwitch, DWORD* pSpeedIndex, long* pHomeOffset, WORD*
pCurrentThreshold, long* pHomePosition, DWORD* pErrorCode)
DESCRIPTION
VCS_GetHomingParameter reads all homing parameters. The parameter units depend on (position, veloc-
ity, acceleration) notation index.
PARAMETERS
RETURN PARAMETERS
5.7.4 VCS_FindHome
FUNCTION
BOOL VCS_FindHome(HANDLE KeyHandle, WORD NodeId, __int8 HomingMethod, DWORD* ErrorCode)
DESCRIPTION
VCS_FindHome and HomingMethod permit to find the system home (for example, a home switch).
PARAMETERS
RETURN PARAMETERS
HOMING METHODS
5.7.5 VCS_StopHoming
FUNCTION
BOOL VCS_StopHoming(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_StopHoming interrupts homing.
PARAMETERS
RETURN PARAMETERS
5.7.6 VCS_DefinePosition
FUNCTION
BOOL VCS_DefinePosition(HANDLE KeyHandle, WORD NodeId, long HomePosition, DWORD*
pErrorCode)
DESCRIPTION
VCS_DefinePosition uses homing method 35 (Actual Position) to set a new home position.
PARAMETERS
RETURN PARAMETERS
5.7.7 VCS_GetHomingState
FUNCTION
BOOL VCS_GetHomingState(HANDLE KeyHandle, WORD NodeId, BOOL* pHomingAttained, BOOL*
pHomingError, DWORD* pErrorCode)
DESCRIPTION
VCS_GetHomingState returns the states if the homing position is attained and if an homing error has
occurred.
PARAMETERS
RETURN PARAMETERS
5.7.8 VCS_WaitForHomingAttained
FUNCTION
BOOL VCS_WaitForHomingAttained(HANDLE KeyHandle, WORD NodeId, DWORD Timeout, DWORD*
pErrorCode)
DESCRIPTION
VCS_WaitForHomingAttained waits until the homing mode is successfully terminated or until the time has
elapsed.
PARAMETERS
RETURN PARAMETERS
5.8.1 VCS_ActivateInterpolatedPositionMode
FUNCTION
BOOL VCS_ActivateInterpolatedPositionMode(HANDLE KeyHandle, WORD NodeId, DWORD*
pErrorCode)
DESCRIPTION
VCS_ActivateInterpolatedPositionMode changes the operational mode to “interpolated position mode”.
PARAMETERS
RETURN PARAMETERS
5.8.2 VCS_SetIpmBufferParameter
FUNCTION
BOOL VCS_SetIpmBufferParameter(HANDLE KeyHandle, WORD NodeId, WORD
UnderflowWarningLimit, WORD OverflowWarningLimit, DWORD* pErrorCode)
DESCRIPTION
VCS_SetIpmBufferParameter sets warning borders of the data input.
PARAMETERS
RETURN PARAMETERS
5.8.3 VCS_GetIpmBufferParameter
FUNCTION
BOOL VCS_GetIpmBufferParameter(HANDLE KeyHandle, WORD NodeId, WORD*
pUnderflowWarningLimit, WORD* pOverflowWarningLimit, DWORD* pMaxBufferSize, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetIpmBufferParameter reads warning borders and the max. buffer size of the data input.
PARAMETERS
RETURN PARAMETERS
pUnderflowWarningLimit WORD* Gives lower signalization level of the data input FIFO
pOverflowWarningLimit WORD* Gives the higher signalization level of the data input FIFO
pMaxBufferSize DWORD* Provides the maximal buffer size
pErrorCode DWORD* Error information on the executed function
5.8.4 VCS_ClearIpmBuffer
FUNCTION
BOOL VCS_ClearIpmBuffer(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_ClearIpmBuffer clears the input buffer and enables access to the input buffer for drive functions.
PARAMETERS
RETURN PARAMETERS
5.8.5 VCS_GetFreeIpmBufferSize
FUNCTION
BOOL VCS_GetFreeIpmBufferSize(HANDLE KeyHandle, WORD NodeId, DWORD* pBufferSize,
DWORD* pErrorCode)
DESCRIPTION
VCS_GetFreeIpmBufferSize reads the available buffer size.
PARAMETERS
RETURN PARAMETERS
5.8.6 VCS_AddPvtValueToIpmBuffer
FUNCTION
BOOL VCS_AddPvtValueToIpmBuffer(HANDLE KeyHandle, WORD NodeId, long Position,
long Velocity, BYTE Time, DWORD* pErrorCode)
DESCRIPTION
VCS_AddPvtValueToIpmBuffer adds a new PVT reference point to the device.
PARAMETERS
RETURN PARAMETERS
5.8.7 VCS_StartIpmTrajectory
FUNCTION
BOOL VCS_StartIpmTrajectory(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_StartIpmTrajectory starts the IPM trajectory.
PARAMETERS
RETURN PARAMETERS
5.8.8 VCS_StopIpmTrajectory
FUNCTION
BOOL VCS_StopIpmTrajectory(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_StopIpmTrajectory stops the IPM trajectory.
PARAMETERS
RETURN PARAMETERS
5.8.9 VCS_GetIpmStatus
FUNCTION
BOOL VCS_GetIpmStatus(HANDLE KeyHandle, WORD NodeId, BOOL* pTrajectoryRunning, BOOL*
pIsUnderflowWarning, BOOL* pIsOverflowWarning, BOOL* pIsVelocityWarning, BOOL*
pIsAccelerationWarning, BOOL* pIsUnderflowError, BOOL* pIsOverflowError, BOOL*
pIsVelocityError, BOOL* pIsAccelerationError, DWORD* pErrorCode)
DESCRIPTION
VCS_GetIpmStatus returns different warning and error states.
PARAMETERS
RETURN PARAMETERS
5.9.1 VCS_ActivatePositionMode
FUNCTION
BOOL VCS_ActivatePositionMode(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_ActivatePositionMode changes the operational mode to “position mode”.
PARAMETERS
RETURN PARAMETERS
5.9.2 VCS_SetPositionMust
FUNCTION
BOOL VCS_SetPositionMust(HANDLE KeyHandle, WORD NodeId, long PositionMust, DWORD*
pErrorCode)
DESCRIPTION
VCS_SetPositionMust sets the position mode setting value.
PARAMETERS
RETURN PARAMETERS
5.9.3 VCS_GetPositionMust
FUNCTION
BOOL VCS_GetPositionMust(HANDLE KeyHandle, WORD NodeId, long* pPositionMust, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetPositionMust reads the position mode setting value.
PARAMETERS
RETURN PARAMETERS
5.9.4.1 VCS_ActivateAnalogPositionSetpoint
FUNCTION
BOOL VCS_ActivateAnalogPositionSetpoint(HANDLE KeyHandle, WORD NodeId, WORD
AnalogInputNumber, float Scaling, long Offset, DWORD* pErrorCode)
DESCRIPTION
VCS_ActivateAnalogPositionSetpoint configures the selected analog input for analog position setpoint.
PARAMETERS
RETURN PARAMETERS
5.9.4.2 VCS_DeactivateAnalogPositionSetpoint
FUNCTION
BOOL VCS_DeactivateAnalogPositionSetpoint(HANDLE KeyHandle, WORD NodeId, WORD
AnalogInputNumber, DWORD* pErrorCode)
DESCRIPTION
VCS_DeactivateAnalogPositionSetpoint disables the selected analog input for analog position setpoint.
PARAMETERS
RETURN PARAMETERS
5.9.4.3 VCS_EnableAnalogPositionSetpoint
FUNCTION
BOOL VCS_EnableAnalogPositionSetpoint(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_EnableAnalogPositionSetpoint enables the execution mask for analog position setpoint.
PARAMETERS
RETURN PARAMETERS
5.9.4.4 VCS_DisableAnalogPositionSetpoint
FUNCTION
BOOL VCS_DisableAnalogPositionSetpoint(HANDLE KeyHandle, WORD NodeId, DWORD*
pErrorCode)
DESCRIPTION
VCS_DisableAnalogPositionSetpoint disables the execution mask for analog position setpoint.
PARAMETERS
RETURN PARAMETERS
5.10.1 VCS_ActivateVelocityMode
FUNCTION
BOOL VCS_ActivateVelocityMode(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_ActivateVelocityMode changes the operational mode to “velocity mode”.
PARAMETERS
RETURN PARAMETERS
5.10.2 VCS_SetVelocityMust
FUNCTION
BOOL VCS_SetVelocityMust(HANDLE KeyHandle, WORD NodeId, long VelocityMust, DWORD*
pErrorCode)
DESCRIPTION
VCS_SetVelocityMust sets the velocity mode setting value. The velocity is interpreted according to the cur-
rently configured velocity unit.
PARAMETERS
RETURN PARAMETERS
5.10.3 VCS_GetVelocityMust
FUNCTION
BOOL VCS_GetVelocityMust(HANDLE KeyHandle, WORD NodeId, long* pVelocityMust, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetVelocityMust returns the velocity mode setting value. The velocity is interpreted according to the
currently configured velocity unit.
PARAMETERS
RETURN PARAMETERS
5.10.4.1 VCS_ActivateAnalogVelocitySetpoint
FUNCTION
BOOL VCS_ActivateAnalogVelocitySetpoint(HANDLE KeyHandle, WORD NodeId, WORD
AnalogInputNumber, float Scaling, long Offset, DWORD* pErrorCode)
DESCRIPTION
VCS_ActivateAnalogVelocitySetpoint configures the selected analog input for analog velocity setpoint.
PARAMETERS
RETURN PARAMETERS
5.10.4.2 VCS_DeactivateAnalogVelocitySetpoint
FUNCTION
BOOL VCS_DeactivateAnalogVelocitySetpoint(HANDLE KeyHandle, WORD NodeId, WORD
AnalogInputNumber, DWORD* pErrorCode)
DESCRIPTION
VCS_DeactivateAnalogVelocitySetpoint disables the selected analog input for analog velocity setpoint.
PARAMETERS
RETURN PARAMETERS
5.10.4.3 VCS_EnableAnalogVelocitySetpoint
FUNCTION
BOOL VCS_EnableAnalogVelocitySetpoint(HANDLE KeyHandle, WORD NodeId, DWORD*
pErrorCode)
DESCRIPTION
VCS_EnableAnalogVelocitySetpoint enables the execution mask for analog velocity setpoint.
PARAMETERS
RETURN PARAMETERS
5.10.4.4 VCS_DisableAnalogVelocitySetpoint
FUNCTION
BOOL VCS_DisableAnalogVelocitySetpoint(HANDLE KeyHandle, WORD NodeId, DWORD*
pErrorCode)
DESCRIPTION
VCS_DisableAnalogVelocitySetpoint disables the execution mask for analog velocity setpoint.
PARAMETERS
RETURN PARAMETERS
5.11.1 VCS_ActivateCurrentMode
FUNCTION
BOOL VCS_ActivateCurrentMode(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_ActivateCurrentMode changes the operational mode to “current mode”.
PARAMETERS
RETURN PARAMETERS
5.11.2 VCS_GetCurrentMust
FUNCTION
BOOL VCS_GetCurrentMust(HANDLE KeyHandle, WORD NodeId, short* pCurrentMust, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetCurrentMust reads the current mode setting value.
PARAMETERS
RETURN PARAMETERS
5.11.3 VCS_SetCurrentMust
FUNCTION
BOOL VCS_SetCurrentMust(HANDLE KeyHandle, WORD NodeId, short CurrentMust, DWORD*
pErrorCode)
DESCRIPTION
VCS_SetCurrentMust writes current mode setting value.
PARAMETERS
RETURN PARAMETERS
5.11.4.1 VCS_ActivateAnalogCurrentSetpoint
FUNCTION
BOOL VCS_ActivateAnalogCurrentSetpoint(HANDLE KeyHandle, WORD NodeId, WORD
AnalogInputNumber, float Scaling, short Offset, DWORD* pErrorCode)
DESCRIPTION
VCS_ActivateAnalogCurrentSetpoint configures the selected analog input for analog current setpoint.
PARAMETERS
RETURN PARAMETERS
5.11.4.2 VCS_DeactivateAnalogCurrentSetpoint
FUNCTION
BOOL VCS_DeactivateAnalogCurrentSetpoint(HANDLE KeyHandle, WORD NodeId, WORD
AnalogInputNumber, DWORD* pErrorCode)
DESCRIPTION
VCS_DeactivateAnalogCurrentSetpoint disables the selected analog input for analog current setpoint.
PARAMETERS
RETURN PARAMETERS
5.11.4.3 VCS_EnableAnalogCurrentSetpoint
FUNCTION
BOOL VCS_EnableAnalogCurrentSetpoint(HANDLE KeyHandle, WORD NodeId, DWORD*
pErrorCode)
DESCRIPTION
VCS_EnableAnalogCurrentSetpoint enables the execution mask for analog current setpoint.
PARAMETERS
RETURN PARAMETERS
5.11.4.4 VCS_DisableAnalogCurrentSetpoint
FUNCTION
BOOL VCS_DisableAnalogCurrentSetpoint(HANDLE KeyHandle, WORD NodeId, DWORD*
pErrorCode)
DESCRIPTION
VCS_DisableAnalogCurrentSetpoint disables the execution mask for analog current setpoint.
PARAMETERS
RETURN PARAMETERS
5.12.1 VCS_ActivateMasterEncoderMode
FUNCTION
BOOL VCS_ActivateMasterEncoderMode(HANDLE KeyHandle, WORD NodeId, DWORD*
pErrorCode)
DESCRIPTION
VCS_ActivateMasterEncoderMode changes the operational mode to “master encoder mode”.
PARAMETERS
RETURN PARAMETERS
5.12.2 VCS_SetMasterEncoderParameter
FUNCTION
BOOL VCS_SetMasterEncoderParameter(HANDLE KeyHandle, WORD NodeId, WORD
ScalingNumerator, WORD ScalingDenominator, BYTE Polarity, DWORD MaxVelocity, DWORD
MaxAcceleration, DWORD* pErrorCode)
DESCRIPTION
VCS_SetMasterEncoderParameter writes all parameters for master encoder mode.
PARAMETERS
RETURN PARAMETERS
5.12.3 VCS_GetMasterEncoderParameter
FUNCTION
BOOL VCS_GetMasterEncoderParameter(HANDLE KeyHandle, WORD NodeId, WORD*
pScalingNumerator, WORD* pScalingDenominator, BYTE* pPolarity, DWORD* pMaxVelocity, DWORD*
pMaxAcceleration, DWORD* pErrorCode)
DESCRIPTION
VCS_GetMasterEncoderParameter reads all parameters for master encoder mode.
PARAMETERS
RETURN PARAMETERS
5.13.1 VCS_ActivateStepDirectionMode
FUNCTION
BOOL VCS_ActivateStepDirectionMode(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_ActivateStepDirectionMode changes the operational mode to “step direction mode”.
PARAMETERS
RETURN PARAMETERS
5.13.2 VCS_SetStepDirectionParameter
FUNCTION
BOOL VCS_SetStepDirectionParameter(HANDLE KeyHandle, WORD NodeId, WORD
ScalingNumerator, WORD ScalingDenominator, BYTE Polarity, DWORD MaxVelocity, DWORD
MaxAcceleration, DWORD* pErrorCode)
DESCRIPTION
VCS_SetStepDirectionParameter writes all parameters for step direction mode.
PARAMETERS
RETURN PARAMETERS
5.13.3 VCS_GetStepDirectionParameter
FUNCTION
BOOL VCS_GetStepDirectionParameter(HANDLE KeyHandle, WORD NodeId, WORD*
pScalingNumerator, WORD* pScalingDenominator, BYTE* pPolarity, DWORD* pMaxVelocity, DWORD*
pMaxAcceleration, DWORD* pErrorCode)
DESCRIPTION
VCS_GetStepDirectionParameter reads all parameters for step direction mode.
PARAMETERS
RETURN PARAMETERS
5.14.1 VCS_GetAllDigitalInputs
FUNCTION
BOOL VCS_GetAllDigitalInputs(HANDLE KeyHandle, WORD NodeId, WORD* pInputs, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetAllDigitalInputs returns state of all digital inputs.
PARAMETERS
RETURN PARAMETERS
5.14.2 VCS_GetAllDigitalOutputs
FUNCTION
BOOL VCS_GetAllDigitalOutputs(HANDLE KeyHandle, WORD NodeId, WORD* pOutputs, DWORD*
pErrorCode)
DESCRIPTION
VCS_GetAllDigitalOutputs returns state of all digital outputs.
PARAMETERS
RETURN PARAMETERS
5.14.3 VCS_SetAllDigitalOutputs
FUNCTION
BOOL VCS_SetAllDigitalOutputs(HANDLE KeyHandle, WORD NodeId, WORD Outputs, DWORD*
pErrorCode)
DESCRIPTION
VCS_SetAllDigitalOutputs sets the state of all digital outputs.
PARAMETERS
RETURN PARAMETERS
5.14.4 VCS_GetAnalogInput
FUNCTION
BOOL VCS_GetAnalogInput(HANDLE KeyHandle, WORD NodeId, WORD InputNumber, WORD*
pAnalogValue, DWORD* pErrorCode)
DESCRIPTION
VCS_GetAnalogInput returns the value from an analog input.
PARAMETERS
RETURN PARAMETERS
5.14.5 VCS_GetAnalogInputVoltage
FUNCTION
BOOL VCS_GetAnalogInputVoltage(HANDLE KeyHandle, WORD NodeId, WORD InputNumber, long*
pVoltageValue, DWORD* pErrorCode)
DESCRIPTION
VCS_GetAnalogInputVoltage returns the voltage value from an analog input.
PARAMETERS
RETURN PARAMETERS
5.14.6 VCS_GetAnalogInputState
FUNCTION
BOOL VCS_GetAnalogInputState(HANDLE KeyHandle, WORD NodeId, WORD Configuration, long*
pStateValue, DWORD* pErrorCode)
DESCRIPTION
VCS_GetAnalogInputState returns the state value from an analog input functionality.
PARAMETERS
RETURN PARAMETERS
5.14.7 VCS_SetAnalogOutput
FUNCTION
BOOL VCS_SetAnalogOutput(HANDLE KeyHandle, WORD NodeId, WORD OutputNumber, WORD
AnalogValue, DWORD* pErrorCode)
DESCRIPTION
VCS_SetAnalogOutput sets the voltage level of an analog output.
PARAMETERS
RETURN PARAMETERS
5.14.8 VCS_SetAnalogOutputVoltage
FUNCTION
BOOL VCS_SetAnalogOutputVoltage(HANDLE KeyHandle, WORD NodeId, WORD OutputNumber, long
VoltageValue, DWORD* pErrorCode)
DESCRIPTION
VCS_SetAnalogOutputVoltage sets the voltage level of an analog output.
PARAMETERS
RETURN PARAMETERS
5.14.9 VCS_SetAnalogOutputState
FUNCTION
BOOL VCS_SetAnalogOutputState(HANDLE KeyHandle, WORD NodeId, WORD Configuration,
long StateValue, DWORD* pErrorCode)
DESCRIPTION
VCS_SetAnalogOutputState sets the state value for an analog output functionality.
PARAMETERS
RETURN PARAMETERS
5.14.10.1 VCS_SetPositionCompareParameter
FUNCTION
BOOL VCS_SetPositionCompareParameter(HANDLE KeyHandle, WORD NodeId, BYTE
OperationalMode, BYTE IntervalMode, BYTE DirectionDependency, WORD IntervalWidth, WORD
IntervalRepetitions, WORD PulseWidth, DWORD* pErrorCode)
DESCRIPTION
VCS_SetPositionCompareParameter writes all parameters for position compare.
PARAMETERS
RETURN PARAMETERS
OPERATIONALMODE
INTERVALMODE
DIRECTIONDEPENDENCY
5.14.10.2 VCS_GetPositionCompareParameter
FUNCTION
BOOL VCS_GetPositionCompareParameter(HANDLE KeyHandle, WORD NodeId, BYTE*
pOperationalMode, BYTE* pIntervalMode, BYTE* pDirectionDependency, WORD* pIntervalWidth, WORD*
pIntervalRepetitions, WORD* pPulseWidth, DWORD* pErrorCode)
DESCRIPTION
VCS_GetPositionCompareParameter reads all parameters for position compare.
PARAMETERS
RETURN PARAMETERS
5.14.10.3 VCS_ActivatePositionCompare
FUNCTION
BOOL VCS_ActivatePositionCompare(HANDLE KeyHandle, WORD NodeId, WORD
DigitalOutputNumber, BOOL Polarity, DWORD* pErrorCode)
DESCRIPTION
VCS_ActivatePositionCompare enables the output to position compare method.
PARAMETERS
RETURN PARAMETERS
5.14.10.4 VCS_DeactivatePositionCompare
FUNCTION
BOOL VCS_DeactivatePositionCompare(HANDLE KeyHandle, WORD NodeId, WORD
DigitalOutputNumber, DWORD* pErrorCode)
DESCRIPTION
VCS_DeactivatePositionCompare disables the output to position compare method.
PARAMETERS
RETURN PARAMETERS
5.14.10.5 VCS_EnablePositionCompare
FUNCTION
BOOL VCS_EnablePositionCompare(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_EnablePositionCompare enables the output mask for position compare method.
PARAMETERS
RETURN PARAMETERS
5.14.10.6 VCS_DisablePositionCompare
FUNCTION
BOOL VCS_DisablePositionCompare(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_DisablePositionCompare disables the output mask from position compare method.
PARAMETERS
RETURN PARAMETERS
5.14.10.7 VCS_SetPositionCompareReferencePosition
FUNCTION
BOOL VCS_SetPositionCompareReferencePosition(HANDLE KeyHandle, WORD NodeId,
long ReferencePosition, DWORD* pErrorCode)
DESCRIPTION
VCS_SetPositionCompareReferencePosition writes the reference position for position compare method.
PARAMETERS
RETURN PARAMETERS
5.14.11.1 VCS_SetPositionMarkerParameter
FUNCTION
BOOL VCS_SetPositionMarkerParameter(HANDLE KeyHandle, WORD NodeId, BYTE
PositionMarkerEdgeType, BYTE PositionMarkerMode, DWORD* pErrorCode)
DESCRIPTION
VCS_SetPositionMarkerParameter writes all parameters for position marker method.
PARAMETERS
RETURN PARAMETERS
POSITIONMARKEREDGETYPE
POSITIONMARKERMODE
5.14.11.2 VCS_GetPositionMarkerParameter
FUNCTION
BOOL VCS_GetPositionMarkerParameter(HANDLE KeyHandle, WORD NodeId, BYTE*
pPositionMarkerEdgeType, BYTE* pPositionMarkerMode, DWORD* pErrorCode)
DESCRIPTION
VCS_GetPositionMarkerParameter reads all parameters for position marker method.
PARAMETERS
RETURN PARAMETERS
5.14.11.3 VCS_ActivatePositionMarker
FUNCTION
BOOL VCS_ActivatePositionMarker(HANDLE KeyHandle, WORD NodeId, WORD DigitalInputNumber,
BOOL Polarity, DWORD* pErrorCode)
DESCRIPTION
VCS_ActivatePositionMarker enables the digital input to position marker method.
PARAMETERS
RETURN PARAMETERS
5.14.11.4 VCS_DeactivatePositionMarker
FUNCTION
BOOL VCS_DeactivatePositionMarker(HANDLE KeyHandle, WORD NodeId, WORD
DigitalInputNumber, DWORD* pErrorCode)
DESCRIPTION
VCS_DeactivatePositionMarker disables the digital input to position marker method.
PARAMETERS
RETURN PARAMETERS
5.14.11.5 VCS_ReadPositionMarkerCounter
FUNCTION
BOOL VCS_ReadPositionMarkerCounter(HANDLE KeyHandle, WORD NodeId, WORD* pCount,
DWORD* pErrorCode)
DESCRIPTION
VCS_ReadPositionMarkerCounter returns the number of the detected edges.
PARAMETERS
RETURN PARAMETERS
5.14.11.6 VCS_ReadPositionMarkerCapturedPosition
FUNCTION
BOOL VCS_ReadPositionMarkerCapturedPosition(HANDLE KeyHandle, WORD NodeId, WORD
CounterIndex, long* pCapturedPosition, DWORD* pErrorCode)
DESCRIPTION
VCS_ReadPositionMarkerCapturedPosition returns the last captured position or the position from the posi-
tion marker history.
PARAMETERS
RETURN PARAMETERS
pCapturedPosition long* Contains the captured position or the position marker history
pErrorCode DWORD* Error information on the executed function
5.14.11.7 VCS_ResetPositionMarkerCounter
FUNCTION
BOOL VCS_ResetPositionMarkerCounter(HANDLE KeyHandle, WORD NodeId, DWORD*
pErrorCode)
DESCRIPTION
VCS_ResetPositionMarkerCounter clears the counter and the captured positions by writing zero to object
position marker counter (0x2074-04).
PARAMETERS
RETURN PARAMETERS
Availability of functions
The availability of certain functions depends on the used hardware. For an overview “Appendix A —
Hardware vs. Functions” on page 11-173.
Data recording functions are available for both Windows and Linux. Exemptions are marked accordingly.
6.1.1 VCS_SetRecorderParameter
FUNCTION
BOOL VCS_SetRecorderParameter(HANDLE KeyHandle, WORD NodeId, WORD SamplingPeriod,
WORD NbOfPrecedingSamples, DWORD* pErrorCode)
DESCRIPTION
VCS_SetRecorderParameter writes parameters for data recorder.
PARAMETERS
RETURN PARAMETERS
6.1.2 VCS_GetRecorderParameter
FUNCTION
BOOL VCS_GetRecorderParameter(HANDLE KeyHandle, WORD NodeId, WORD* pSamplingPeriod,
WORD* pNbOfPrecedingSamples, DWORD* pErrorCode)
DESCRIPTION
VCS_GetRecorderParameter reads parameters for data recorder.
PARAMETERS
RETURN PARAMETERS
6.1.3 VCS_EnableTrigger
FUNCTION
BOOL VCS_EnableTrigger(HANDLE KeyHandle, WORD NodeId, BYTE TriggerType, DWORD*
pErrorCode)
DESCRIPTION
VCS_EnableTrigger connects the trigger(s) for data recording.
PARAMETERS
RETURN PARAMETERS
6.1.4 VCS_DisableAllTriggers
FUNCTION
BOOL VCS_DisableAllTriggers(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_DisableAllTriggers sets data recorder configuration for triggers to zero.
PARAMETERS
RETURN PARAMETERS
6.1.5 VCS_ActivateChannel
FUNCTION
BOOL VCS_ActivateChannel(HANDLE KeyHandle, WORD NodeId, BYTE ChannelNumber, WORD
ObjectIndex, BYTE ObjectSubIndex, BYTE ObjectSize, DWORD* pErrorCode)
DESCRIPTION
VCS_ActivateChannel connects object for data recording.
Start with channel 1 (one)! Then, for every activated channel, the number of sampling variables will be
incremented.
PARAMETERS
RETURN PARAMETERS
6.1.6 VCS_DeactivateAllChannels
FUNCTION
BOOL VCS_DeactivateAllChannels(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_DeactivateAllChannels zeros all data recording objects.
PARAMETERS
RETURN PARAMETERS
6.2.1 VCS_StartRecorder
FUNCTION
BOOL VCS_StartRecorder(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_StartRecorder starts data recording.
PARAMETERS
RETURN PARAMETERS
6.2.2 VCS_StopRecorder
FUNCTION
BOOL VCS_StopRecorder(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_StopRecorder stops data recording.
PARAMETERS
RETURN PARAMETERS
6.2.3 VCS_ForceTrigger
FUNCTION
BOOL VCS_ForceTrigger(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_ForceTrigger forces the data recording triggers.
PARAMETERS
RETURN PARAMETERS
6.2.4 VCS_IsRecorderRunning
FUNCTION
BOOL VCS_IsRecorderRunning(HANDLE KeyHandle, WORD NodeId, BOOL* pRunning, DWORD*
pErrorCode)
DESCRIPTION
VCS_IsRecorderRunning returns the data recorder status “running”.
PARAMETERS
RETURN PARAMETERS
6.2.5 VCS_IsRecorderTriggered
FUNCTION
BOOL VCS_IsRecorderTriggered(HANDLE KeyHandle, WORD NodeId, BOOL* pTriggered, DWORD*
pErrorCode)
DESCRIPTION
VCS_IsRecorderTriggered returns data recorder status “triggered”.
PARAMETERS
RETURN PARAMETERS
6.3.1 VCS_ReadChannelVectorSize
FUNCTION
BOOL VCS_ReadChannelVectorSize(HANDLE KeyHandle, WORD NodeId, DWORD* pVectorSize,
DWORD* pErrorCode)
DESCRIPTION
VCS_ReadChannelVectorSize returns the maximal number of samples per variable. It is dynamically calcu-
lated by the data recorder.
PARAMETERS
RETURN PARAMETERS
6.3.2 VCS_ReadChannelDataVector
FUNCTION
BOOL VCS_ReadChannelDataVector(HANDLE KeyHandle, WORD NodeId, BYTE ChannelNumber,
BYTE* pDataVector, DWORD VectorSize, DWORD* pErrorCode)
DESCRIPTION
VCS_ReadChannelDataVector returns the data points of a selected channel.
PARAMETERS
RETURN PARAMETERS
6.3.3 VCS_ShowChannelDataDlg
FUNCTION
BOOL VCS_ShowChannelDataDlg(HANDLE KeyHandle, WORD NodeId, DWORD* pErrorCode)
DESCRIPTION
VCS_ShowChannelDataDlg opens the dialog to show the data channel(s). Not available with Linux.
PARAMETERS
RETURN PARAMETERS
6.3.4 VCS_ExportChannelDataToFile
FUNCTION
BOOL VCS_ExportChannelDataToFile(HANDLE KeyHandle, WORD NodeId, char* FileName, DWORD*
pErrorCode)
DESCRIPTION
VCS_ExportChannelDataToFile saves the data point in a file. Not available with Linux.
PARAMETERS
RETURN PARAMETERS
6.4.1 VCS_ReadDataBuffer
FUNCTION
BOOL VCS_ReadDataBuffer(HANDLE KeyHandle, WORD NodeId, BYTE* pDataBuffer, DWORD
BufferSizeToRead, DWORD* pBufferSizeRead, WORD* pVectorStartOffset, WORD*
pMaxNbOfSamples, WORD* pNbOfRecordedSamples, DWORD* pErrorCode)
DESCRIPTION
VCS_ReadDataBuffer returns the buffer data points.
PARAMETERS
RETURN PARAMETERS
6.4.2 VCS_ExtractChannelDataVector
FUNCTION
BOOL VCS_ExtractChannelDataVector(HANDLE KeyHandle, WORD NodeId, BYTE
ChannelNumber, BYTE* pDataBuffer, DWORD BufferSize, BYTE* pDataVector, DWORD VectorSize,
WORD VectorStartOffset, WORD MaxNbOfSamples, WORD NbOfRecordedSamples, DWORD*
pErrorCode)
DESCRIPTION
VCS_ExtractChannelDataVector returns the vector of a data channel.
PARAMETERS
RETURN PARAMETERS
Availability of functions
The availability of certain functions depends on the used hardware. For an overview “Appendix A —
Hardware vs. Functions” on page 11-173.
7.1.1 VCS_SendCANFrame
FUNCTION
BOOL VCS_SendCANFrame(HANDLE KeyHandle, WORD CobID, WORD Length, void* pData, DWORD*
pErrorCode)
DESCRIPTION
VCS_SendCANFrame sends a general CAN frame to the CAN bus.
PARAMETERS
RETURN PARAMETERS
7.1.2 VCS_ReadCANFrame
FUNCTION
BOOL VCS_ReadCANFrame(HANDLE KeyHandle, WORD CobID, WORD Length, void* pData, DWORD
Timeout , DWORD* p ErrorCode)
DESCRIPTION
VCS_ReadCANFrame reads a general CAN frame from the CAN bus.
PARAMETERS
RETURN PARAMETERS
7.1.3 VCS_RequestCANFrame
FUNCTION
BOOL VCS_RequestCANFrame(HANDLE KeyHandle, WORD CobID, WORD Length, void* pData,
DWORD* pErrorCode)
DESCRIPTION
VCS_RequestCANFrame requests a general CAN frame from the CAN bus using Remote Transmit
Request (RTR).
PARAMETERS
RETURN PARAMETERS
7.1.4 VCS_SendNMTService
FUNCTION
BOOL VCS_SendNMTService(HANDLE KeyHandle, WORD NodeId, WORD CommandSpecifier,
DWORD* pErrorCode)
DESCRIPTION
VCS_SendNMTService is used to send a NMT protocol from a master to one slave/all slaves in a network.
Command is without acknowledge.
PARAMETERS
RETURN PARAMETERS
8 ERROR OVERVIEW
9.1 Windows
9.1.1 Overview
The Windows library supports communication interfaces and system architectures as shown in the following
table:
Architecture
Interface
x86 x64
RS232 X X
USB X X
IXXAT X X
Kvaser X X
CAN
NI X X
Vector X X
Proceed as follows:
1) Copy the files to the working directory of your project.
2) Include the file “Definition.h” to your program code using the instruction “#include Definitions.h”.
3) Add the file “EposCmd.lib” to the project using menu ¤Project\Add to project¤. Select the file and
click ¤Open¤.
4) Now, you can execute all library functions in your own code.
Best Practice
Use the calling convention __stdcall. It will manage how the parameters are put on the stack and how the
stack will be cleaned once executed.
Proceed as follows:
1) Copy the files to the working directory of your project.
2) Write the instruction “Definitions” into the uses clause of your program header.
3) Now, you can execute all library functions in your own code.
Remark
The «EPOS Command Library» was developed in programming language Microsoft Visual C++. Take note
that data types in Microsoft Visual Basic and Microsoft Visual C++ differ. For more details consult the MSDN
library, Visual Basic Concepts, «Converting C Declarations to Visual Basic».
Proceed as follows:
1) Copy the files to the working directory of your project.
2) Add the file “Definitions.vb” to the project using the project tree in “Solution Explorer”. Click right on
¤Add¤, select ¤Existing Item¤, select the file, and click ¤Add¤.
4) Now, you can execute all library functions in your own code.
Proceed as follows:
1) Copy the files to the working directory of your project.
2) Add the .NET assembly "EposPCmd.Net.dll" to the project references using the project tree in
“Solution Explorer”. Click right on ¤Add¤, select ¤Existing Item¤, select the file, and click ¤Add¤.
4) Now, you can execute all library functions in your own code.
Remark
For further details and parameter description of the EposCmd.Net wrapper separate document
«EposCmd.Net.chm».
Proceed as follows:
1) Copy the files to the working directory of your project.
2) Setup the using directory in your program code using the instruction “using EposCmd.Net;”.
3) Add the file “EposCmd.Net” to the project using the project tree in “Solution Explorer”. Click right on
¤References¤, select ¤Add Reference¤, select the file, and click ¤OK¤.
4) Now, you can execute all library functions in your own code.
Remark
For further details and parameter description of the EposCmd.Net wrapper separate document
«EposCmd.Net.chm».
Proceed as follows:
1) Copy the files to the working directory of your project.
2) Include the file “Definition.h” to your program code using the instruction “#include Definitions.h”.
3) Add the library to your project using menu ¤Project\Properties¤. Select ¤Linker\Input¤ from the tree
and type the file name “EposCmd.lib” (for Windows 32-bit) or “EposCmd64.lib” (for Windows 64-bit)
into the ¤Additional Dependencies¤ edit line.
4) Now, you can execute all library functions in your own code.
Best Practice
Use the calling convention __stdcall. It will manage how the parameters are put on the stack and how the
stack will be cleaned once executed.
Proceed as follows:
Either start the LabVIEW project “maxon EPOS.lvproj” or add the complete folder “maxon EPOS” to your
project.
Proceed as follows:
1) Copy the files to the working directory of your project.
2) Include the file “Definition.h” to your program code using the instruction “#include Definitions.h”.
3) Add the files…
– “Definitions.h”, “EposCmd.dll”, “EposCmd.lib” (for Windows 32-bit) or
– “Definitions.h”, “EposCmd64.dll”, EposCmd64.lib (for Windows 64-bit)
… to your project using menu ¤Edit\Add to project¤.
Click ¤All Files…¤, select the files, and click ¤Add¤.
4) Now, you can execute all library functions in your own code.
Best Practice
Use the calling convention __stdcall. It will manage how the parameters are put on the stack and how the
stack will be cleaned once executed.
9.1.3 Programming
For correct communication with the EPOS, you must execute an initialization function before the first com-
munication command. The fundamental program flow is as follows:
INITIALIZATION
Execute the functions at the beginning of the program.
Function Description
Initialization of the port with the user data. Use the help
VCS_OpenDevice
functions for information on the interface settings.
Initialization of the port. The dialog shows all available
VCS_OpenDeviceDlg
communication ports.
VCS_SetProtocolStackSettings Initialization of the new baud rate and timeout
VCS_ClearFault Deletes possibly existent errors/warnings
HELP
Use the functions if you do not exactly know how your interface is configured.
Function Description
Returns available DeviceNames for function
VCS_GetDeviceNameSelection
VCS_OpenDevice
Returns available ProtocolStackNames for function
VCS_GetProtocolStackNameSelection
VCS_OpenDevice
Returns available InterfaceNames for function
VCS_GetInterfaceNameSelection
VCS_OpenDevice
VCS_GetPortNameSelection Returns available PortNames for function VCS_OpenDevice
Function Description
Set the operation mode (Position Mode, Profile Position Mode,
VCS_OperationMode
Current Mode, …)
VCS_GetEncoderParameter Read all encoder parameters
etc.
CLOSING PROCEDURE
Release the port before closing the program.
Function Description
VCS_CloseDevice Release the opened port
VCS_CloseAllDevices Release all opened ports
9.1.3.1 Examples
Applicability
• For an universally valid example applicable for most programming environments Demo_WinDLL.
• For a National Instruments LabView-specific example LabVIEW.
Best Practice
Prior starting one of the example programs, set the control parameters (e.g. motor, sensor, and regulator
parameters). Use the «EPOS Studio» for configuration.
DEMO_WINDLL
The example “Demo_WinDLL” is a dialog-based application. It demonstrates how to configure communica-
tion with the EPOS device.
LABVIEW
The maxon EPOS instrument driver contains the following example VIs:
MOVEWITHVELOCITY
Example to perform a velocity movement showing how to…
• initialize and close an interface (e.g. USB)
• start a velocity movement with correct operation mode
• wait until the target velocity is reached (e.g. 5 seconds)
MOVETORELATIVEPOSITION
Example to do a relative position step showing how to…
• initialize and close an interface (e.g. USB)
• start positioning with correct operation mode
• wait until the target position is reached
DATARECORDER
Example to configure and use the data recording functions showing how to…
• initialize and close an interface (e.g. USB)
• configure the data recorder
• start relative positioning
• display the recorded data (position, velocity, current)
GUI DEMO
Example on how to work with maxon EPOS VIs showing how to…
• initialize and close an interface (with a dialog)
• configure parameters and data
• enable/disable a device
• start/stop a relative movement
• configure profile and node settings
• use the data recorder
• update actual values
MOVEWITHIPM
Example on how to do an IPM trajectory showing how to…
• initialize and close an interface (e.g. USB)
• configure interpolated position mode parameters
• start IPM trajectory
• add PVT reference points
• stop IPM trajectory
9.2 Linux
9.2.1 Overview
The Linux library supports communication interfaces and system architectures as shown in the following
table:
Architecture
Intel ARM
Interface
32-bit 64-bit 32-bit 64-bit
X86 X86_64 V6 V7/V8 V8
RS232 X X — X —
USB X X X X X
IXXAT X X — X —
Kvaser X X — X —
CAN
PiCAN2 — — — X —
MTTCAN — — — — X
Table 9-44 Supported platforms, architectures, and interfaces
Tested setups
• x86 / x86_64: Tested on Ubuntu 12.04, 14.04 and 16.04 32/64-bit
• ARMv6 32-bit: Tested on Raspberry Pi Zero, Raspbian Stretch
• ARMv7/v8: Tested on Raspberry Pi 2/3, Raspbian Stretch 32-bit
• ARMv7/v8 - IXXAT: Requires modification of the official IXXAT installation script (install USB only)
• ARMv8 64-bit: Tested on NVIDIA Jetson TX2, Ubuntu 16.04, R28, revision 2.1
After successful installation, the EPOS Command Library is ready for use.
NOTE: The script will only uninstall the library version equal to the scripts package version.
9.2.4 Programming
For details Windows OS; chapter “9.1.3 Programming” on page 9-160.
The EPOS Linux library supports most of the EPOS commands. However, not supported are the following
commands:
• DataRecorder commands
• Export/Import parameters commands
• GUI-related commands (such as VCS_OpenDeviceDlg)
9.2.4.1 Examples
HelloEposCmd
The demo program (source code) is available either in the package “EPOS_Linux_Library.zip” or after
library installation in the directory “/opt/EposCmdLib_<version>/examples/HelloEposCmd”.
HelloEposCmd build and execution
$cd /opt/EposCmdLib_<version>/examples/HelloEposCmd
$make
$./HelloEposCmd
NOTE: If the make program is not available, you can install it using the following command:
$sudo apt-get install build-essential
The main purpose of HelloEposCmd is to show the basic concept of how to use the EPOS Command
Libarary in a custom C++ application:
• Open and close communication with the device
• Get and set communication parameters
• Selected mode demo: Profile Velocity Mode (PVM), Profile Position Mode (PPM)
The HelloEposCmd application contains usefull command line parameters. Some of them can be used to
identify the controller’s communication interface parameters for use with the EPOS Command Library later
on.
-h: print out the command line parameters overview
10 VERSION HISTORY
INITIALIZATION FUNCTIONS
Table 11-50 Hardware and their supported functions – Data recording functions
Table 11-51 Hardware and their supported functions – Low layer functions
3 Initialization Functions 13
3.1 Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.1.1 VCS_OpenDevice ...................................................................................................13
3.1.2 VCS_OpenDeviceDlg..............................................................................................14
3.1.3 VCS_SetProtocolStackSettings ..............................................................................15
3.1.4 VCS_GetProtocolStackSettings..............................................................................16
3.1.5 VCS_FindDeviceCommunicationSettings...............................................................17
3.1.6 VCS_CloseAllDevices.............................................................................................18
3.1.7 VCS_CloseDevice...................................................................................................18
3.1.8 VCS_OpenSubDevice ............................................................................................19
3.1.9 VCS_OpenSubDeviceDlg .......................................................................................20
3.1.10 VCS_SetGatewaySettings ......................................................................................20
3.1.11 VCS_GetGatewaySettings......................................................................................21
3.1.12 VCS_FindSubDeviceCommunicationSettings ........................................................21
3.1.13 VCS_CloseAllSubDevices ......................................................................................22
3.1.14 VCS_CloseSubDevice ............................................................................................22
3.2 Info. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.2.1 VCS_GetErrorInfo ...................................................................................................23
3.2.2 VCS_GetDriverInfo .................................................................................................23
3.2.3 VCS_GetVersion.....................................................................................................24
3.3 Advanced Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.3.1 VCS_GetDeviceNameSelection..............................................................................25
3.3.2 VCS_GetProtocolStackNameSelection ..................................................................26
3.3.3 VCS_GetInterfaceNameSelection...........................................................................27
3.3.4 VCS_GetPortNameSelection ..................................................................................28
3.3.5 VCS_ResetPortNameSelection ..............................................................................29
3.3.6 VCS_GetBaudRateSelection ..................................................................................30
3.3.7 VCS_GetKeyHandle ...............................................................................................31
3.3.8 VCS_GetDeviceName ............................................................................................31
3.3.9 VCS_GetProtocolStackName .................................................................................32
3.3.10 VCS_GetInterfaceName .........................................................................................32
3.3.11 VCS_GetPortName.................................................................................................33
LIST OF FIGURES
LIST OF TABLES
INDEX
A H
architectures (supported) hardware/functions matrix 173, 179
Linux 163 HM (Homing Mode) functions 85
Windows 150 homing methods 87
how to
B integrate the «EPOS Command Library» 149
Borland C++ (integration into) 151 interpret icons (and signs) used in the document 6
Borland Delphi (integration into) 152
I
C initialization functions 13
CM (Current Mode) functions 103 input/output functions 111
configuration functions 35 interfaces (supported) 150, 163
Linux 163
Windows 150
D IPM (Interpolated Position Mode) functions 90
data recording functions 129 IXXAT (supported devices) 10
data type definitions 12
Delphi (integration into) 152 K
drivers by 3rd party manufacturers 10
Kvaser (supported devices) 10
E L
End User License Agreement 7
LabVIEW (integration into) 158
EPOS Command Library, integration of 149
LabWindows (integration into) 159
error codes (overview) 145
legal notice 7
Error Handling functions 71
Linux
EULA 7
library hierarchy 163
low layer functions 141
F
functions M
configuration 35
data recording 129 manufacturers of supported products 10
initialization 13 MEM (Master Encoder Mode) functions 107
low layer 141 Motion Info functions 73
operation 63
functions for N
Current Mode 103 National Instruments (supported devices) 10
Homing Mode 85 NI-CAN 10
inputs & outputs 111
NI-XNET 10
Interpolated Position Mode 90
Master Encoder Mode 107
Position Mode 95 O
Profile Position Mode 77 operation functions 63
Profile Velocity Mode 81 Operation Mode functions 63
Step Direction Mode 109
Velocity Mode 99 P
functions/hardware matrix 173, 179
PM (Position Mode) functions 95
PPM (Profile Position Mode) functions 77
purpose of this document 5
PVM (Profile Velocity Mode) functions 81
S
SDM (Step Direction Mode) functions 109
signs used 6
State Machine functions 65
supported products by 3rd party suppliers 10
symbols used 6
V
VCI driver 10
Vector (supported devices) 10
Visual Basic .NET (integration into) 155
Visual Basic (integration into) 153
Visual C# (integration into) 156
Visual C++ (integration into) 157
VM (Velocity Mode) functions 99
W
warranty 7
Windows
communication structure 11
library hierarchies 149
X
XL driver 10