SPiiPlus COM Library (V5-20)
SPiiPlus COM Library (V5-20)
Programmer’s Guide
Version 5.20
Version 5.20, October 30, 2006
COPYRIGHT
Copyright ® 1999 - 2005 ACS Motion Control Ltd.
Changes are periodically made to the information in this document. Changes are published as release
notes and are be incorporated into future revisions of this document.
No part of this document may be reproduced in any form without prior written permission from ACS
Motion Control.
TRADEMARKS
ACS Motion Control, PEG and SPii are trademarks of ACS Motion Control Ltd.
Visual Basic and Windows are trademarks of Microsoft Corporation.
Any other companies and product names mentioned herein may be the trademarks of their respective
owners.
Website: http://www.AcsMotionControl.com
Information: [email protected]
Tech Support: [email protected]
Page Change
The following functions were added in V 5.0:
92 FlushLogFile
102 GetEthernetCards
238 SetServerExt
239 SetServerExtLogin
282 Section 5.191, WriteLogFile - method behavior changed, a log file no longer
needs to be explicitly opened.
Table of Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Related SPiiPlus Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 The SPiiPlus Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Conventions Used in this Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Statement Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 General Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Operating Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Communication Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.4 Controller Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.5 Programming Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.6 Installation and Supplied Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.7 Standard (SPiiPlus C Library) Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.8 Specific COM Library Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.9 Communication Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3 Using the SPiiPlus COM Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.1 Redistribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2 Visual Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.3 LabView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.4 VBScript (HTML) Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.5 Visual Studio .NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4 Methods Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.1 Communication Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.2 Service Communication Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.3 ACSPL+ Program Management Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.4 Read and Write Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.5 Load File to ACSPL+ Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.6 Multiple Thread Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.7 History Buffer Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.8 Unsolicited Messages Buffer Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.9 Log File Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.10 System Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.11 Setting and Reading the Motion Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.12 Axis/Motor Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.13 Motion Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.14 Point-to-Point Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.15 Track Motion Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.16 Jog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.17 Slaved Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.18 Multi-Point Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.19 Arbitrary Path Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.20 PVT Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.21 Segmented Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.22 Points and Segments Manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.23 Data Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.37 EndSequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
5.38 EndSequenceM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
5.39 ExtAddPoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
5.40 ExtAddPointM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
5.41 ExtArc1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
5.42 ExtArc2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
5.43 ExtLine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
5.44 ExtToPoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.45 ExtToPointM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.46 FaultClear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
5.47 FaultClearM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
5.48 FlushLogFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
5.49 GetAcceleration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5.50 GetACSCHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
5.51 GetAnalogInput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
5.52 GetAnalogOutput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
5.53 GetAxisState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
5.54 GetCOMLibraryVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
5.55 GetCommOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
5.56 GetConf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
5.57 GetDeceleration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
5.58 GetDefaultTimeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
5.59 GetEthernetCards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
5.60 GetErrorString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
5.61 GetExtInput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
5.62 GetExtInputPort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
5.63 GetExtOutput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
5.64 GetExtOutputPort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
5.65 GetFault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
5.66 GetFaultMask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
5.67 GetFirmwareVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
5.68 GetFPosition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
5.69 GetFVelocity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
5.70 GetHistory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
5.71 GetIndexState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
5.72 GetInput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
5.73 GetInputPort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
5.74 GetInterruptMask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
5.75 GetJerk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
5.76 GetKillDeceleration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
5.77 GetLibraryVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
5.78 GetSingleMessage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
5.79 GetMotionError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
5.80 GetMotorError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
5.81 GetMotorState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
5.82 GetOutput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
5.83 GetOutputPort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
5.84 GetPCICards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
List of Tables
Table 1 Related SPiiPlus Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Table 2 Collateral Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Table 3 Text Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Table 4 Communication Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Table 5 Service Communication Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Table 6 ACSPL+ Program Management Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Table 7 Read and Write Variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Table 8 Load File to ACSPL+ Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Table 9 Multiple Thread Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Table 10 History Buffer Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Table 11 Unsolicited Messages Buffer Management . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Table 12 Log File Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Table 13 System Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Table 14 Setting and Reading the Motion Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Table 15 Axis/Motor Management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Table 16 Motion Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Table 17 Point-to-Point Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Table 18 Track Motion Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Table 19 Jog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Table 20 Slaved Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Table 21 Multi-Point Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Table 22 Arbitrary Path Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Table 23 PVT Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Table 24 Segmented Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Table 25 Points and Segments Manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Table 26 Data Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Table 27 Status Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Table 28 Inputs/Outputs Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Table 29 Safety Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Table 30 Wait-for-Condition Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Table 31 Event and Interrupt Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Table 32 Variables Management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Table 33 Service Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Table 34 Error Diagnosis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Table 35 Dual Port RAM (DPRAM) Access Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Table 36 Position Event Generation (PEG) Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Table 37 Value Dimension Indeces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
Table 38 General Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Table 39 General Communication Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Table 40 Ethernet Communication Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Table 41 Axis Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Table 42 Motion Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Table 43 Data Collection Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Table 44 Motor State Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Table 45 Axis State Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Table 46 Index and Mark State Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Table 47 Program State Flags. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Table 48 Safety Control Masks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Table 49 Interrupt Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Table 50 Interrupt Masks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
1 Introduction
The SPiiPlus COM Library supports the creation of a user application that operates in a PC host
computer and communicates with SPiiPlus motion controllers. The SPiiPlus COM Library
implements a rich set of controller operations and conceals from the application the complexity
of low-level communication and synchronization with the controller.
Note
Highlights an essential operating or maintenance procedure,
condition, or statement
Model
Model Dependent Text Here!
CAUTION
Caution describes a condition that may result in damage to
equipment.
2 General Information
2.1 General
The COM (Component Object Model) has become the most widely used component software
model in the world. COM provides a software architecture that enables components from
different programming languages and platforms to be combined into a variety of applications.
The SPiiPlus COM Library is provides the easiest way to incorporate SPiiPlus motion control
functionality. The library supports applications written in LabView, Microsoft Visual Basic,
and other popular languages.
• Application works with several controllers by turns. Only one communication channel is
open at the same time
Application creates communication channel object, opens communication with first
controller and then uses any SPiiPlus COM Library methods. When the application needs
to connect to the second controller, it closes the previous communication and then opens
new a communication. In this case the application uses the same communication channel
object for each controller.
Before closing the application closes communication, then destroys communication
channel.
Dim Ch As Channel
Set Ch =new Channel 'create communication channel
Call Ch.OpenCommPCI(Ch.ACSC_NONE) 'open communication with 1st controller
…
Fposition1 = Ch.GetFPosition(Ch.ACSC_AXIS_X)
'get motor feedback position from 1st
'controller
…
Ch.CloseCommunication 'close communication
Call Ch.OpenCommSerial(1, 115200) 'open communication with 2nd
'controller
…
Fposition2 = Ch.GetFPosition(Ch.ACSC_AXIS_X)
'get motor feedback position from
'2nd controller
…
Ch.CloseCommunication 'close communication
Call Ch.OpenCommSerial(2, 115200) 'open communication with 3rd
'controller
…
Fposition3 = Ch.GetFPosition(Ch.ACSC_AXIS_X)
'get motor feedback position from
'3rd controller
…
Ch.CloseCommunication 'close communication
'in VB there is no need to destroy
'communication channel
3.1 Redistribution
Note
SPiiPlus COM Library is registered automatically by the SPiiPlus
installation. However, when you deploy an application that uses the
SPiiPlus COM Library to other computers, you will have to register the
library.
Follow these steps to register the SPiiPlus COM Library using the REGSVR32.EXE utility that is
supplied with the Microsoft Windows OS:
1. Click the Windows Start button and choose Run.
2. Enter regsvr32 and then SPiiPlusCOM510.dll with the full path. The path and DLL name
should be in quotation marks. For example:
regsvr32 “C:\MyProjects\SPiiPlusCOM510.dll”
The SPiiPlus COM Library requires the SpiiPlus C Library and drivers. See Section 3.3 of the
SPiiPlus C Library Programmer’s Guide for details how to redistribute the SPiiPlus C Library.
3.3 LabView
This procedure applies for LabView version 7.
1. On the Controls palette select the Refnum -> Automation Refnum control.
2. On the control, click the right mouse button and select Select ActiveX Class - > Browse. A
list is displayed
3. Select SPiiPlus COM 5.10 Type Library Version 1.0 from the Type Library combo box.
In the Objects list, Channel should be selected.
4. Right click the SPiiPlusCOMLib control and select Find Terminal.
5. On your diagram, open the Function palette and select Communication->ActiveX-
>Automation Open.
6. Connect the SPiiPlusCOMLib510.IChannel control to the Automation Open control. as
illustrated in Figure 1.
SPiiPlusCOMLib .IChannel
labview _example
For example:
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub button1_onclick
Ch.OpenCommPCI(-1)
End Sub
//-->
</SCRIPT>
</HEAD>
<BODY>
<OBJECT classid=clsid: 4FC7FF8B-8432-49d5-9878-9A97FB42E04D height=1 id=Ch
VIEWASTEXT></OBJECT>
<INPUT id=button1 name=button1 style="HEIGHT: 28px; WIDTH: 127px" type=button
value=Button>
</BODY>
</HTML>
4 Methods Overview
4.16 Jog
Table 19 Jog
Jog Initiates a single-axis jog motion.
JogM Initiates a multi-axis jog motion.
5.1 AddPoint
Adds a point to a single axis multi-point or spline motion.
Syntax
object.AddPoint(Axis, Point)
Parameters
Name Type Description
Axis [in] long Axis
Point [in] double Coordinate of the added point
Return Value
None.
Remarks
The method adds a point to a single-axis multi-point or spline motion. To add a point to a multi-
axis motion, use AddPVPointM. To add a point with a specified non-default velocity or time
interval use ExtAddPoint or ExtAddPointM.
The method waits for the controller response.
The controller response indicates that the command was accepted and the point is added to the
motion buffer. The point can be rejected if the motion buffer is full. In this case, you can call
this method periodically until the method returns a non-zero value.
If the method fails, the Error object is filled with the error description.
Example
Sub AddPoint_Sample()
Dim Str(1) As String
5.2 MAddPointM
Adds a point to a multi-axis multi-point or spline motion.
Syntax
object.AddPointM(Axes, Point)
Parameters
Name Type Description
Axes [in] variant Array of involved axes. Each element specifies an
involved axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Point [in] variant Array of the coordinates of added point. The number
and order of values must correspond to the Axes array.
The Point must specify a value for each element of
Axes except the last –1 element.
Return Value
None.
Remarks
The method adds a point to a multi-axis multi-point or spline motion. To add a point to a single-
axis motion, use AddPoint. To add a point with a specified non-default velocity or time interval
use ExtAddPoint or ExtAddPointM.
The method waits for the controller response.
The controller response indicates that the command was accepted and the point is added to the
motion buffer. The point can be rejected if the motion buffer is full. In this case, you can call
this method periodically until the method returns non-zero value.
All axes specified in the Axes array must be specified before the call of the MultiPointM or
SplineM method. The number and order of the axes in the Axes array must correspond exactly
to the number and order of the axes of MultiPointM or SplineM methods.
If the method fails, the Error object is filled with the error description.
Example
Sub AddPointM_Sample()
Dim Index As Long
Dim Points(1) As Double
Dim Axes(2) As String
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
On Error GoTo except 'Enable axes XY
5.3 AddPVPoint
The method adds a point to a single-axis PV spline motion and specifies velocity.
object.AddPVPoint(Axis, Point, Velocity)
Parameters
Name Type Description
Axis [in] long ACSC_AXIS_X corresponds to X, ACSC_AXIS_Y –
to Y etc.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Point [in] double Coordinate of the added point.
Velocity [in] double Desired velocity at the point
Return Value
None.
Remarks
Before this method can be used, initiate PV spline motion by calling Spline with the appropriate
flags.
The method adds a point to a single-axis PV spline motion with a uniform time and specified
velocity at that point
To add a point to a multi-axis PV motion, use AddPVTPointM and ExtAddPointM.
To add a point to a PVT motion with non-uniform time interval, use the AddPVTPoint and
AddPVTPointM methods. The method waits for the controller response.
The controller response indicates that the command was accepted and the point is added to the
motion buffer. The point can be rejected if the motion buffer is full. In this case, call this method
periodically until the method returns a non-zero value.
If the method fails, the Error object is filled with the error description.
Example
Sub AddPVPoint_Sample()
Dim Index As Long
Points(1) As Double
On Error GoTo except 'Create PV motion with uniform time
'interval with uniform interval 500 ms
Call Ch.Spline(Ch.ACSC_AMF_CUBIC, Ch.ACSC_AXIS_X, 500)
'Add some points
For Index = 0 To 5
Points(0) = 100 * Index
Points(1) = 20000 * Index 'Position and velocity for each point
'of axis X
Call Ch.AddPVPoint(Ch.ACSC_AXIS_X, Points(0), Points(1))
Next Index
For Index = 0 To 1000000000: Next Index
'Finish the motion
'The end of the arbitrary path motion
Call Ch.EndSequence(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.4 AddPVPointM
Adds a point to a multiple-axis PV spline motion and specifies velocity.
Syntax
object.AddPVPointM(Axis, Point, Velocity)
Parameters
Name Type Description
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Point [in] variant Array of the coordinates of added point. The number
and order of values must correspond to the Axes array.
The Point must specify a value for each element of
Axes except the last –1 element.
Velocity [in] variant Array of the velocities of added point. The number and
order of values must correspond to the Axes array. The
Velocity must specify a value for each element of Axes
except the last –1 element.
Return Value
None.
Remarks
Before this method can be used, PVT spline motion must be initiated by calling SplineM with
the appropriate flags.
The method adds a point to a multiple-axis PV spline motion with a uniform time and specified
velocity at that point.
To add a point to a single-axis PV motion, use AddPVPoint. To add a point to a PVT motion
with non-uniform time interval, use the AddPVTPoint and AddPVTPointM methods.
The method waits for the controller response.
The controller response indicates that the command was accepted and the point is added to the
motion buffer. The point can be rejected if the motion buffer is full. In this case, you can call
this method periodically until the method returns non-zero value.
All axes specified in the Axes array must be specified before calling the MultiPointM or the
SplineM method. The number and order of the axes in the Axes array must correspond exactly
to the number and order of the axes of MultiPointM or the SplineM methods.
If the method fails, the Error object is filled with the error description.
Example
Sub AddPVPointM_Sample()
Dim Index As Long
Dim Points(1) As Double
Dim Axes(2) As String
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
On Error GoTo except 'Enable axes XY
Call Ch.EnableM(Axes) 'Create PV motion with uniform time
'interval with uniform interval 1000
'ms
Call Ch.SplineM(Ch.ACSC_AMF_CUBIC, Axes, 1000)
'Add some points
For Index = 0 To 5
Points(0) = 100 * Index
Points(1) = 200 * Index 'Position and velocity for each point
Call Ch.AddPVPointM(Axes, Points, Points)
Next Index 'Finish the motion
'End of the arbitrary path motion
Call Ch.EndSequenceM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.5 AddPVTPoint
Adds a point to a single-axis PVT spline motion and specifies velocity and motion time.
Syntax
object.AddPVTPoint(Axis, Point, Velocity, TimeInterval)
Parameters
Name Type Description
Return Value
None.
Remarks
Before this method can be used, PV spline motion must be initiated by calling Spline with the
appropriate flags.
The method adds a point to a single-axis PVT spline motion with a non-uniform time and
specified velocity at that point.
To add a point to a multi-axis PVT motion, use AddPVTPointM. To add a point to a PV
motion with uniform time interval, use the AddPVPoint and AddPVPointM methods.
The method waits for the controller response.
The controller response indicates that the command was accepted and the point is added to the
motion buffer. The point can be rejected if the motion buffer is full. In this case, you can call
this method periodically until the method returns non-zero value.
If the method fails, the Error object is filled with the error description.
Example
Sub AddPVTPoint_Sample()
Dim Index As Long
Dim Points(1) As Double
On Error GoTo except 'Enable axis X
Call Ch.Enable(Ch.ACSC_AXIS_X) 'Wait axis X enabled during 5 sec
5.6 AddPVTPointM
Adds a point to a multiple-axis PVT spline motion and specifies velocity and motion time.
Syntax
object.AddPVTPointM(Axis, Point, Velocity, TimeInterval)
Parameters
Name Type Description
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Point [in] variant Array of the coordinates of added point. The number
and order of values must correspond to the Axes array.
The Point must specify a value for each element of
Axes except the last –1 element.
Velocity [in] variant Array of the velocities of added point. The number and
order of values must correspond to the Axes array. The
Velocity must specify a value for each element of Axes
except the last –1 element.
TimeInterval [in] double If the motion was activated by the SplineM method
with the ACSC_AMF_VARTIME flag, this parameter
defines the time interval between the previous point
and the present one.
Return Value
None.
Remarks
Before this method can be used, PVT spline motion must be initiated by calling SplineM with
the appropriate flags.
The method adds a point to a multiple-axis PVT spline motion with a non-uniform time and
specified velocity at that point.
To add a point to a single-axis PVT motion, use AddPVTPoint. To add a point to a PV motion
with a uniform time interval, use the AddPVPoint and AddPVPointM methods.
The method waits for the controller response.
The controller response indicates that the command was accepted and the point is added to the
motion buffer. The point can be rejected if the motion buffer is full. In this case, you can call
this method periodically until the method returns non-zero value.
If the method fails, the Error object is filled with the error description.
Example
Sub AddPVTPointM_Sample()
Dim Index As Long
Dim Points(1)
Dim Axes(2)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
On Error GoTo except
'Enable axes XY
Call Ch.EnableM(Axes)
'PVT motion and uniform interval is not
used
Call Ch.SplineM(Ch.ACSC_AMF_CUBIC Or Ch.ACSC_AMF_VARTIME, Axes, 0)
'Add some points
For Index = 0 To 5
Points(0) = 100 * Index
Points(1) = 200 * Index
'Position, velocity and time interval of
'1000 ms for each point
Call Ch.AddPVTPointM(Axes, Points, Points, 1000)
Next Index
'End of the multi-point motion
Call Ch.EndSequenceM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.7 AppendBuffer
The method appends one or more ACSPL+ lines to the program in the specified buffer.
Syntax
object.AppendBuffer(Buffer, Program, Count)
Parameters
Name Type Description
Buffer [in] long Number of a program buffer in the controller.
Program [in] string ACSPL+ program.
Return Value
None.
Remarks
The method appends one or more ACSPL+ lines to the program in the specified buffer. If the
buffer already contains any program, the new text is appended to the end of the existing
program.
No compilation or syntax check is provided during downloading. In fact, any text, not only a
correct program, can be inserted into a buffer. In order to compile the program and check its
accuracy, the compile command must be executed after downloading.
If the method fails, the Error object is filled with the error description.
Example
Sub AppendBuffer_Sample()
Dim StringBuf As String
StringBuf = "enable x;jog x;stop" & Chr$(10)
On Error GoTo except
'The method appends one ACSPL+ line to
'buffer 0
Call Ch.AppendBuffer(0, StringBuf(1))
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual BasicEnd
Sub
5.8 Arc1
Adds an arc segment to a segmented motion and specifies the coordinates of the center point,
the coordinates of the final point and the direction of rotation.
Syntax
object.Arc1(Axes, Center, FinalPoint, Rotation)
Parameters
Name Type Description
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Center [in] variant Array of the center coordinates. The number and order
of values must correspond to the Axes array. The
Center must specify a value for each element of the
Axes except the last–1 element.
FinalPoint [in] variant Array of the final point coordinates. The number and
order of values must correspond to the Axes array. The
FinalPoint must specify a value for each element of
Axes except the last –1 element.
Rotation [in] long This parameter defines the direction of rotation. If
Rotation is set to ACSC_COUNTERCLOCKWISE,
then the rotation is counterclockwise. If Rotation is set
to ACSC_CLOCKWISE, then rotation is clockwise.
Return Value
None.
Remarks
The method adds an arc segment to the segmented motion and specifies the coordinates of the
center point, the coordinates of the final point and the direction of rotation. To add an arc
segment with a specified non-default velocity, use ExtArc1.
All axes specified in the Axes array must be specified before the call of the Segment method.
The number and order of the axes in the Axes array must correspond exactly to the number and
order of the axes of the Segment method.
The parameter Center specifies the coordinates of the arc center. The parameter FinalPoint
specifies the coordinates of the final point. All coordinates are absolute in the plane.
The method waits for the controller response.
The controller response indicates that the command was accepted and the segment is added to
the motion buffer. The segment can be rejected if the motion buffer is full. In this case, you can
call this method periodically until the method returns non-zero value.
If the method fails, the Error object is filled with the error description.
Example
Sub Arc1_Sample()
Dim Point(1) As Double
Dim Center(1) As Double
Dim Axes(2)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
On Error GoTo except
'Create segmented motion, coordinates of
the
'initial point are (1000,1000)
Point(0) = 1000
Point(1) = 1000
'enable axes XY
Call Ch.EnableM(Axes)
Call Ch.Segment(0, Axes, Point)
'Describe circle with center (1000, 0),
'final point (1000, -1000), clockwise
'rotation
Center(0) = 1000
Center(1) = 0
Point(0) = 1000
Point(1) = -1000
Call Ch.Arc1(Axes, Center, Point, Ch.ACSC_CLOCKWISE)
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequenceM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.9 Arc2
Adds an arc segment to a segmented motion and specifies the coordinates of the center point
and the rotation angle.
Syntax
object.Arc2(Axes, Center, Angle)
Parameters
Name Type Description
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Center [in] variant Array of the center coordinates. The number and order
of values must correspond to the Axes array. The
Center must specify a value for each element of Axes
except the last –1 element.
Angle [in] double Rotation angle in radians. Positive angle for
counterclockwise rotation, negative for clockwise
rotation.
Return Value
None.
Remarks
The method adds an arc segment to the segmented motion and specifies the coordinates of the
center point and the rotation angle. To add an arc segment with a specified non-default velocity,
use ExtArc2
All axes specified in the Axes array must be specified before the call of the Segment method.
The number and order of the axes in the Axes array must correspond exactly to the number and
order of the axes of the Segment method.
The parameter Center specifies the coordinates of the arc center. The coordinates are absolute
in the plane.
The method waits for the controller response.
The controller response indicates that the command was accepted and the segment is added to
the motion buffer. The segment can be rejected if the motion buffer is full. In this case, you can
call this method periodically until the method returns a non-zero value.
If the method fails, the Error object is filled with the error description.
Example
Sub Arc2_Sample()
Dim Point(1) As Double
Dim Center(1) As Double
Dim Axes(2)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
On Error GoTo except
'Create segmented motion, coordinates of
the
'initial point are(1000,1000)
Point(0) = 1000
Point(1) = 1000
'enable axes XY
Call Ch.EnableM(Axes)
Call Ch.Segment(0, Axes, Point)
'Describe circle with center (1000, 0),
full
'circle
Center(0) = 1000
Center(1) = 0
Call Ch.Arc2(Axes, Center, -2 * 3.141529)
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequenceM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.10 AssignPins
Defines whether a digital output is allocated to the corresponding bit of the OUT array (for
general purpose use) or allocated for PEG method use.
Syntax
object.AssignPins(Axis, Mask)
Parameters
Name Type Description
Axis [in] long PEG axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Mask [in] short 16-bit mask defines pins state.
Return Value
None.
Remarks
The method calls the ACSPL command SetConf (205, axis, Mask), where Mask is the output
mask. For a description of the output mask, see the description of SetConf in the SPiiPlus
ACSPL+ programmers guide.
If the method fails, the Error object is filled with the error description.
Example
Sub AssignPins_Sample()
On Error GoTo except
'Bit 8 is 1 means OUT3 is assigned to the
'pulse output of the X PEG
Call Ch.AssignPins(Ch.ACSC_AXIS_X, 256)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.11 Break
Terminates a motion immediately and provides a smooth transition to the next motion.
object.Break(Axis)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
None.
Remarks
The method terminates the executed motion that involves the specified axis only if the next
motion is waiting in the corresponding motion queue. The terminated motion can be either
single-axis or multi-axis.
If the motion queue contains no waiting motion, the break command is not executed
immediately. The current motion continues instead until the next motion is planned to the same
motion queue. Only then is the break command executed.
If no executed motion involves the specified axis, or the motion finishes before the next motion
is planned, the method has no effect.
When executing the break command, the controller terminates the motion immediately without
any deceleration profile. The controller builds instead a smooth third-order transition profile to
the next motion.
Use caution when implementing the break command with a multi-axis motion, because the
controller provides a smooth transition profile of the vector velocity. In a single-axis motion,
this ensures a smooth axis velocity. However, in a multi-axis motion an axis velocity can
change abruptly if the terminated and next motions are not tangent in the junction point. To
avoid jerk, the terminated and next motion must be tangent or nearly tangent in the junction
point.
If the method fails, the Error object is filled with the error description.
Example
Sub Break_Sample()
On Error GoTo except
'Enable axis X
Call Ch.Enable(Ch.ACSC_AXIS_X)
'Wait axis X enabled during 5 sec
Call Ch.WaitMotorEnabled(Ch.ACSC_AXIS_X, 1, 5000)
'Start up the motion of axis X to point
'10000
Call Ch.ToPoint(Ch.ACSC_AMF_RELATIVE, Ch.ACSC_AXIS_X, 10000)
'Executing of break to axis X
Call Ch.Break(Ch.ACSC_AXIS_X)
'Change the end of the point to point 0
'on the fly
5.12 BreakM
Terminates several motions immediately and provides a smooth transition to the next motions.
Syntax
object.BreakM(Axes)
Parameters
Name Type Description
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Return Value
None.
Remarks
The method terminates the executed motions that involve the specified axes. Only those
motions are terminated that have the next motion waiting in the corresponding motion queue.
The terminated motions can be either single-axis or multi-axis.
If a motion queue contains no waiting motion, the break command does not immediately affect
the corresponding axis. The current motion continues instead until the next motion is planned
to the same motion queue. Only then, the break command is executed.
If no executed motion involves the specified axis, or the corresponding motion finishes before
the next motion is planned, the method does not affect the axis.
When executing the break command, the controller terminates the motion immediately without
any deceleration profile. Instead, the controller builds a smooth third-order transition profile to
the next motion.
Use caution when implementing the break command with a multi-axis motion, because the
controller provides a smooth transition profile of the vector velocity. In a single-axis motion,
this ensures a smooth axis velocity, but in a multi-axis motion, an axis velocity can change
abruptly if the terminated and next motions are not tangent in the junction point. To avoid jerk,
the terminated and next motion must be tangent or nearly tangent in the junction point.
If the method fails, the Error object is filled with the error description.
Example
Sub BreakM_Sample()
Dim Axes(8)
Dim Points(7) As Double
Dim Index As Long
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = Ch.ACSC_AXIS_Z
Axes(3) = Ch.ACSC_AXIS_T
Axes(4) = Ch.ACSC_AXIS_A
Axes(5) = Ch.ACSC_AXIS_B
Axes(6) = Ch.ACSC_AXIS_C
Axes(7) = Ch.ACSC_AXIS_D
Axes(8) = -1
For Index = 0 To 7
Points(Index) = 10000
Next Index
On Error GoTo except
'Enable all axes
Call Ch.EnableM(Axes)
'Start up the motion of axes to point
10000
Call Ch.ToPointM(Ch.ACSC_AMF_RELATIVE, Axes, Points)
'Executing of break to all axes
Call Ch.BreakM(Axes)
For Index = 0 To 7
Points(Index) = -10000
Next Index
'Change the end points to point -10000
on the
'fly
Call Ch.ToPointM(Ch.ACSC_AMF_RELATIVE, Axes, Points)
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequenceM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.13 CancelOperation
Cancels all operations.
Syntax
object.CancelOperation
Parameters
None.
Return Value
None.
Remarks
The method waits for the controller response.
If the method fails, the Error object is filled with the error description.
Example
Sub CancelOperation_Sample()
On Error GoTo except
'The method cancels all the operations
Call Ch.CancelOperation
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.14 CaptureComm
Captures a communication channel.
Syntax
object.CaptureComm
Parameters
None.
Return Value
None.
Remarks
The method captures the communication channel for the calling thread and prevents access to
this communication channel from other threads.
If one thread captures the communication channel and another thread calls one of the SPiiPlus
COM Library methods, the second thread will be delayed until the first thread executes
ReleaseComm.
The method provides the ability to execute a sequence of methods without risk of intervention
from other threads.
If the method fails, the Error object is filled with the error description.
Example
Sub CaptureComm_Sample()
On Error GoTo except
'The method captures a communication
channel
Call Ch.CaptureComm
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.15 ClearBuffer
Deletes the specified ACSPL+ program lines in the specified program buffer.
Syntax
object.ClearBuffer(Buffer, FromLine, ToLine)
Parameters
Name Type Description
Buffer [in] long Buffer number, from 0 to 9.
FromLine, [in] long These parameters specify a range of lines to be deleted.
ToLine FromLine starts from 1.
If ToLine is larger then the total number of lines in the
specified program buffer, the range includes the last
program line.
If ToLine is ACSC_MAX_LINE, the method deletes
all lines in the specified buffer.
Return Value
None.
Remarks
The method deletes the specified ACSPL+ program lines in the specified program buffer.
If the method fails, the Error object is filled with the error description.
Example
Sub ClearBuffer_Sample()
Dim StringBuf(1) As String
StringBuf(0) = "enable x;jog x;stop" & Chr$(10)
On Error GoTo except
'Appends the line "enable x;jog x;stop"
to
'buffer 0
Call Ch.AppendBuffer(0, StringBuf(1))
'Delete buffer 0 from line 1 to 1000
5.16 ClearVariables
Deletes all persistent global variables.
Syntax
object.ClearVariables
Parameters
None.
Return Value
None.
Remarks
The method deletes all persistent global variables created by the DeclareVariable method.
The method waits for the controller response.
If the method fails, the Error object is filled with the error description.
Example
Sub ClearVariables_Sample()
On Error GoTo except
'The method declare global variable
"MyVar"
'as integer type.
Call Ch.DeclareVariable(Ch.ACSC_INT_TYPE, "MyVar")
'The method deletes all persistent
global
'variables.
Call Ch.ClearVariables
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.17 CloseComm
The method closes communication via the specified communication channel.
Syntax
object.CloseComm()
Parameters
None.
Return Value
None.
Remarks
The method closes the communication channel and releases all system resources related to the
channel. If the method closes communication with the Simulator, it also terminates the
Simulator.
Each OpenComm*** (for example, OpenCommSerial) call in the application must be
followed at some time with a CloseComm call in order to return the resources to the system.
If the method fails, the Error object is filled with the error description.
Example
Sub CloseComm_Sample()
On Error GoTo except
'Closes the communication channel
Call Ch.CloseComm
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.18 CloseHistoryBuffer
Closes the history buffer and discards all stored history.
Syntax
object.CloseHistoryBuffer()
Parameters
None.
Return Value
None.
Remarks
The method closes the history buffer and releases the used memory. All information stored in
the buffer is discarded.
If the method fails, the Error object is filled with the error description.
Example
Sub CloseHistoryBuffer_Sample()
On Error GoTo except
'The method closes the history buffer
'and discards all stored history
Call Ch.CloseHistoryBuffer
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.19 CloseLogFile
The method closes the log file.
Syntax
object.CloseLogFile()
Parameters
None.
Return Value
None.
Remarks
An application must always call CloseLogFile before it exits. Otherwise, the data written to the
file might be lost.
If the method fails, the Error object is filled with the error description.
Example
Sub CloseLogFile_Sample()
On Error GoTo except
'The method opens the log file
'"COMLogFile.log"
Call Ch.OpenLogFile("C:\COMLogFile.log")
'The method closes the log file
'"COMLogFile.log"
Call Ch.CloseLogFile
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual BasicEnd Sub
5.20 CloseMessageBuffer
The method closes the messages buffer and discards all stored unsolicited messages.
Syntax
object.CloseMessageBuffer()
Parameters
None.
Return Value
None.
Remarks
The method closes the message buffer and releases the used memory. All unsolicited messages
stored in the buffer are discarded.
If the method fails, the Error object is filled with the error description.
Example
Sub CloseMessageBuffer_Sample()
On Error GoTo except
'The method closes the messages buffer
'and discards all stored unsolicited
'messages
Call Ch.CloseMessageBuffer
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.21 CollectB
The method initiates data collection.
Syntax
object.CollectB(Flags, Array, NSample, Period, Vars)
Parameters
Name Type Description
Flags [in] long Bit-mapped parameter that can include one or more of
the following flags:
ACSC_DCF_TEMPORAL: temporal data collection.
The sampling period is calculated automatically
according to the collection time.
ACSC_DCF_CYCLIC: cyclic data collection uses the
collection array as a cyclic buffer and continues
infinitely. When the array is full, each new sample
overwrites the oldest sample in the array.
Array [in] string Name of the array that stores the collected samples.
The array must be declared as a global variable by an
ACSPL+ program or by the DeclareVariable method.
Nsample [in] long Number of samples to be collected.
Return Value
None.
Remarks
The array that stores the samples can be one or two-dimensional. A one-dimensional array is
allowed only if the variable list contains one variable name.
The number of the array rows must be ≥ than the number of variables in the variable list. The
number of the array columns must be equal or more than the number of samples specified by
the NSample argument.
If the method fails, the Error object is filled with the error description.
Example
Sub CollectB_Sample()
'Matrix consisting of two rows with 1000
'columns each
Dim ArrayName As String
ArrayName = "DCA(2)(1000)"
'Positions of axes X and Y will be
‘collected
Dim Vars As String
Vars = "FPOS(0)” & Chr$(13)& FPOS(1)"
On Error GoTo except
5.22 Command
The method sends a command to the controller and analyzes the controller response.
Syntax
object.Command(CommandName)
Parameters
Name Type Description
CommandName [in] string The command to be sent.
Return Value
None.
Remarks
The method sends a string containing one or more ACSPL+ commands to the controller. The
method verifies that the controller receives the command but does not return the controller
response. The method is intended for commands where the controller response does not include
any information except the prompt. For commands where the controller response includes some
information, use Transaction.
If the method fails, the Error object is filled with the error description.
Example
Sub Command_Sample()
On Error GoTo except
'Executed controller's command
'Call Ch.Command("enable x")
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.23 CompileBuffer
The method compiles the ACSPL+ program in the specified program buffer(s).
Syntax
object.CompileBuffer(Buffer)
Parameters
Name Type Description
Buffer [in] long Buffer number, from 0 to 9.
Use ACSC_NONE instead of the buffer number, to
compile all programs in all buffers.
Return Value
None.
Remarks
The method compiles an ACSPL+ program in the specified program buffer or all programs in
all buffers if the parameter Buffer is ACSC_NONE.
The method succeeds if the compile command was transmitted successfully to the controller,
i.e., the communication channel is OK and the specified buffer was not running. However, this
does not mean that the compile operation was completed successfully.
In order to get information about the results of the compile operation, use ReadVariable to read
PERR, which contains the most recent error that occurred in each buffer. If PERR is zero. the
buffer was compiled successfully.
Otherwise, PERR contains the error that occurred during the compilation.
The method waits for the controller response.
If the method fails, the Error object is filled with the error description.
Example
Sub CompileBuffer_Sample()
Dim StringBuf(1) As String
StringBuf(1) = "!Compiled buffer;stop" & Chr$(10)
On Error GoTo except
'Append a line to buffer 0
Call Ch.AppendBuffer(0, StringBuf(1))
'The method compiles ACSPL+ program in
'buffer 0
Call Ch.CompileBuffer(0)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual BasicEnd
Sub
5.24 DeclareVariable
The method creates the persistent global variable.
Syntax
object.DeclareVariable (Type, Name)
Parameters
Name Type Description
Type [in] long Type of the variable.
For the integer variable the parameter must be
ACSC_INT_TYPE.
For the real variable, the parameter must be
ACSC_REAL_TYPE.
Name [in] string Name of the variable.
Return Value
None.
Remarks
The method creates the persistent global variable specified by the parameter Name of type
specified by the parameter Type. The variable can be used as any other standard or global
variable.
If it is necessary to declare one or two-dimensional array, the parameter Name should also
contains the dimensional size in brackets.
The lifetime of a persistent global variable is not connected with any program buffer. The
persistent variable survives any change in the program buffers and can be erased only by the
ClearVariables method.
The method waits for the controller response.
If the method fails, the Error object is filled with the error description.
Example
ub DeclareVariable_Sample()
On Error GoTo except
'The method creates the persistent
global
'variable "MyVar" as integer type.
Call Ch.DeclareVariable(Ch.ACSC_INT_TYPE, "MyVar")
Exit Sub
Sexcept:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.25 Disable
The method shuts off an axis.
Syntax
object.Disable(Axis)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
None.
Remarks
The method shuts off a motor. After shutting off the motor cannot follow the reference and
remains at idle.
If the method fails, the Error object is filled with the error description.
Example
Sub Disable_Sample()
On Error GoTo except
'Disable of axis X
Call Ch.Disable(Ch.ACSC_AXIS_X)
'Wait motor X be disable during 5 sec
Call Ch.WaitMotorEnabled(Ch.ACSC_AXIS_X, 0, 5000)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.26 DisableAll
The method shuts off all axes.
Syntax
object.DisableAll()
Parameters
None.
Return Value
None.
Remarks
The method shuts off all motors. After the shutting off none of motors can follow the
corresponding, reference and all motors remain idle.
If no motors are currently enabled, the method has no effect.
If the method fails, the Error object is filled with the error description.
Example
Sub DisableAll_Sample()
On Error GoTo except
'Disable all motors
Call Ch.DisableAll
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.27 DisableEvent
The method disables ActiveX event generation for the specified interrupt condition.
Syntax
object. DisableEvent (Interrupt)
Parameters
Name Type Description
Interrupt [in], Long Specifies one of the interrupts such as
ACSC_INTR_PEG, ACSC_INTR_MARK1 etc. For
the full list of the interrupts, see Section 6.12,
Interrupt Types.
Return Value
None.
Remarks
The method disables ActiveX event generation, that was enabled with method EnableEvent
If the method fails, the Error object is filled with the error description.
Note
The method can be used only with the PCI communication channel or
the Simulator.
Example
Sub DisableEvent_Sample()
On Error GoTo except
'Disable event PROGRAM_END
Ch. DisableEvent (Ch.ACSC_INTR_PROGRAM_END)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual BasicEnd
Sub
5.28 DisableExt
The method shuts off an axis and defines the disable reason.
Syntax
object.DisableExt(Axis, Reason)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Reason [in] long Integer number that defines the reason of disable. The
specified value is stored in the MERR variable in the
controller and so modifies the state of the disabled
motor.
Return Value
None.
Remarks
The method shuts off a motor. After shutting off the motor cannot follow the reference and
remains at idle.
If Reason specifies one of the available motor termination codes, the state of the disabled
motor will be identical to the state of the motor disabled for the corresponding fault. This
provides an enhanced implementation of user-defined fault response.
If the second parameter specifies an arbitrary number, the motor state will be displayed as
“Kill/disable reason: <number> - customer code. This provides the ability to separate different
DISABLE commands in the application.
If the method fails, the Error object is filled with the error description.
Example
Sub DisableExt_Sample()
Dim MyCode As Long
My Code = 10
On Error GoTo except
'Disable of axis X with internal
customer
'code
Call Ch.DisableExt(Ch.ACSC_AXIS_X, MyCode)
'Wait motor X be disable during 5 sec
Call Ch.WaitMotorEnabled(Ch.ACSC_AXIS_X, 0, 5000)
Exit Sub
except:
ErrorMsg 'See Error Handling in Visual Basic
End Sub
5.29 DisableFault
Syntax
object.DisableFault(Axis, Fault)
Parameters
Name Type Description
Axis [in] long The parameter specifies the axis (ACSC_AXIS_X
corresponds to X, ACSC_AXIS_Y – to Y etc.) to
disable the motor faults or ACSC_NONE to disable the
system faults.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Fault [in] long The fault to be disabled. Only one fault can be disabled
at a time.
To specify the fault, one of the properties
ACSC_SAFETY_*** can be used. See Section 6.11,
Safety Control Masks for a detailed description of
these properties.
Return Value
None.
Remarks
The method disables the examination and processing of the specified motor or system fault by
setting the specified bit of the fault mask to zero.
The motor faults are related to a specific motor, the power amplifier, and the Servo processor.
For example: Position Error, Encoder Error, and Driver Alarm.
The system faults are not related to any specific motor, for example: Emergency Stop, Memory
Fault.
For more information about the controller faults, see SPiiPlus ACSPL+ Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub DisableFault_Sample()
On Error GoTo except
'Disable fault Software Right Limit in
axis X
Call Ch.DisableFault(Ch.ACSC_AXIS_X, Ch.ACSC_SAFETY_RL)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.30 DisableM
The method shuts off several axes.
Syntax
object.DisableM(Axes)
Parameters
Name Type Description
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Return Value
None.
Remarks
The method shuts off several axes. After the shutting off, the axes cannot follow the
corresponding reference and remain idle.
If the method fails, the Error object is filled with the error description.
Example
Sub DisableM_Sample()
Dim Axes(2)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
On Error GoTo except
'Disable axes X and Y
Call Ch.DisableM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.31 DisableResponse
The method disables the default response to the specified axis or system fault.
Syntax
object.DisableResponse(Axis, Response)
Parameters
Name Type Description
Axis [in] long The parameter specifies the axis (ACSC_AXIS_X
corresponds to X, ACSC_AXIS_Y – to Y etc.) to
disable the default response to the specified motor
fault, or ACSC_NONE to disable response to the
specified system fault.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Response [in] long The response to be disabled. Only one default response
can be disabled at a time.
To specify the fault, one of the properties
ACSC_SAFETY_*** can be used. See Section 6.11,
Safety Control Masks for a detailed description of
these properties.
Return Value
None.
Remarks
The method disables the default response to the specified motor or system fault by setting the
specified bit of the response mask to zero.
The default response is a controller-predefined action for the corresponding fault. For more
information about the controller faults and default responses, see SPiiPlus ACSPL+
Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub DisableResponse_Sample()
On Error GoTo except
'Disable the default response to the
Right
'Limit fault
Call Ch.DisableResponse(Ch.ACSC_AXIS_X, Ch.ACSC_SAFETY_RL)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual BasicEnd
Sub
5.32 Enable
The method activates an axis.
Syntax
object.Enable(Axis)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
None.
Remarks
The method activates an axis. After activation, the axis begins to follow the reference and
physical motion is available.
If the method fails, the Error object is filled with the error description.
Example
Sub Enable_Sample()
On Error GoTo except
'Enable axis X
Call Ch.Enable(Ch.ACSC_AXIS_X)
'Wait till axis X is enabled during 5 sec
Call Ch.WaitMotorEnabled(Ch.ACSC_AXIS_X, 1, 5000)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.33 EnableEvent
The method enables ActiveX event generation for the specified interrupt condition.
Syntax
object. EnableEvent (Interrupt)
Parameters
Name Type Description
Interrupt [in], Long Specifies one of the interrupts such as
ACSC_INTR_PEG, ACSC_INTR_MARK1 etc. For
the full list of the interrupts, see Section 6.12,
Interrupt Types.
Return Value
None.
Remarks
The library generates an event when the specified Interrupt occurs.
SPiiPlus COM Library has events for all types of interrupts:
PEG ([in] long Param), MARK1 ([in] long Param) etc. For full list of SPiiPlus COM Library
events see Chapter 7, Events.
The bit-mapped event parameter Param identifies which axis/buffer/input the interrupt was
generated for. See Section 6.13, Interrupt Masks for a detailed description of the parameter
Param for each interrupt.
One event can be associated with each controller interrupt. All events are handled in the main
application thread, therefore the application execution is stopped until the event is handled.
To disable a specific event, call the DisableEvent method with the parameter Interrupt equal
to the specified interrupt type.
If the method fails, the Error object is filled with the error description.
Note
The method can be used only with the PCI communication channel or
the Simulator.
Before the PEG interrupts can be detected, the AssignPins method
must be called.
Example
'Sub EnableEvent_Sample()
Private Sub ChWithEvents_ACSPLPROGRAM(ByVal Param As Long)
MsgBox "Parameter=" & Param, vbExclamation, "ACSPLPROGRAM"
End Sub
5.34 EnableFault
The method enables the specified axis or system fault.
Syntax
object.EnableFault(Axis, Fault)
Parameters
Name Type Description
Return Value
None.
Remarks
The method enables the examination and processing of the specified motor or system fault by
setting the specified bit of the fault mask to one.
The motor faults are related to a specific motor, the power amplifier, and the Servo processor.
For example: Position Error, Encoder Error, and Driver Alarm.
The system faults are not related to any specific motor. For example: Emergency Stop, Memory
Fault.
For more information about the controller faults, see SPiiPlus ACSPL+ Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub EnableFault_Sample()
On Error GoTo except
'Enable fault Right Limit of axis X
Call Ch.EnableFault(Ch.ACSC_AXIS_X, Ch.ACSC_SAFETY_RL)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.35 EnableM
The method activates several motors.
Syntax
object.EnableM(Axes)
Parameters
Name Type Description
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Return Value
None.
Remarks
The method activates several motors. After the activation, the motors begin to follow the
corresponding reference and physical motions for the specified motors are available.
If the method fails, the Error object is filled with the error description.
Example
Sub EnableM_Sample()
Dim Axes(2)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
On Error GoTo except
'Enable of axes X and Y
Call Ch.EnableM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.36 EnableResponse
The method enables the response to the specified axis or system fault.
Syntax
object.EnableResponse(Axis, Response)
Parameters
Name Type Description
Axis [in] long The parameter specifies the axis (ACSC_AXIS_X
corresponds to X, ACSC_AXIS_Y – to Y etc.) to
enable the response to the specified motor fault, or
ACSC_NONE to enable the response to the specified
system fault.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Response [in] long The default response to be enabled. Only one default
response can be enabled at a time.
To specify the default response, one of the properties
ACSC_SAFETY_*** can be used. See Section 6.11,
Safety Control Masks for a detailed description of
these properties.
Return Value
None.
Remarks
The method enables the default response to the specified axis or system fault by setting the
specified bit of the response mask to one.
The default response is a controller-predefined action for the corresponding fault. For more
information about the controller faults and default responses, see SPiiPlus ACSPL+
Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub EnableResponse_Sample()
On Error GoTo except
'Enable the default response to the
'Position Error fault of axis X
Call Ch.EnableResponse(Ch.ACSC_AXIS_X, Ch.ACSC_SAFETY_PE)
Exit Sub
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
except:
5.37 EndSequence
The method informs the controller that no more points will be specified for the current single-
axis motion.
Syntax
object.EndSequence(Axis)
Parameters
Name Type Description
Axis [in] long [in] Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Return Value
None.
Remarks
The motion finishes when the EndSequence method is executed. If the call of EndSequence
is omitted, the motion will stop at the last point of the sequence and wait for the next point. No
transition to the next motion in the motion queue will occur until the EndSequence method
executes.
The method waits for the controller response.
This method applies to the single-axis multi-point or spline (arbitrary path) motions.
If the method fails, the Error object is filled with the error description.
Example
Sub EndSequence_Sample()
Dim Index As Long
On Error GoTo except
'Enable axis X
Call Ch.Enable(Ch.ACSC_AXIS_X)
'Wait till axis X is enabled during 5 sec
Call Ch.WaitMotorEnabled(Ch.ACSC_AXIS_X, 1, 5000)
'Create multi-point motion with default
'velocity and dwell 1 ms
5.38 EndSequenceM
The method informs the controller that no more points or segments will be specified for the
current multi-axis motion.
Syntax
object.EndSequence(Axes)
Parameters
Name Type Description
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Return Value
None.
Remarks
The motion finishes when the EndSequenceM method is executed. If the call of
EndSequenceM is omitted, the motion will stop at the last point or segment of the sequence
and wait for the next point. No transition to the next motion in the motion queue will occur until
the EndSequenceM method executes.
The method waits for the controller response.
This method applies to the multi-axis multi-point, spline (arbitrary path) and segmented
motions.
If the method fails, the Error object is filled with the error description.
Example
Sub EndSequenceM_Sample()
Dim Index As Long
Dim Points(1)
Dim Axes(2)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
On Error GoTo except
'Enable axes X and Y
Call Ch.EnableM(Axes)
'Create multi-point motion with default
'velocity without dwell in the points
Call Ch.MultiPointM(0, Axes, 0)
'Add some points
For Index = 0 To 5
Points(0) = 100 * Index
Points(1) = 100 * Index
Call Ch.AddPointM(Axes, Points)
Next Index
'Finish the motion
'End of the multi-point motion of axes X
and
'Y
Call Ch.EndSequenceM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.39 ExtAddPoint
The method adds a point to a single-axis multi-point or spline motion and specifies a specific
velocity or motion time.
Syntax
object.ExtAddPoint(Axis, Point, Rate)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Point [in] double Coordinate of the added point.
Rate [in] double If the motion was activated by the MultiPoint method
with the ACSC_AMF_VELOCITY flag, this
parameter defines the motion velocity.
If the motion was activated by the Spline method with
the ACSC_AMF_VARTIME flag, this parameter
defines the time interval between the previous point
and the present one.
Return Value
None.
Remarks
The method adds a point to a single-axis multi-point motion with specific velocity or to single-
axis spline motion with a non-uniform time.
To add a point to a multi-axis motion, use ExtAddPointM. To add a point to a motion with
default velocity or uniform time interval, the AddPoint and MAddPointM methods are more
convenient.
The method waits for the controller response.
The controller response indicates that the command was accepted and the point is added to the
motion buffer. The point can be rejected if the motion buffer is full. In this case, you can call
this method periodically until the method returns a non-zero value.
If the method fails, the Error object is filled with the error description.
Example
Sub ExtAddPoint_Sample()
On Error GoTo except
'Enable axis X
Call Ch.Enable(Ch.ACSC_AXIS_X)
'Wait till axis X is enabled during 5 sec
Call Ch.WaitMotorEnabled(Ch.ACSC_AXIS_X, 1, 5000)
'Create multi-point motion uses the
velocity
'specified with each point with dwell 1
ms
Call Ch.MultiPoint(Ch.ACSC_AMF_VELOCITY, Ch.ACSC_AXIS_X, 1)
'Add some points
For Index = 0 To 5
'Adds points to axis X, defines a motion
'velocity of 5000
Call Ch.ExtAddPoint(Ch.ACSC_AXIS_X, 100 * Index, 5000)
Next Index
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequence(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual BasicEnd Sub
5.40 ExtAddPointM
Adds a point to a multi-axis multi-point or spline motion and specifies a specific velocity or
motion time.
Syntax
object.ExtAddPointM(Axes, Point, Rate)
Parameters
Name Type Description
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Point [in] variant Array of the coordinates of added point. The number
and order of values must correspond to the Axes array.
The Point must specify a value for each element of
Axes except the last –1 element.
Rate [in] double If the motion was activated by the MultiPoint method
with the ACSC_AMF_VELOCITY flag, this
parameter defines as motion velocity.
If the motion was activated by the Spline method with
the ACSC_AMF_VARTIME flag, this parameter
defines as time interval between the previous point and
the present one.
Return Value
None.
Remarks
The method adds a point to a multi-axis multi-point or spline motion. To add a point to a single-
axis motion, useExtAddPoint. To add a point with to a motion with default velocity or uniform
time interval the ExtAddPoint and ExtAddPointM methods are more convenient.
The method waits for the controller response.
The controller response indicates that the command was accepted and the point is added to the
motion buffer. The point can be rejected if the motion buffer is full. In this case, you can call
this method periodically until the method returns a non-zero value.
All axes specified in the Axes array must be specified before calling the MultiPointM or
SplineM methods. The number and order of the axes in the Axes array must correspond exactly
to the number and order of the axes of MultiPointM or SplineM methods.
If the method fails, the Error object is filled with the error description.
Example
Sub ExtAddPointM_Sample()
Dim Index As Long
Dim Points(1)
Dim Axes(2)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
On Error GoTo except
'Enable axes X and Y
Call Ch.EnableM(Axes)
'Create multi-point motion uses the
velocity
'specified with each point without dwell
in
'the points
Call Ch.MultiPointM(Ch.ACSC_AMF_VELOCITY, Axes, 0)
'Add some points
For Index = 0 To 5
Points(0) = 100 * Index
Points(1) = 100 * Index
'Adds points to axes XY, defines a
motion
'velocity of 5000
Call Ch.ExtAddPointM(Axes, Points, 5000)
Next Index
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequenceM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.41 ExtArc1
Adds an arc segment to a segmented motion and specifies the coordinates of the center point,
the coordinates of the final point, the direction of rotation, and the vector velocity for the current
segment.
Syntax
object.ExtArc1(Axes, Center, FinalPoint, Rotation, Velocity)
Parameters
Name Type Description
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Center [in] variant Array of the center coordinates. The number and order
of values must correspond to the Axes array. The
Center must specify a value for each element of Axes
except the last –1 element.
FinalPoint [in] variant Array of the final point coordinates. The number and
order of values must correspond to the Axes array. The
FinalPoint must specify a value for each element of
Axes except the last –1 element.
Rotation [in] long This parameter defines the direction of rotation. If
Rotation is set to ACSC_COUNTERCLOCKWISE,
then the rotation is counterclockwise; if Rotation is set
to ACSC_CLOCKWISE, then rotation is clockwise.
Velocity [in] double If the motion was activated by the Segment method
with the ACSC_AMF_VELOCITY flag, this
parameter specifies a motion velocity for current
segment.
Return Value
None.
Remarks
The method adds an arc segment to the segmented motion and specifies the coordinates of the
center point, the coordinates of the final point, the direction of rotation, and the vector velocity
for the current segment. To add an arc segment with default velocity, use Arc1.
All axes specified in the Axes array must be specified before calling the Segment method. The
number and order of the axes in the Axes array must correspond exactly to the number and
order of the axes of Segment method.
The parameter Center specifies the coordinates of the arc center. The parameter FinalPoint
specifies the coordinates of the final point. All coordinates are absolute in the plane.
The method waits for the controller response.
The controller response indicates that the command was accepted and the segment is added to
the motion buffer. The segment can be rejected if the motion buffer is full. In this case, you can
call this method periodically until the method returns non-zero value.
If the method fails, the Error object is filled with the error description.
Example
Sub ExtArc1_Sample()
'The path of the specified segmented
motion
'is circle
'for each semicircle the different
'vector velocity is used
Dim Points(1) As Double
Dim Center(1) As Double
Dim Axes(2)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
On Error GoTo except
'Create segmented motion, coordinates of
the
'initial points are (1000,1000)
Points(0) = 1000
Points(1) = 1000
'Enable axes XY
Call Ch.EnableM(Axes)
Call Ch.Segment(Ch.ACSC_AMF_VELOCITY, Axes, Points)
'Describe circle with center (1000, 0),
'final point (1000, -1000), clockwise
'rotation with vector velocity 25000
Center(0) = 1000
Center(1) = 0
Points(0) = 1000
Points(1) = -1000
Call Ch.ExtArc1(Axes, Center, Points, Ch.ACSC_CLOCKWISE, 25000)
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequenceM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.42 ExtArc2
The method adds an arc segment to a segmented motion and specifies the coordinates of the
center point, the rotation angle, and the vector velocity for the current segment.
Syntax
object.ExtArc2(Axes, Center, Angle, Velocity)
Parameters
Name Type Description
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Center [in] variant Array of the center coordinates. The number and order
of values must correspond to the Axes array. The
Center must specify a value for each element of Axes
except the last –1 element.
Angle [in] double Rotation angle in radians. Positive angle for
counterclockwise rotation, negative for clockwise
rotation.
Velocity [in] double If the motion was activated by the Segment method
with the ACSC_AMF_VELOCITY flag, this
parameter specifies a motion velocity for current
segment.
Return Value
None.
Remarks
The method adds an arc segment to the segmented motion and specifies the coordinates of the
center point, the rotation angle, and the vector velocity for the current segment. To add an arc
segment with default velocity, use Arc2.
All axes specified in the Axes array must be specified before the call of the Segment method.
The number and order of the axes in the Axes array must correspond exactly to the number and
order of axes of the Segment method.
The parameter Center specifies the coordinates of the arc center. The coordinates are absolute
in the plane.
The method waits for the controller response.
The controller response indicates that the command was accepted and the segment is added to
the motion buffer. The segment can be rejected if the motion buffer is full. In this case, you can
call this method periodically until the method returns a non-zero value.
If the method fails, the Error object is filled with the error description.
Example
Sub ExtArc2_Sample()
'The path of the specified segmented
motion
'is circle
'for each semicircle the different
vector
'velocity is used
Dim Points(1) As Double
Dim Center(1) As Double
Dim Axes(2)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
On Error GoTo except
'Create segmented motion, coordinates of
the
'initial point are (1000,1000)
Points(0) = 1000
Points(1) = 1000
'Enable axes X and Y
Call Ch.EnableM(Axes)
Call Ch.Segment(Ch.ACSC_AMF_VELOCITY, Axes, Points)
'Describe circle with center (1000, 0),
'final point (1000, 1000),
'Semicircle
Center(0) = 1000
Center(1) = 0
Call Ch.ExtArc2(Axes, Center, 3.141529, 25000)
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequenceM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.43 ExtLine
Adds a linear segment to a segmented motion and specifies a motion velocity.
Syntax
object.ExtLine(Axes, Point, Velocity)
Parameters
Name Type Description
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Point [in] variant Array of the final point coordinates. The number and
order of values must correspond to the Axes array. The
Point must specify a value for each element of Axes
except the last –1 element.
Velocity [in] double If the motion was activated by the Segment method
with the ACSC_AMF_VELOCITY flag, this
parameter specifies a motion velocity for current
segment.
Return Value
None.
Remarks
The method adds a linear segment to the segmented motion and specifies a motion velocity for
the current segment. To add a linear segment with a default velocity, use Line1. All axes
specified in the Axes array must be specified before the call of the Segment method. The
number and order of the axes in the Axes array must correspond exactly to the number and
order of the axes of the Segment method.
The parameter Point specifies the coordinates of the final point. The coordinates are absolute
in the plane.
The method waits for the controller response.
The controller response indicates that the command was accepted and the segment is added to
the motion buffer. The segment can be rejected if the motion buffer is full. In that case, you can
call this method periodically until the method returns a non-zero value.
If the method fails, the Error object is filled with the error description.
Example
Sub ExtLine_Sample()
'The path of the specified segmented
motion
'is square. For each side of the square
the
'non-default vector velocity is used
5.44 ExtToPoint
Initiates a single-axis motion to the specified point using the specified velocity or end velocity.
Syntax
object.ExtToPoint(Flags, Axis, Point, Velocity, EndVelocity)
Parameters
Name Type Description
Flags [in] long Bit-mapped parameter that can include one or more of
the following flags:
• ACSC_AMF_WAIT: plan the motion but don't
start it until the method Go is executed.
• ACSC_AMF_RELATIVE: the Point value is
relative to the end point of the previous motion. If
the flag is not specified, the Point specifies an
absolute coordinate.
• ACSC_AMF_VELOCITY: the motion will use
velocity specified by the Velocity argument instead
of the default velocity.
• ACSC_AMF_ENDVELOCITY: the motion will
come to the end point with the velocity specified by
the EndVelocity argument.
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Point [in] double Coordinate of the target point.
Velocity [in] double Motion velocity. The argument is used only if the
ACSC_AMF_VELOCITY flag is specified.
EndVelocity [in] double Velocity in the target point. The argument is used only
if the ACSC_AMF_ENDVELOCITY flag is specified.
Otherwise, the motion finishes with zero velocity.
Return Value
None.
Remarks
The method initiates a single-axis point-to-point motion.
If the ACSC_AMF_VELOCITY flag is specified, the motion is executed using the velocity
specified by the Velocity argument. Otherwise, the required motion velocity is used. The
required motion velocity is the velocity specified by the previous call of SetVelocity, or the
default velocity if the method was not called.
If the ACSC_AMF_ENDVELOCITY flag is specified, the motion velocity at the final point is
specified by the EndVelocity argument. Otherwise, the motion velocity at the final point is
zero.
To execute a multi-axis point-to-point motion with the specified velocity or end velocity, use
ExtAddPointM. To execute motion with default motion velocity and zero end velocity, use
ToPoint or ToPointM.
The controller response indicates that the command was accepted and the motion was planned
successfully. The method does not wait for the motion end. To wait for the motion end, use
WaitMotionEnd.
The motion builds the velocity profile using the required values of acceleration, deceleration
and jerk of the specified axis.
If the method fails, the Error object is filled with the error description.
Example
Sub ExtToPoint_Sample()
On Error GoTo except
'Enable axis X
Call Ch.Enable(Ch.ACSC_AXIS_X)
'Wait untill axis X is disabled for 5 sec
Call Ch.WaitMotorEnabled(Ch.ACSC_AXIS_X, 1, 5000)
'Parameters: Ch.ACSC_AMF_VELOCITY Or
'Ch.ACSC_AMF_ENDVELOCITY -
'Start up the motion with specified
velocity
'5000
'Come to the end point with specified
'velocity 1000
'Ch.ACSC_AXIS_X - axis X
'10000 - target point
'5000 - motion velocity
'1000 - velocity in the target point
Call Ch.ExtToPoint(Ch.ACSC_AMF_VELOCITY Or Ch.ACSC_AMF_ENDVELOCITY,
Ch.ACSC_AXIS_X, 10000, 5000, 1000)
'Wait motion ends during 20 sec
Call Ch.WaitMotionEnd(Ch.ACSC_AXIS_X, 20000)
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequence(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.45 ExtToPointM
The method initiates a multi-axis motion to the specified point using the specified velocity or
end velocity.
Syntax
object.ExtToPointM(Flags, Axes, Point, Velocity, EndVelocity)
Parameters
Name Type Description
Flags [in] long Bit-mapped parameter that can include one or more of
the following flags:
• ACSC_AMF_WAIT: plan the motion but don't
start it until the method Go is executed.
• ACSC_AMF_RELATIVE: the Point values are
relative to the end of the previous motion. If the flag
is not specified, the Point specifies absolute
coordinates.
• ACSC_AMF_VELOCITY: the motion will use
velocity specified by the Velocity argument instead
of the default velocity.
• ACSC_AMF_ENDVELOCITY: the motion will
come to the end with the velocity specified by the
EndVelocity argument.
• ACSC_AMF_MAXIMUM: not to use the motion
parameters from the leading axis but to calculate
the maximum allowed motion velocity,
acceleration, deceleration and jerk of the involved
axes.
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Point [in] variant Array of the target coordinates. The number and order
of values must correspond to the Axes array. The Point
must specify a value for each element of Axes except
the last –1 element.
Velocity [in] double Motion vector velocity. The argument is used only if
the ACSC_AMF_VELOCITY flag is specified.
EndVelocity [in] double Vector velocity in the target point. The argument is
used only if the ACSC_AMF_ENDVELOCITY is
specified. Otherwise, the motion finishes with zero
velocity.
Return Value
None.
Remarks
The method initiates a multi-axis point-to-point motion.
If the ACSC_AMF_VELOCITY flag is specified, the motion is executed using the velocity
specified by the Velocity argument. Otherwise, the required motion velocity is used. The
required motion velocity is the velocity specified by the previous call of the SetVelocity
method, or the default velocity if the method was not called.
If the ACSC_AMF_ENDVELOCITY flag is specified, the motion velocity at the final point is
specified by the EndVelocity argument. Otherwise, the motion velocity at the final point is
zero.
To execute a single-axis point-to-point motion with the specified velocity or end velocity, use
ExtToPoint. To execute a motion with default motion velocity and zero end velocity, use
ToPoint or ToPointM.
The controller response indicates that the command was accepted and the motion was planned
successfully. The method does not wait for the motion end. To wait for the motion end, use the
WaitMotionEnd method.
The motion builds the velocity profile using the required values of acceleration, deceleration
and jerk of the leading axis. The leading axis is the first axis in the Axes array.
If the method fails, the Error object is filled with the error description.
Example
Sub ExtToPointM_Sample()
Dim Index As Long
Dim Points(1) As Double
Dim Axes(2)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
Points(0) = 1000
Points(1) = 2000
On Error GoTo except
'Enable axes X and Y
Call Ch.EnableM(Axes)
'Parameters: Ch.ACSC_AMF_VELOCITY Or
'Ch.ACSC_AMF_ENDVELOCITY -
'Start up the motion with specified velocity
‘5000
5.46 FaultClear
The method clears the current faults and the result of the previous fault stored in the
MERR variable.
Syntax
object.FaultClear(Axis)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
None.
Remarks
The method clears the current faults of the specified axis and the result of the previous fault
stored in the MERR variable.
If the method fails, the Error object is filled with the error description.
Example
Sub FaultClear_Sample()
Dim result As Long
On Error GoTo except
'Clears the current faults and results
of
'previous faults stored in the MERR
variable
'of axis X
Call Ch.FaultClear(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.47 FaultClearM
The method clears the current faults and results of previous faults stored in the MERR variable
for multiple axis.
Syntax
object.FaultClearM(Axes)
Parameters
Name Type Description
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Return Value
None.
Remarks
If the reason for the fault is still active, the controller will set the fault immediately after this
command is performed. If cleared fault is Encoder Error, the feedback position is reset to zero.
If the method fails, the Error object is filled with the error description.
Example
Sub FaultClearM_Sample()
Dim Axes(2)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
On Error GoTo except
'Clears the current faults and results
of
'previous faults stored in the MERR
variable
'of axes XY
Call Ch.FaultClearM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.48 FlushLogFile
The method allows flushing the User-Mode Driver (UMD) internal binary buffer to a specified
text file, from a user application.
Syntax
object.FlushLogFile(string[in] FileName)
Parameters
Name Type Description
FileName [in] string String that specifies the file name.
Return Value
None.
Remarks
If Continuous Log is active, the function will fail.
Example
Sub FlushLogFile()
Dim
On Error GoTo except
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.49 GetAcceleration
The method retrieves a value of motion acceleration.
Syntax
object.GetAcceleration(Axis)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
Long.
The method retrieves the value of the motion acceleration.
Remarks
The retrieved value is either the value defined by a previous call of the SetAcceleration method
or the default value if there was no previous call of SetAcceleration.
If the method fails, the Error object is filled with the error description.
Example
Sub GetAcceleration_Sample()
Dim Acceleration As Double
On Error GoTo except
'Get acceleration of axis X
Acceleration = Ch.GetAcceleration(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.50 GetACSCHandle
The method Retrieves the SPiiPlus C Library communication handle.
Syntax
object.GetACSCHandle()
Parameters
None.
Return Value
Long.
Remarks
The method retrieves the SPiiPlus C Library communication handle.
If the method fails, the Error object is filled with the error description.
Example
Sub GetACSCHandle_Sample()
Dim Handle
On Error GoTo except
'Retrieves communication handle
Handle = Ch.GetACSCHandle()
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.51 GetAnalogInput
The method retrieves the current numerical value of the specified analog inputs.
Syntax
object.GetAnalogInput(Port)
Parameters
Name Type Description
Port [in] long Number of the analog inputs port.
Return Value
Long.
Remarks
The method retrieves the current numerical value of the specified analog inputs.
Analog inputs are represented in the controller variable AIN. For more information about analog
inputs, see SPiiPlus ACSPL+ Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub GetAnalogInput_Sample()
Dim Index
Dim Port(15) As Double
On Error GoTo except
For Index = 0 To 15
'The method reads analog inputs of
'port 0 to 15 ( AIN(0)-AIN(15) )
Port(Index) = Ch.GetAnalogInput(Index)
Next Index
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.52 GetAnalogOutput
The method retrieves the current numerical value of the specified analog outputs.
Syntax
object.GetAnalogOutput(Port)
Parameters
Name Type Description
Port [in] long Number of the output port.
Return Value
Long.
Remarks
The method retrieves the current numerical value of the specified analog outputs. To write a
value to the specific analog outputs, use the SetAnalogOutput method.
Analog outputs are represented in the controller variable AOUT. For more information about
analog outputs, see SPiiPlus ACSPL+ Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub GetAnalogOutput_Sample()
Dim Index
Dim Port(15) As Long
On Error GoTo except
For Index = 0 To 15
'The method reads analog outputs of port
0
'to 15 ( AOUT(0)-AOUT(15) )
Port(Index) = Ch.GetAnalogOutput(Index)
Next Index
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.53 GetAxisState
The method retrieves the current axis state.
Syntax
object.GetAxisState(Axis)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
Long.
The method retrieves the current axis state.
Remarks
The return value can be comprised of one or more flags. For example, ACSC_AST_LEAD
(leading axis), ACSC_AST_DC (data collection in progress for the axis), etc. See the complete
list of flags, see Section 6.8, Axis State Flags.
If the method fails, the Error object is filled with the error description.
Example
Sub GetAxisState_Sample()
Dim State As Long
On Error GoTo except
'Retrieves the current axis state
State = Ch.GetAxisState(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.54 GetCOMLibraryVersion
The method retrieves the SPiiPlus COM Library version number.
Syntax
object.GetCOMLibraryVersion()
Parameters
None.
Return Value
Long.
The method retrieves the SPiiPlus COM Library version number.
Remarks
The SPiiPlus COM Library version consists of four (or less) numbers separated by points:
#.#.#.#. The binary version number is represented by 32-bit unsigned integer value. Each byte
of this value specifies one number in the following order: high byte of high word – first number,
low byte of high word – second number, high byte of low word – third number and low byte of
low word – forth number. For example the version “2.10” has the following binary
representation (hexadecimal format): 0x020A0000.
The first two numbers in the string form are obligatory. Any release version of the library
consists of two numbers. The third and fourth numbers specify an alpha or beta version, special
or private build, etc.
If the method fails, the Error object is filled with the error description.
Example
Sub GetCOMLibraryVersion_Sample()
Dim LVersion As Double
On Error GoTo except
'Retrieves the SPiiPlus COM Library
version
'number.
LVersion = Ch.GetCOMLibraryVersion
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.55 GetCommOptions
The method retrieves the communication options.
Syntax
object.GetCommOptions()
Parameters
None.
Return Value
Long.
The method retrieves the current communication options.
Remarks
To set the communication options call SetCommOptions.
The return value is bit-mapped to represent the current communication options. Currently only
the following option flag is supported:
ACSC_COMM_USE_CHECKSUM - communication mode when each command sends to the
controller with checksum and the controller responds with checksum.
If the method fails, the Error object is filled with the error description.
Example
Sub GetCommOptions_Sample()
Dim Options As Double
On Error GoTo except
'Retrieves the current communication
options
Options = Ch.GetCommOptions
Options = Options Or Ch.ACSC_COMM_USE_CHECKSUM
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.56 GetConf
The method reads system configuration data.
Syntax
object.GetConf(Key, Index)
Parameters
Name Type Description
Key [in] long Configuration Keys (see Section 6.14) specify the
configured feature. Assigns value of the key argument
in ACSPL+ GetConf method.
Index [in] long Specifies corresponding axis or buffer number.
Assigns value of index argument in ACSPL+ GetConf
method.
Return Value
Double.
The method reads system configuration data.
Remarks
The Key parameter specifies the feature number and the Index parameter defines axis or buffer
to which it should be applied. For detailed description of system configuration see “SPiiPlus
ACSPL+ Programmer’s Guide” getconf definition.
If the method fails, the Error object is filled with the error description.
Example
Sub GetConf_Sample()
Dim GetC As Double
On Error GoTo except
'Reads system configuration data of axis
X
'with key 205
GetC = Ch.GetConf(Ch.ACSC_CONF_DIGITAL_SOURCE_KEY, Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.57 GetDeceleration
The method retrieves a value of motion deceleration.
Syntax
object.GetDeceleration(Axis)
Parameters
Return Value
Double.
The method retrieves the value of the motion deceleration.
Remarks
The retrieved value is either the value defined by a previous call of the SetDeceleration method
or the default value if SetDeceleration was not previously called.
If the method fails, the Error object is filled with the error description.
Example
Sub GetDeceleration_Sample()
Dim Deceleration As Double
On Error GoTo except
'Retrieves a value of motion
deceleration
Deceleration = Ch.GetDeceleration(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.58 GetDefaultTimeout
The method retrieves default communication timeout.
Syntax
object.GetDefaultTimeout()
Parameters
None.
Return Value
Long.
Remarks
The value of the default timeout depends on the type of the established communication channel.
Timeout depends also on the baud rate value for serial communication.
If the method fails, the Error object is filled with the error description.
Example
Sub GetDefaultTimeout_Sample()
Dim TimeOut As Double
On Error GoTo except
'Retrieves default communication
timeout
TimeOut = Ch.GetDefaultTimeout
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.59 GetEthernetCards
The method retrieves all SPiiPlus controller IP addresses within a local domain through a
standard Ethernet comunication protocol.
Syntax
object.GetEthernetCards(variant) [out] arrIPAddress, string [in,optional]
BroadvcastAddress
Parameters
Name Type Description
arrIPAddress [out] variant Array of stringd with the returned IP addresses
of the controllers
BroadcastAddress [in, optional] string String containing the broadcast mask address.
Optional parameter - can be omitted.
Return Value
Long.
The method returns the number of cards found or zero if no cards are detected.
Remarks
If more than one controller card is detected, the method initializes arrIPAddress variant as an
array, where each element is a string that specifies the IP address returned by a controller card.
If no controller card is detected, the method returns zero and does not assign values to the
arrIPAddress paramters.
Example
Sub GetEthernetCards()
Dim
On Error GoTo except
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.60 GetErrorString
The method retrieves the explanation of an error code.
Syntax
object.GetErrorString(ErrorCode)
Parameters
Name Type Description
ErrorCode [in] long An error code returned by the following methods:
ParseCOMErrorCode
GetMotorError
GetMotionError
GetProgramError
Return Value
String.
The method retrieves the string that contains the text explanation of the error code returned by
the ParseCOMErrorCode, GetMotorError, GetMotionError, and GetProgramError
methods.
Remarks
If the error relates to SPiiPlus COM Library, the method returns immediately with the text
explanation. If the error relates to the controller, the method receives the text explanation from
the controller.
If the method fails, the Error object is filled with the error description.
Example
Sub GetErrorString_Sample()
Dim Str As String
On Error GoTo except
'The method retrieves the explanation of
'an error code 3260.
Str = Ch.GetErrorString(3260)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.61 GetExtInput
The method retrieves the current state of the specified extended input.
Syntax
object.GetExtInput(Port, Bit)
Parameters
Name Type Description
Port [in] long Number of the extended input port.
Bit [in] long Number of the specific bit.
Return Value
Long.
The method retrieves the current state (0 or 1) of the extended input specified by Port and Bit.
Remarks
To get that states for all the inputs of the specific extended Port, use the GetExtInputPort
method.
Extended inputs are represented in the controller variable EXTIN. For more information about
extended inputs, see SPiiPlus ACSPL+ Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub GetExtInput_Sample()
'The method reads extended input 0 of
port 0
'( EXTIN(0).0 )
Dim Port As Long
On Error GoTo except
Port = Ch.GetExtInput(0, 0)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.62 GetExtInputPort
The method retrieves the current state of the specified extended input port.
Syntax
object.GetExtInputPort(Port)
Parameters
Name Type Description
Port [in] long Number of the extended input port.
Return Value
Long.
The method retrieves the current state of the specified extended input port.
Remarks
To get the value of a specific input of the specific extended port, use the GetExtInput method.
Extended inputs are represented in the controller variable EXTIN. For more information about
extended inputs, see SPiiPlus ACSPL+ Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub GetExtInputPort_Sample()
'The method reads extended input port 0
to
'15 ( EXTIN(0) to EXTIN(15) )
Dim Index As Long
Dim Port(15) As Long
On Error GoTo except
For Index = 0 To 15
Port(Index) = Ch.GetExtInputPort(Index)
Next Index
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.63 GetExtOutput
The method retrieves the current state of the specified extended output.
Syntax
object.GetExtOutput(Port, Bit)
Parameters
Name Type Description
Port [in] long Number of the extended output port.
Bit [in] long Number of the specific bit.
Return Value
Long.
The method retrieves the current state (0 or 1) of the specified extended output.
Remarks
To get values of all outputs of the specific extended port, use the GetExtOutputPort method.
Extended outputs are represented in the controller variable EXTOUT. For more information
about extended outputs, see SPiiPlus ACSPL+ Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub GetExtOutput_Sample()
'The method reads extended output 0 of
port
'0 ( EXTOUT(0).0 )
Dim Port As Long
On Error GoTo except
Port = Ch.GetExtOutput(0, 0)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.64 GetExtOutputPort
The method retrieves the current state of the specified extended output port.
Syntax
object.GetExtOutputPort(Port)
Parameters
Name Type Description
Port [in] long Number of the extended output port.
Return Value
Long.
The method retrieves the current state (0 or 1) of the specified extended output port.
Remarks
To get the value of the specific output of the specific extended port, use the GetExtOutput
method.
Extended outputs are represented in the controller variable EXTOUT. For more information
about extended outputs, see SPiiPlus ACSPL+ Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub GetExtOutputPort_Sample()
'The method reads extended output port 0
(
'EXTOUT(0) )
Dim Index As Long
Dim Port(15) As Double
On Error GoTo except
For Index = 0 To 15
Port(Index) = Ch.GetExtOutputPort(Index)
Next Index
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.65 GetFault
The method retrieves the set of bits that indicate the motor or system faults.
Syntax
object.GetFault(Axis)
Parameters
Name Type Description
Axis [in] long The parameter specifies the axis (ACSC_AXIS_X
corresponds to X, ACSC_AXIS_Y – to Y etc.) to
receive the motor faults or ACSC_NONE to receive the
system faults.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Return Value
Long.
The method retrieves the set of bits that indicate motor or system faults.
Remarks
The motor faults are related to a specific motor, the power amplifier, and the Servo processor.
For example: Position Error, Encoder Error, or Driver Alarm.
The system faults are not related to any specific motor. For example: Emergency Stop or
Memory Fault.
The parameter Fault receives the set of bits that indicates the controller faults. To recognize the
specific fault, properties ACSC_SAFETY_*** can be used. See Section 6.11, Safety Control
Masks for a detailed description of these properties.
For more information about the controller faults, see the SPiiPlus ACSPL+ Programmer’s
Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub GetFault_Sample()
Dim Fault As Long
On Error GoTo except
'Retrieves the set of bits that indicate
the
'motor or system faults
Fault = Ch.GetFault(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.66 GetFaultMask
The method retrieves the mask that defines which controller faults are examined and processed.
Syntax
object.GetFaultMask(Axis, Mask)
Parameters
Name Type Description
Axis [in] long The parameter specifies the axis (ACSC_AXIS_X
corresponds to X, ACSC_AXIS_Y – to Y etc.) to get
the motor faults mask, or ACSC_NONE to get the
system faults mask.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Return Value
Long.
The method retrieves the mask that defines which controller faults are examined and processed.
Remarks
If a bit of the mask is zero, the corresponding fault is disabled.
Use the ACSC_SAFETY_*** properties to examine a specific bit. See Section 6.11, Safety
Control Masks for a detailed description of these properties.
Controller faults are of two types: motor faults and system faults.
The motor faults are related to a specific motor, the power amplifier or the Servo processor. For
example: Position Error, Encoder Error or Driver Alarm.
The system faults are not related to any specific motor, for example: Emergency Stop or
Memory Fault.
For more information about the controller faults, see the SPiiPlus ACSPL+ Programmer’s
Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub GetFaultMask_Sample()
Dim Mask As Long
On Error GoTo except
'Retrieves the mask that defines which
'controller
'Faults are examined and processed of
axis X
Mask = Ch.GetFaultMask(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.67 GetFirmwareVersion
The method retrieves the firmware version of the controller.
Syntax
object.GetFirmwareVersion()
Parameters
None
Return Value
String.
Remarks
If the method fails, the Error object is filled with the error description.
Example
Sub GetFirmwareVersion_Sample()
Dim Firm As String
On Error GoTo except
'Retrieves the firmware version of the
'controller
Firm = Ch.GetFirmwareVersion()
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.68 GetFPosition
The method retrieves the current value of the motor feedback position.
Syntax
object.GetFPosition(Axis)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
Double.
The method retrieves an instant value of the motor feedback position.
Remarks
The feedback position is a measured position of the motor transferred to user units.
If the method fails, the Error object is filled with the error description.
Example
Sub GetFPosition_Sample()
Dim FPosition As Double
On Error GoTo except
'Retrieves an instant value of the motor
'feedback position
FPosition = Ch.GetFPosition(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.69 GetFVelocity
The method retrieves the instantaneous value of the motor feedback velocity. Unlike
GetVelocity, this method retrieves the actually measured velocity and not the required value.
Syntax
object.GetFVelocity(Axis)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
Double.
Remarks
The feedback velocity is a measured velocity of the motor transferred to user units.
If the method fails, the Error object is filled with the error description.
Example
Sub GetFVelocity_Sample()
Dim FVelocity As Double
On Error GoTo except
'Retrieves an instant value of the motor
'feedback velocity
FVelocity = Ch.GetFVelocity(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.70 GetHistory
The method retrieves the contents of the history buffer.
Syntax
object.GetHistory(bClear)
Parameters
Name Type Description
bClear [in] Boolean If TRUE, the method clears contents of the history
buffer.
If FALSE, the history buffer content is not cleared.
Return Value
String.
The method retrieves the communication history from the history buffer.
Remarks
The communication history includes all commands sent to the controller and all responses and
unsolicited messages from the controller. The amount of history data is limited by the size of
the history buffer. The history buffer works as a cyclic buffer: when the amount of the stored
data exceeds the buffer size, the newly stored data overwrites the earliest data in the buffer.
Therefore, as a rule, the retrieved communication history includes only recent commands,
responses and unsolicited messages. The depth of the retrieved history depends on the history
buffer size.
The history data is retrieved in historical order, i.e. the earliest message is stored at the
beginning of the returned string. The beginning of the return string might be incomplete, if it
has been partially overwritten in the history buffer.
If the method fails, the Error object is filled with the error description.
Example
Sub GetHistory_Sample()
Dim Str As String
On Error GoTo except
'The method opens a history buffer
'size of the buffer is 5000
Call Ch.OpenHistoryBuffer(5000)
'Sending the command "enable x"
Call Ch.Send("enable x")
'The method retrieves the contents of
the
'history buffer.
Str = Ch.GetHistory(False)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.71 GetIndexState
The method retrieves the current set of bits that indicate the index and mark state.
Syntax
object.GetIndexState(Axis)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
Long.
The method retrieves the current set of bits that indicate the index and mark state.
Remarks
The return value can include one or more of the following flags:
• ACSC_IST_IND – a primary encoder index of the specified axis is latched
• ACSC_IST_IND2 – a secondary encoder index of the specified axis is latched
• ACSC_IST_MARK – a MARK1 signal has been generated and position of the specified
axis was latched
• ACSC_IST_MARK2 – a MARK2 signal has been generated and position of the specified
axis was latched
The controller processes index/mark signals as follows:
When an index/mark signal is encountered for the first time, the controller latches feedback
positions and raises the corresponding bit. As long as a bit is raised, the controller does not latch
feedback position even if the signal occurs again. To resume latching logic, the application must
call ResetIndexState to explicitly reset the corresponding bit.
If the method fails, the Error object is filled with the error description.
Example
Sub GetIndexState_Sample()
'Retrieves the current set of bits that
'indicate the index and mark state
Dim IState As Long
On Error GoTo except
IState = Ch.GetIndexState(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.72 GetInput
The method retrieves the current state of the specified digital input.
Syntax
object.GetInput(Port, Bit)
Parameters
Name Type Description
Port [in] long Number of the input port.
Bit [in] long Number of the specific bit.
Return Value
Long.
The method retrieves the current state of the specified digital input.
Remarks
To get values of all inputs of the specific port, use the GetInputPort method.
Digital inputs are represented in the controller variable IN. For more information about digital
inputs, see the SPiiPlus ACSPL+ Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub GetInput_Sample()
'The method reads input 0 of port 0 ( IN(0).0 )
Dim Port As Long
On Error GoTo except
Port = Ch.GetInput(0, 0)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.73 GetInputPort
The method retrieves the current state of the specified digital input port.
Syntax
object.GetInputPort(Port)
Parameters
Name Type Description
Port [in] long Number of the input port.
Return Value
Long.
The method retrieves the current state of the specified digital input port.
Remarks
To get the value of the specific input of the specific port, use the GetInput method.
Digital inputs are represented in the controller variable IN. For more information about digital
inputs, see the SPiiPlus ACSPL+ Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub GetInputPort_Sample()
'The method reads input port 0 to 15(
IN(0)
'to IN(15) )
Dim Index As Long
Dim Port(15) As Long
On Error GoTo except
For Index = 0 To 15
Port(Index) = Ch.GetInputPort(Index)
Next Index
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.74 GetInterruptMask
The method retrieves the mask for specified interrupt.
Syntax
object.GetInterruptMask(, Mask)
Parameters
Name Type Description
Interrupt [in] long Specifies one of the following interrupts:
• ACSC_INTR_PEG – a position event signal (PEG)
has been generated
• ACSC_INTR_MARK1 – a MARK1 signal has
been generated
• ACSC_INTR_MARK2 – a MARK2 signal has
been generated
• ACSC_INTR_PHYSICAL_MOTION_END – a
Return Value
Long.
The method retrieves the bit mask for the specified interrupt.
Remarks
To set the mask for a specified interrupt, call SetInterruptMask.
If a bit in the return value equals 0, the interrupt for the corresponding axis/buffer/input is
disabled.
Use the ACSC_MASK_*** properties to find the values of specific bits. See Section 6.13,
Interrupt Masks for a detailed description of these properties.
By default all the interrupt bits are set to one.
If the method fails, the Error object is filled with the error description.
Example
Sub GetInterruptMask_Sample()
'The example shows how to get the mask for specific interrupt
Dim Mask As Long
On Error GoTo except
'An ACSPL+ program has finished
Mask = Ch.GetInterruptMask(Ch.ACSC_INTR_PROGRAM_END)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.75 GetJerk
The method retrieves a value of motion jerk.
Syntax
object.GetJerk(Axis)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
Double.
The method retrieves the value of the motion jerk.
Remarks
The retrieved value is a value defined by a previous call of SetJerk, or the default value if the
method was not called before.
If the method fails, the Error object is filled with the error description.
Example
Sub GetJerk_Sample()
Dim Index As Long
Dim Jerk(7) As Double
On Error GoTo except
'Retrieves the value of the motion jerk
For Index = 0 To 7
Jerk(Index) = Ch.GetJerk(Index)
Next Index
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.76 GetKillDeceleration
The method retrieves a value of motion kill deceleration.
Syntax
object.GetKillDeceleration(Axis)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
Double.
The method retrieves the value of the motion kill deceleration.
Remarks
The retrieved value is a value defined by a previous call of tSetKillDeceleration, or the default
value if the method was not previously called.
If the method fails, the Error object is filled with the error description.
Example
Sub GetKillDeceleration_Sample()
Dim Index As Long
Dim KDec(7) As Double
On Error GoTo except
'Retrieves a value of motion kill
'deceleration
For Index = 0 To 7
KDec(Index) = Ch.GetKillDeceleration(Index)
Next Index
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.77 GetLibraryVersion
The method retrieves the legacy SPiiPlus C Library version number.
Syntax
object.GetLibraryVersion()
Parameters
None.
Return Value
Long.
The method retrieves the legacy SPiiPlus C Library version number.
Remarks
The SPiiPlus C Library version consists of four (or less) numbers separated by points: #.#.#.#.
The binary version number is represented by 32-bit unsigned integer value. Each byte of this
value specifies one number in the following order: high byte of high word – first number, low
byte of high word – second number, high byte of low word – third number and low byte of low
word – forth number. For example the version “2.10” has the following binary representation
(hexadecimal format): 0x020A0000.
The first two numbers in the string form are obligatory. Any release version of the library
consists of two numbers. The third and fourth numbers specify an alpha or beta version, special
or private build, etc.
If the method fails, the Error object is filled with the error description.
Example
Sub GetLibraryVersion_Sample()
Dim LVersion As Double
On Error GoTo except
'Retrieves the SPiiPlus C Library version number.
LVersion = Ch.GetLibraryVersion
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.78 GetSingleMessage
The method retrieves single unsolicited message from the buffer. This method only works if
you setup a buffer using OpenMessageBuffer. If no message buffer is open, these messages
will be returned by Receive. If there is no message in the buffer the method waits until the
message arrives or time out expires.
Syntax
object.GetSingleMessage(Timeout )
Parameters
Name Type Description
Timeout [in] long Maximum waiting time in milliseconds
Return Value
String.
Remarks
The method retrieves single unsolicited message from the message buffer.
If no, unsolicited message is received the method waits until a message arrives.
If the timeout expires, the method exits with ACSC_TIMEOUT error.
If the method fails, the Error object is filled with the error description.
Example
Sub GetSingleMessage_Sample()
Dim Str As String
Dim Cmd As String
Cmd = "?FPOS0"
On Error GoTo except
'The method opens an unsolicited
messages
'buffer, size of the opened buffer is
5000
Call Ch.OpenMessageBuffer(5000)
'Sending the command "?FPOS0"
Call Ch.Send(Cmd)
'The method retrieves unsolicited
message
'from the buffer and wait 1 second till a
'message arrives
Str = Ch.GetSingleMessage(1000)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.79 GetMotionError
The method retrieves the termination code of the last executed motion of the specified axis.
Syntax
object.GetMotionError(Axis)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
For a multi-axis motion this parameter must
correspond to a leading axis of a group.
Return Value
Long.
The method retrieves the termination code of the last executed motion of the specified axis.
Remarks
If the motion is in progress, the method returns zero. If the motion terminates for any reason,
the method returns the termination code. To get the error explanation, use the method
GetErrorString.
See the SPiiPlus ACSPL+ Programmer’s Guide for all available motion termination codes
description.
If the method fails, the Error object is filled with the error description.
Example
Sub GetMotionError_Sample()
Dim MError As Long
On Error GoTo except
'Retrieves the termination code of the
last
'executed motion of axis X
MError = Ch.GetMotionError(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.80 GetMotorError
The method retrieves the reason for motor disabling.
Syntax
object.GetMotorError(Axis)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
Long.
The method retrieves the reason for the motor becoming disabled.
Remarks
If the motor is enabled the method returns zero. If the motor was disabled, the method returns
the reason for the disabling. To get the error explanation, use the GetErrorString method.
See “SPiiPlus ACSPL+ Programmer’s Guide” for all available motor error code descriptions.
If the method fails, the Error object is filled with the error description.
Example
Sub GetMotorError_Sample()
Dim MError As Long
On Error GoTo except
'Retrieves the reason for motor
disabling
MError = Ch.GetMotorError(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.81 GetMotorState
The method retrieves the current motor state.
Syntax
object.GetMotorState(Axis, State)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
Long.
The method retrieves the current motor state.
Remarks
The retrieved value can include one or more of the following flags:
• ACSC_MST_ENABLE — a motor is enabled
• ACSC_MST_INPOS — a motor has reached a target position
• ACSC_MST_MOVE — a motor is moving
• ACSC_MST_ACC — a motor is accelerating
If the method fails, the Error object is filled with the error description.
Example
Sub GetMotorState_Sample()
Dim State As Long
On Error GoTo except
'Retrieves the current motor state of X
State = Ch.GetMotorState(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.82 GetOutput
The method retrieves the current state of the specified digital output.
Syntax
object.GetOutput(Port, Bit)
Parameters
Name Type Description
Port [in] long Pointer to a variable that receives the current state of
the specific output. The value will be populated by 0 or
1.
Bit [in] long Number of the specific bit.
Return Value
Long.
The method retrieves the current state (0 or 1) of the specified digital output.
Remarks
To get values of all outputs of the specific port, use GetExtOutputPort.
Digital outputs are represented in the controller variable OUT. For more information about
digital outputs, see the SPiiPlus ACSPL+ Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub GetOutput_Sample()
'The method reads output 0 of port 0 (
'OUT(0).0 )
Dim Port As Long
On Error GoTo except
Port = Ch.GetOutput(0, 0)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.83 GetOutputPort
The method retrieves the current state of the specified digital output port.
Syntax
object.GetOutputPort(Port)
Parameters
Name Type Description
Port [in] long Number of the output port.
Return Value
Long.
The method retrieves the current state (0 or 1)of the specified digital output port.
Remarks
To get the value of the specific output of the specific port, use GetOutput.
Digital outputs are represented in the controller variable OUT. For more information about
digital outputs, see SPiiPlus ACSPL+ Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub GetOutputPort_Sample()
'The method reads output port 0 to 15(
OUT(0)
'to OUT(15) )
Dim Index As Long
Dim Port(15) As Double
On Error GoTo except
For Index = 0 To 15
Port(Index) = Ch.GetOutputPort(Index)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.84 GetPCICards
The method retrieves information about the controller cards inserted in the computer PCI Bus.
Syntax
object.GetPCICards(arrBusNumber, arrSlotNumber, arrFunction)
Parameters
Name Type Description
arrBusNumber [out] variant Array of bus numbers that is filled in by the method.
arrSlotNumber [out] variant Array of slot numbers of the controller card
arrFunction [out] variant Array of function of the controller card
Return Value
Long.
The method returns the number of cards found.
Remarks
If no controller cards are detected, the method returns zero and does not assign values to the
parameters.
The method also fills the parameters with information about the detected cards.
Parameters arrSlotNumber can be used in the OpenCommPCI call to open communication
with a specific card. Other parameters have no use in the SPiiPlus COM Library.
For example, if there are two cards, the method will fill in two rows in arrSlotNumber,
arrBusNumber, arrFunction.
If the method fails, the Error object is filled with the error description.
Example
Sub GetPCICards_Sample()
Dim BusNumber As Variant
Dim SlotNumber As Variant
Dim MethodV As Variant
Dim CardsNumber As Long
On Error GoTo except
'Retrieves information about the
controller
'cards
CardsNumber = Ch.GetPCICards(BusNumber, SlotNumber, MethodV)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.85 GetProgramError
The method retrieves the error code of the last program error encountered in the specified
buffer.
Syntax
object.GetProgramError(Buffer)
Parameters
Name Type Description
Buffer [in] long Number of the program buffer.
Return Value
Long.
The method retrieves the error code of the last program error encountered in the specified
buffer.
Remarks
If the program is running, the method returns zero. If the program terminates for any reason, the
method returns the termination code. To get the error explanation, use GetErrorString.
If the method fails, the Error object is filled with the error description.
Example
Sub GetProgramError_Sample()
Dim PError As Long
On Error GoTo except
'Appends buffer 0 with 1 line
Call Ch.AppendBuffer(0, "!The program finished without STOP command")
'Run buffer 0
Call Ch.RunBuffer(0)
'Retrieves error 3114
PError = Ch.GetProgramError(0)
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.86 GetProgramState
The method retrieves the current state of the program buffer.
Syntax
object.GetProgramState(Buffer)
Parameters
Name Type Description
Buffer [in] long Number of the buffer.
Return Value
Long.
The method retrieves the current state of the program buffer.
Remarks
The retrieved value can include one or more of the following flags:
• ACSC_PST_COMPILED – a program in the specified buffer is compiled
• ACSC_PST_RUN – a program in the specified buffer is running
Example
Sub GetProgramState_Sample()
Dim PState As Long
On Error GoTo except
'Appends 1 line to buffer 0
Call Ch.AppendBuffer(0, "!Empty buffer;stop")
'Run buffer 0
Call Ch.RunBuffer(0)
'Retrieves the current state of the
program
'buffer
PState = Ch.GetProgramState(0)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.87 GetResponseMask
The method retrieves the mask that defines the motor or the system faults for which the
controller provides the default response.
Syntax
object.GetResponseMask(Axis)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
Long.
Remarks
The method retrieves the mask that determines whether the controller will respond to a motor
or system fault with the fault's default response.
If a bit of the parameter Mask is zero, it deactivates the default controller response for the
corresponding fault.
For more information about the controller faults and default, responses see the SPiiPlus
ACSPL+ Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub GetResponseMask_Sample()
Dim Mask As Long
On Error GoTo except
'Retrieves the mask of axis X
Mask = Ch.GetResponseMask(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.88 GetRPosition
The method retrieves an instant value of the motor reference position.
Syntax
object.GetRPosition(Axis)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
Double.
The method retrieves the current value of the motor reference position.
Remarks
The method retrieves the current value of the motor reference position. The reference position
is a value calculated by the controller as a reference for the motor.
If the method fails, the Error object is filled with the error description.
Example
Sub GetRPosition_Sample()
Dim RPosition As Double
On Error GoTo except
'Retrieves an instant value of the motor
'reference position
RPosition = Ch.GetRPosition(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.89 GetRVelocity
The method retrieves an instant value of the motor reference velocity.
Syntax
object.GetRVelocity(Axis)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
Double.
The method retrieves the current value of the motor reference velocity.
Remarks
The reference velocity is a value calculated by the controller in the process of motion
generation.
If the method fails, the Error object is filled with the error description.
Example
Sub GetRVelocity_Sample()
Dim RVelocity As Double
On Error GoTo except
'Retrieves an instant value of the motor
'reference velocity
RVelocity = Ch.GetRVelocity(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.90 GetSafetyInput
The method retrieves the current state of the specified safety input.
Syntax
object.GetSafetyInput(Axis, Input)
Parameters
Name Type Description
Axis [in] long The parameter specifies the axis (ACSC_AXIS_X
corresponds to X, ACSC_AXIS_Y – to Y etc.) to get
the specified safety motor input, or ACSC_NONE to
get the specified system safety input.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Input [in] long The specific safety input.
To specify a desired motor safety input OR
combination of any of the following properties can be
used:
• ACSC_SAFETY_RL
• ACSC_SAFETY_LL
• ACSC_SAFETY_HOT
• ACSC_SAFETY_DRIVE
• ACSC_SAFETY_ES
See Section 6.11, Safety Control Masks for a detailed
description of these properties.
Return Value
Long.
The method retrieves the current state of the specified safety input.
Remarks
To get values of all safety inputs of the specific axis, use GetSafetyInputPort.
Safety inputs are represented in the controller variables SAFIN and S_SAFIN. For more
information about safety inputs, see SPiiPlus ACSPL+ Programmer’s Guide.
Note
Some safety inputs can be unavailable in specific controller model. For
example, SPiiPlus SA controller does not provide Motor Overheat,
Preliminary Left Limit, or Preliminary Right Limit safety inputs.
See specific model documentation for details.
If the method fails, the Error object is filled with the error description.
Example
Sub GetSafetyInput_Sample()
'The method reads Emergency Stop system
'safety input
Dim SInput As Long
On Error GoTo except
'Reads right Limit Safety input of axis
X
SInput = Ch.GetSafetyInput(Ch.ACSC_AXIS_X, Ch.ACSC_SAFETY_RL)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.91 GetSafetyInputPort
The method retrieves the current state of the specified safety input port.
Syntax
object.GetSafetyInputPort(Axis)
Parameters
Name Type Description
Axis [in] long The parameter specifies the axis (ACSC_AXIS_X
corresponds to X, ACSC_AXIS_Y – to Y etc.) to get
the specified safety motor inputs port, or
ACSC_NONE to get the specified safety system inputs
port.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Return Value
Long.
The method retrieves the current state of the specified safety input port.
To recognize a specific motor safety input, only one of the following properties can be used:
• ACSC_SAFETY_RL
• ACSC_SAFETY_LL
• ACSC_SAFETY_RL2
• ACSC_SAFETY_LL2
• ACSC_SAFETY_HOT
• ACSC_SAFETY_DRIVE
To recognize a specific system safety input, only ACSC_SAFETY_ES property can be used.
See Section 6.11, Safety Control Masks for a detailed description of these properties.
Remarks
To get the state of the specific safety input of a specific axis, use GetSafetyInput.
Safety inputs are represented in the controller variables SAFIN and S_SAFIN. For more
information about safety inputs, see SPiiPlus ACSPL+ Programmer’s Guide.
Note
Some safety inputs can be unavailable in specific controller model. For
example, SPiiPlus SA controller does not provide Motor Overheat,
Preliminary Left Limit, or Preliminary Right Limit safety inputs.
See specific model documentation for details.
If the method fails, the Error object is filled with the error description.
Example
Sub GetSafetyInputPort_Sample()
Dim SInput As Long
On Error GoTo except
'The method reads safety input port of
the
'axis X
SInput = Ch.GetSafetyInputPort(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.92 GetSafetyInputPortInv
The method retrieves the set of bits that define inversion for the specified safety input port.
Syntax
object.GetSafetyInputPortInv(Axis)
Parameters
Name Type Description
Axis [in] long The parameter specifies the axis (ACSC_AXIS_X
corresponds to X, ACSC_AXIS_Y – to Y etc.) to get
the inversion for the specified safety motor inputs port,
or ACSC_NONE to get the inversion for the specified
safety system inputs port.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Return Value
Long.
The method retrieves the set of bits that define inversion for the specified safety input port.
To recognize a specific bit, use the following properties:
• ACSC_SAFETY_RL
• ACSC_SAFETY_LL
• ACSC_SAFETY_RL2
• ACSC_SAFETY_LL2
• ACSC_SAFETY_HOT
• ACSC_SAFETY_DRIVE
Use the ACSC_SAFETY_ES property to recognize an inversion for the specific system safety
input port,.
See Section 6.11, Safety Control Masks for a detailed description of these properties.
Remarks
To set the specific inversion for the specific safety input port, use GetSafetyInputPortInv.
If a bit of the retrieved set is zero, the corresponding signal is not inverted and therefore high
voltage is considered an active state. If a bit is raised, the signal is inverted and low voltage is
considered an active state.
The inversions of safety inputs are represented in the controller variables SAFINI and
S_SAFINI. For more information about safety inputs, see the SPiiPlus ACSPL+ Programmer’s
Guide.
Note
Some safety inputs can be unavailable in specific controller model. For
example, SPiiPlus SA controller does not provide Motor Overheat,
Preliminary Left Limit, or Preliminary Right Limit safety inputs.
See specific model documentation for details.
If the method fails, the Error object is filled with the error description.
Example
Sub GetSafetyInputPortInv_Sample()
'The method reads an inversion of safety
'input port of the axis X
Dim State As Long
On Error GoTo except
State = Ch.GetSafetyInputPortInv(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.93 GetSerialNumber
The method retrieves the controller serial number.
Syntax
object.GetSerialNumber()
Parameters
None
Return Value
String.
The method retrieves the character string that contains the controller serial number.
Remarks
If the method fails, the Error object is filled with the error description.
Example
Sub GetSerialNumber_Sample()
'Retrieves the character string that
'contains the controller serial number
Dim SerN As String
On Error GoTo except
SerN = Ch.GetSerialNumber
Exit Sub
except:
O MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.94 GetServerExt
The method defines the communication server IP address and specifies the explicit port
number.
Syntax
object.SetSrverExt([in] string IPaddress,[in] long Port)
Parameters
Name Type Description
IPaddress [in] string IP address of the remote UMD. The address must be
the same as the remote UMD dialog.
Port [in} long Port over which the UMD is contacted. The address
must be the same as the remote UMD dialog.
Return Value
None.
Remarks
This method allows setting the remote UMD port numner in case the default port number on
the remote computer is not available.
Example
5.95 GetTimeout
The method retrieves communication timeout.
Syntax
object.GetTimeout()
Parameters
None.
Return Value
Long.
The method retrieves communication timeout.
Remarks
If the method succeeds, the return value is the current timeout value in milliseconds.
If the method fails, the Error object is filled with the error description.
Example
Sub GetTimeout_Sample()
Dim TimeO As Long
On Error GoTo except
'Retrieves communication timeout
TimeO = Ch.GetTimeout
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.96 GetVelocity
The method retrieves a value of motion velocity.
Syntax
object.GetVelocity(Axis)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
Double.
The method retrieves the value of the motion velocity.
Remarks
The retrieved value is the value defined by a previous call of SetVelocity or the default value
if the method was not previously called.
If the method fails, the Error object is filled with the error description.
Example
Sub GetVelocity_Sample()
Dim Velocity As Double
On Error GoTo except
'Retrieves a value of motion velocity of
axis
'X
Velocity = Ch.GetVelocity(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.97 Go
The method starts up a motion waiting in the specified motion queue.
Syntax
object.Go(Axis)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
None.
Remarks
A motion that was planned with ACSC_AMF_WAIT flag does not start until the Go method is
executed. Being planned, a motion waits in the appropriate motion queue.
Each axis has a separate motion queue. A single-axis motion waits in the motion queue of the
corresponding axis. A multi-axis motion waits in the motion queue of the leading axis. The
leading axis is an axis specified first in the motion command.
The Go method initiates the motion waiting in the motion queue of the specified axis. If no
motion waits in the motion queue, the method has no effect.
If the method fails, the Error object is filled with the error description.
Example
Sub Go_Sample()
On Error GoTo except
'Enable axis X
Call Ch.Enable(Ch.ACSC_AXIS_X)
'Wait till axis X is enabled during 5
sec
Call Ch.WaitMotorEnabled(Ch.ACSC_AXIS_X, 1, 5000)
'Wait till GO command executed on axis
X,
'target position of 10000
Call Ch.ToPoint(Ch.ACSC_AMF_WAIT, Ch.ACSC_AXIS_X, 10000)
'Motion start
Call Ch.Go(Ch.ACSC_AXIS_X)
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequence(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.98 GoM
The method synchronously starts up several motions that are waiting in the specified motion
queues.
Syntax
object.GoM(Axes)
Parameters
Name Type Description
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Return Value
None.
Remarks
A motion that was planned with ACSC_AMF_WAIT flag does not start until the GoM method
is executed. After being planned, a motion waits in the appropriate motion queue.
Each axis has a separate motion queue. A single-axis motion waits in the motion queue of the
corresponding axis. A multi-axis motion waits in the motion queue of the leading axis. The
leading axis is an axis specified first in the motion command.
The GoM method initiates the motions waiting in the motion queues of the specified axes. If no
motion waits in one or more motion queues, the corresponding axes are not affected.
If the method fails, the Error object is filled with the error description.
Example
Sub GoM_Sample()
Dim Points(1) As Double
Dim Axes(2)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
Points(0) = 10000
Points(1) = 10000
On Error GoTo except
'Enable axes X and Y
Call Ch.EnableM(Axes)
'Wait till GO command executed on axes
XY,
'target position of 10000,10000
Call Ch.ToPointM(Ch.ACSC_AMF_WAIT, Axes, Points)
'Start the motion of X and Y
Call Ch.GoM(Axes)
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequenceM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.99 Group
The method creates a coordinate system for a multi-axis motion.
Syntax
object.Group(Axes)
Parameters
Return Value
None.
Remarks
The method creates a coordinate system for a multi-axis motion. The first element of the Axes
array specifies the leading axis. The motion parameters of the leading axis become the default
motion parameters for the group.
An axis can belong to only one group at a time. If the application requires restructuring the axes,
it must split the existing group and only then create the new one. To split the existing group,
use Split.To split all existing groups, use SplitAll.
If the method fails, the Error object is filled with the error description.
Example
Sub Group_Sample()
Dim Axes(3)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = Ch.ACSC_AXIS_Z
Axes(3) = -1
On Error GoTo except
'Create group of axes XYZ
Call Ch.Group(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.100 Halt
The method terminates a motion using the full deceleration profile.
Syntax
object.Halt(Axis)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
None.
Remarks
The method terminates the executed motion that involves the specified axis. The terminated
motion can be either single-axis or multi-axis. Any other motion waiting in the corresponding
motion queue is discarded and will not be executed.
If no executed motion involves the specified axis, the method has no effect.
The terminated motion finishes using the full third-order deceleration profile and the motion
deceleration value.
If the method fails, the Error object is filled with the error description.
Example
Sub Halt_Sample()
On Error GoTo except
'Enable axis X
Call Ch.Enable(Ch.ACSC_AXIS_X)
'Wait till axis X is enabled during 5 sec
Call Ch.WaitMotorEnabled(Ch.ACSC_AXIS_X, 1, 5000)
'Relative motion of axis X, target
position
'of 10000
Call Ch.ToPoint(Ch.ACSC_AMF_RELATIVE, Ch.ACSC_AXIS_X, 10000)
'Halt executed to axis X
Call Ch.Halt(Ch.ACSC_AXIS_X)
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequence(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.101 HaltM
The method terminates several motions using the full deceleration profile.
Syntax
object.HaltM(Axes)
Parameters
Name Type Description
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Return Value
None.
Remarks
The method terminates all executed motions that involve the specified axes. The terminated
motions can be either single-axis or multi-axis. All other motions waiting in the corresponding
motion queues are discarded and will not be executed.
If no executed motion involves a specified axis, the method has no effect on the corresponding
axis.
The terminated motions finish using the full third-order deceleration profile and the motion
deceleration values.
If the method fails, the Error object is filled with the error description.
Example
Sub HaltM_Sample()
Dim Points(1) As Double
Dim Index As Long
Dim Axes(2)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
Points(0) = 10000
Points(1) = 10000
On Error GoTo except
'Enable XY
Call Ch.EnableM(Axes)
'Relative motion of axes XY with target
'position of 10000,10000
Call Ch.ToPointM(Ch.ACSC_AMF_RELATIVE, Axes, Points)
'Halt executed on axes XY
Call Ch.HaltM(Axes)
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequenceM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.102 Jog
The method initiates a single-axis jog motion.
Syntax
object.Jog(Flags, Axis, Velocity)
Parameters
Name Type Description
Flags [in] long Bit-mapped parameter that can include one or more of
the following flags:
• •ACSC_AMF_WAIT: plan the motion but don’t
start it until the method Go is executed.
• •ACSC_AMF_VELOCITY: the motion will use
the velocity specified by the Velocity argument
instead of the default velocity.
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Velocity [in] double If the ACSC_AMF_VELOCITY flag is specified, the
velocity profile is built using the value of Velocity. The
sign of Velocity defines the direction of the motion.
If the ACSC_AMF_VELOCITY flag is not specified,
only the sign of Velocity is used in order to specify the
direction of motion. In this case, the properties
ACSC_POSITIVE_DIRECTION or
ACSC_NEGATIVE_DIRECTION can be used.
Return Value
None.
Remarks
The method initiates a single-axis jog. To execute multi-axis jog, use JogM.
The jog motion is a motion with constant velocity and no defined ending point. The jog motion
continues until the next motion is planned, or the motion is killed for any reason.
The motion builds the velocity profile using the default values of acceleration, deceleration and
jerk of the specified axis. If the ACSC_AMF_VELOCITY flag is not specified, the default
value of velocity is used as well. In this case, only the sign of Velocity is used in order to specify
the direction of motion. The positive velocity defines a positive direction, the negative velocity
– negative direction.
If the ACSC_AMF_VELOCITY flag is specified, the value of Velocity is used instead of the
default velocity. The sign of Velocity defines the direction of the motion.
The method waits for the controller response.
The controller response indicates that the command was accepted and the motion was planned
successfully. No waiting for the motion end is provided.
If the method fails, the Error object is filled with the error description.
Example
Sub Jog_Sample()
On Error GoTo except
'Enable axis X
Call Ch.Enable(Ch.ACSC_AXIS_X)
'Wait till axis X is enabled during 5
sec
Call Ch.WaitMotorEnabled(Ch.ACSC_AXIS_X, 1, 5000)
'Initiates a single-axis jog motion to
axis
'X to positive direction with the
specified
'velocity 10000
Call Ch.Jog(Ch.ACSC_POSITIVE_DIRECTION, Ch.ACSC_AXIS_X, 10000)
'Finish the motion
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.103 JogM
The method initiates a multi-axis jog motion.
Syntax
object.JogM(Flags, Axes, Direction, Velocity)
Parameters
Name Type Description
Flags [in] long Bit-mapped parameter that can include one or more of
the following flags:
• •ACSC_AMF_WAIT: plan the motion but don’t
start it until the method Go is executed.
• •ACSC_AMF_VELOCITY: the motion will use
the velocity specified by the Velocity argument
instead of the default velocity.
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Direction [in] variant Array of directions—The number and order of values
must correspond to the Axes array. The Direction
array must specify direction for each element of Axes
except the last –1 element. The property
ACSC_POSITIVE_DIRECTION in the Direction
array specifies the correspondent axis to move in
positive direction, the property
ACSC_NEGATIVE_DIRECTION specifies the
correspondent axis to move in the negative direction.
Velocity [in] double If the ACSC_AMF_VELOCITY flag is specified, the
velocity profile is built using the value of Velocity.
If the ACSC_AMF_VELOCITY flag is not specified,
Velocity is not used.
Return Value
None.
Remarks
The method initiates a multi-axis jog motion. To execute single-axis jog motion, use Jog.
The jog motion is a motion with constant velocity and no defined ending point. The jog motion
continues until the next motion is planned, or the motion is killed for any reason.
The motion builds the vector velocity profile using the default values of velocity, acceleration,
deceleration and jerk of the axis group. If the ACSC_AMF_VELOCITY flag is not specified,
the default value of velocity is used as well. If the ACSC_AMF_VELOCITY flag is specified,
the value of Velocity is used instead of the default velocity.
The method waits for the controller response.
The controller response indicates that the command was accepted and the motion was planned
successfully. The method cannot wait or validate the end of the motion. To wait for the motion
end, useWaitMotionEnd.
If the method fails, the Error object is filled with the error description.
Example
Sub JogM_Sample()
Dim Directions(1)
Dim Axes(2)
Directions(0) = Ch.ACSC_POSITIVE_DIRECTION
Directions(1) = Ch.ACSC_POSITIVE_DIRECTION
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
On Error GoTo except
'Enable XY
Call Ch.EnableM(Axes)
'Start up immediately the jog motion of
axes
'XY to positive directions with the
'specified velocity 5000
Call Ch.JogM(0, Axes, Directions, 5000)
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequenceM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.104 Kill
The method terminates a motion using reduced deceleration profile.
Syntax
object.Kill(Axis)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
None.
Remarks
The method terminates the executed motion that involves the specified axis. The terminated
motion can be either single-axis or multi-axis. Any other motion waiting in the corresponding
motion queue is discarded and will not be executed.
If no executed motion involves the specified axis, the method has no effect.
The terminated motion finishes with the reduced second-order deceleration profile and the kill
deceleration value.
If the method fails, the Error object is filled with the error description.
Example
Sub Kill_Sample()
On Error GoTo except
'Enable axis X
Call Ch.Enable(Ch.ACSC_AXIS_X)
'Wait till X enabled during 5 sec
Call Ch.WaitMotorEnabled(Ch.ACSC_AXIS_X, 1, 5000)
'Relative motion of axis X with target
'position of 10000
Call Ch.ToPoint(Ch.ACSC_AMF_RELATIVE, Ch.ACSC_AXIS_X, 10000)
'Kill axis X
Call Ch.Kill(Ch.ACSC_AXIS_X)
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequence(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.105 KillAll
The method terminates all currently executed motions.
object.KillAll()
Parameters
None.
Return Value
None.
Remarks
The method terminates all currently executed motions. Any other motion waiting in any motion
queue is discarded and will not be executed.
If no motion is currently executed, the method has no effect.
The terminated motions finish with the reduced second-order deceleration profile and the kill
deceleration values.
If the method fails, the Error object is filled with the error description.
Example
Sub KillAll_Sample()
Dim Axes(2)
Dim Points(1) As Double
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
Points(0) = 10000
Points(1) = 10000
On Error GoTo except
'Enable XY
Call Ch.EnableM(Axes)
'Relative motion of axes XY with target
'position of 10000,10000
Call Ch.ToPointM(Ch.ACSC_AMF_RELATIVE, Axes, Points)
'Kill axes X and Y
Call Ch.KillAll
'End of the multi-point motion
Call Ch.EndSequenceM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.106 KillExt
The method terminates a motion using reduced deceleration profile and defines the kill reason.
Syntax
object.KillExt(Axis, Reason)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Reason [in] long Integer number that defines the reason for the kill. The
specified value is stored in the MERR variable in the
controller and so modifies the state of the killed motor.
Return Value
None.
Remarks
The method terminates the executed motion that involves the specified axis. The terminated
motion can be either single-axis or multi-axis. Any other motion waiting in the corresponding
motion queue is discarded and will not be executed.
If no executed motion involves the specified axis, the method has no effect.
The terminated motion finishes with the reduced second-order deceleration profile and the kill
deceleration value.
If Reason specifies one of the available motor termination codes, the state of the killed motor
will be identical to the state of the motor killed for the corresponding fault. This provides an
enhanced implementation of user-defined fault response.
If the second parameter specifies an arbitrary number, the motor state will be displayed as
“Kill/disable reason: <number> - customer code. This provides ability to separate different
KILL commands in the application.
If the method fails, the Error object is filled with the error description.
Example
Sub KillExt_Sample()
Dim MyCode As Long
MyCode = 10
On Error GoTo except
' Enable axis X
Call Ch.Enable(Ch.ACSC_AXIS_X)
' Wait till X enabled during 5 sec
Call Ch.WaitMotorEnabled(Ch.ACSC_AXIS_X, 1, 5000)
' Relative motion of axis X with target
' position of 10000
Call Ch.ToPoint(Ch.ACSC_AMF_RELATIVE, Ch.ACSC_AXIS_X, 10000)
' Kill axis X with internal customer
code
Call Ch.KillExt(Ch.ACSC_AXIS_X, MyCode)
' Finish the motion
' End of the multi-point motion
Call Ch.EndSequence(Ch.ACSC_AXIS_X)
Exit Sub
except:
ErrorMsg 'See Error Handling in Visual Basic
End Sub
5.107 KillM
The method terminates several motions using reduced deceleration profile.
Syntax
object.KillM(Axes)
Parameters
Name Type Description
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Return Value
None.
Remarks
The method terminates all executed motions that involve the specified axes. The terminated
motions can be either single-axis or multi-axis. All other motions waiting in the corresponding
motion queues are discarded and will not be executed.
If no executed motion involves a specified axis, the method has no effect on the corresponding
axis.
The terminated motions finish with the reduced second-order deceleration profile and the kill
deceleration values.
If the method fails, the Error object is filled with the error description.
Example
Sub KillM_Sample()
Dim Axes(2)
Dim Points(1) As Double
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
Points(0) = 1000000
Points(1) = 1000000
On Error GoTo except
'Enable XY
Call Ch.EnableM(Axes)
'Relative motion of axes XY with target
'position of 10000,10000
Call Ch.ToPointM(Ch.ACSC_AMF_RELATIVE, Axes, Points)
'Kill axes X and Y
Call Ch.KillM(Axes)
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequenceM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.108 Line1
The method adds a linear segment to a segmented motion.
Syntax
object.Line1(Axes, Point)
Parameters
Name Type Description
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Point [in] variant Array of the final point coordinates. The number and
order of values must correspond to the Axes array. The
Point must specify a value for each element of Axes
except the last –1 element.
Return Value
None.
Remarks
The method adds a linear segment to the segmented motion. To add a linear segment with a
specified non-default velocity, use ExtLine.
All axes specified in the Axes array must be specified before calling the Segment method. The
number and order of the axes in the Axes array must correspond exactly to the number and
order of the axes of Segment method.
The parameter Point specifies the coordinates of the final point. The coordinates are absolute
in the plane.
The method waits for the controller response.
The controller response indicates that the command was accepted and the segment is added to
the motion buffer. The segment can be rejected if the motion buffer is full. In this case, you can
call this method periodically until the method returns non-zero value.
If the method fails, the Error object is filled with the error description.
Example
Sub Line1_Sample()
Dim Axes(2)
Dim Points(1) As Double
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
Points(0) = 1000
Points(1) = 1000
On Error GoTo except
'Enable XY
Call Ch.EnableM(Axes)
Call Ch.Segment(0, Axes, Points)
'Adds a linear segment to the segmented
'motion
'Parameters: Axes - Axes XY
'Points - position points 1000,1000
Call Ch.Line1(Axes, Points)
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequenceM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.109 LoadBuffer
The method clears the specified program buffer and then loads ACSPL+ program to this buffer.
object.LoadBuffer(Buffer, Program, Count)
Parameters
Name Type Description
Buffer [in] long Number of a program buffer in the controller.
Program [in] string Pointer to the buffer contained ACSPL+ program(s).
Return Value
None.
Remarks
The method clears the specified program buffer and then loads ACSPL+ program to this buffer.
No compilation or syntax check is provided during downloading. Any text, not only a correct
program, can be inserted into a buffer. In order to compile the program and check its accuracy,
the compile command must be executed after downloading.
If the method fails, the Error object is filled with the error description.
Example
Sub LoadBuffer_Sample()
Dim Str As String
Str = "!This is a test ACSPL+ program;Stop" & Chr$(10)
On Error GoTo except
'Load a line to buffer 0
Call Ch.LoadBuffer(0, Str)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.110 LoadBuffersFromFile
The method opens a file that contains one or more ACSPL+ programs allocated to several
buffers and download the programs to the corresponding buffers.
Syntax
object.LoadBuffersFromFile(Filename)
Parameters
Name Type Description
Filename [in] string Path of the file
Return Value
None.
Remarks
The method analyzes the file, determines which program buffers should be loaded, clears them
and then loads ACSPL+ programs to those buffers.
SPiiPlus software tools save ACSPL+ programs in the following format:
# Header: Date, Firmware version etc.
#Buf1 (buffer number)
ACSPL+ program of Buf1
#Buf2 (buffer number)
ACSPL+ program of Buf2
#Buf3 (buffer number)
ACSPL+ program of Buf3 etc.
The number of buffers in file may change from 1 to 10, without any default order.
No compilation or syntax check is provided during downloading. Any text, not only a correct
program, can be inserted into a buffer. In order to compile the program and check its accuracy,
the compile command must be executed after downloading.
If the method fails, the Error object is filled with the error description.
Example
Sub LoadBuffersFromFile_Sample()
Dim FileP As String
FileP = "C:\\ACSPLFile.txt"
On Error GoTo except
'Opens a file to load
Call Ch.LoadBuffersFromFile(FileP)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.111 LoadFileToIntegerVariable
The method writes value(s) from text file to integer variable.
Syntax
object.LoadFileToIntegerVariable(NBuf, Var, From1, To1, From2, To2, Filename)
Parameters
Name Type Description
Nbuf [in] long Number of program buffer for local variable or
ACSC_NONE for global and standard variable.
Var [in] string Pointer to the null-terminated character string
contained name of the variable.
From1, To1 [in] long Index range (first dimension).
From2, To2 [in] long Index range (second dimension).
Filename [in] string Path of the text data file.
Return Value
None.
Remarks
The method writes to a specified integer variable or array.
The variable can be a standard controller variable, user global or user local.
Standard and user global variables have global scope. Therefore, parameter Nbuf must be
ACSC_NONE (-1) for these classes of variables.
User local variable exists only within a buffer. The buffer number must be specified for user
local variable.
If the variable is scalar, all indexes From1, To1, From2, To2 must be ACSC_NONE (-1). The
method writes the value pointed by Values to the specified variable.
If the variable is a one-dimensional array, From1, To1 must specify the index range and From2,
To2 must be ACSC_NONE (-1). Array Values must contain To1-From1+1 values at least. The
method writes the values to the specified variable from index From1 to index To1 inclusively.
If the variable is a two-dimensional array, From1, To1 must specify the index range of the first
dimension and From2, To2 must specify the index range of the second dimension. The text file,
pointed by Filename parameter, must contain (To1-From1+1)x(To2-From2+1) values at least,
otherwise error will occur. The method uses the text file as follows: first, the method retrieves
the To2-From2 values and writes them to row From1 of the specified controller variable, then
retrieves next To2-From2 values and writes them to row From1+1 of the specified controller
variable, etc.
The text file is processed line-by-line; any characters except numbers, dots, commas and
exponent ‘e’ are translated as separators between the numbers. Line that starts with no digits is
considered as comment and ignored.
If the method fails, the Error object is filled with the error description.
Example
Sub LoadFileToIntegerVariable_Sample()
Dim StrBuf, FileP As String
FileP = "C:\\Projects\\SPiiPlusCOM Test\\UserArr.txt"
StrBuf = "Global int UserArr(2)(10);stop"
5.112 LoadFileToRealVariable
The method writes value(s) from text file to real variable.
object.LoadFileToRealVariable(NBuf, Var, From1, To1, From2, To2, Filename)
Parameters
Name Type Description
Return Value
None.
Remarks
The method writes to a specified integer variable or array.
The variable can be a standard controller variable, user global or user local.
Standard and user global variables have global scope. Therefore, parameter Nbuf must be
ACSC_NONE (-1) for these classes of variables.
User local variable exists only within a buffer. The buffer number must be specified for user
local variable.
If the variable is scalar, all indexes From1, To1, From2, To2 must be ACSC_NONE (-1). The
method writes the value pointed by Values to the specified variable.
If the variable is a one-dimensional array, From1, To1 must specify the index range and From2,
To2 must be ACSC_NONE (-1). Array Values must contain To1-From1+1 values at least. The
method writes the values to the specified variable from index From1 to index To1 inclusively.
If the variable is a two-dimensional array, From1, To1 must specify the index range of the first
dimension and From2, To2 must specify the index range of the second dimension. The text file,
pointed by Filename parameter, must contain (To1-From1+1)x(To2-From2+1) values at least,
otherwise error will occur. The method uses the text file as follows: first, the method retrieves
the To2-From2 values and writes them to row From1 of the specified controller variable, then
retrieves next To2-From2 values and writes them to row From1+1 of the specified controller
variable, etc.
The text file is processed line-by-line; any characters except numbers, dots, commas and
exponent ‘e’ are translated as separators between the numbers. Line that starts with no digits is
considered as comment and ignored.
If the method fails, the Error object is filled with the error description.
Example
Sub LoadFileToRealVariable_Sample()
Dim StrBuf, FileP As String
FileP = "C:\\Projects\\SPiiPlusCOM Test\\UserArr.txt"
StrBuf = "Global real UserArr(2)(10);stop"
On Error GoTo except
'Load to buffer 0 a line that contains
the
'variable "UserArr"
Call Ch.LoadBuffer(0, StrBuf)
'Run buffer 0
Call Ch.RunBuffer(0)
'Writes value(s) from text file to real
'variable "UserArr"
'Parameters: 0 - Number of
program
'buffer
'"UserArr" - variable name
'0,1 - first dimension indexes
'0,9 - second dimension indexes
'FileP - Text file name contained
'values that must be written
Call Ch.LoadFileToRealVariable(0, "UserArr", 0, 1, 0, 9, FileP)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.113 MultiPoint
The method initiates a single-axis multi-point motion.
Syntax
object.MultiPoint(Flags, Axis, Dwell)
Parameters
Name Type Description
Flags [in] long Bit-mapped parameter that can include one or more of
the following flags:
• ACSC_AMF_WAIT: plan the motion but don’t
start it until the method Go is executed.
• ACSC_AMF_RELATIVE: the coordinates of each
point are relative. The first point is relative to the
instant position when the motion starts; the second
point is relative to the first, etc. If the flag is not
specified, the coordinates of each point are
absolute.
• ACSC_AMF_VELOCITY: the motion uses the
velocity specified with each point instead of the
default velocity.
• ACSC_AMF_CYCLIC: the motion uses the point
sequence as a cyclic array. After positioning to the
last point it does positioning to the first point and
continues.
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Dwell [in] double Dwell in each point in milliseconds.
Return Value
None.
Remarks
The method initiates a single-axis multi-point motion. To execute multi-axis multi-point
motion, use MultiPointM.
The motion executes sequential positioning to each of the specified points, optionally with
dwell in each point.
The method itself does not specify any point, so that the created motion starts only after the first
point is specified. The points of motion are specified by using the AddPoint or ExtAddPoint
methods that follow this method.
The motion finishes when the EndSequence method is executed. If the EndSequence call is
omitted, the motion will stop at the last point of the sequence and wait for the next point. No
transition to the next motion in the motion queue will occur until the method EndSequence
executes.
Example
Sub MultiPoint_Sample()
Dim Index As Long
On Error GoTo except
'Enable axis X
Call Ch.Enable(Ch.ACSC_AXIS_X)
'Wait till axis X enabled during 5 sec
Call Ch.WaitMotorEnabled(Ch.ACSC_AXIS_X, 1, 5000)
'Create multi-point motion of axis X
with
'default velocity with dwell 1 ms
Call Ch.MultiPoint(0, Ch.ACSC_AXIS_X, 1)
'Add some points
For Index = 0 To 5
Call Ch.AddPoint(Ch.ACSC_AXIS_X, 100 * Index)
Next Index
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequence(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.114 MultiPointM
The method initiates a multi-axis multi-point motion.
Syntax
object.MultiPointM(Flags, Axes, Dwell)
Parameters
Name Type Description
Flags [in] long Bit-mapped parameter that can include one or more of
the following flags:
• •ACSC_AMF_WAIT: plan the motion but don’t
start it until the method GoM is executed.
• •ACSC_AMF_RELATIVE: the coordinates of
each point are relative. The first point is relative to
the instant position when the motion starts; the
second point is relative to the first, etc. If the flag is
not specified, the coordinates of each point are
absolute.
• •ACSC_AMF_VELOCITY: the motion will use
the velocity specified with each point instead of the
default velocity.
• •ACSC_AMF_CYCLIC: the motion uses the point
sequence as a cyclic array: after positioning to the
last point does positioning to the first point and
continues.
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Dwell [in] double Dwell on each point in milliseconds.
Return Value
None.
Remarks
The method initiates a multi-axis multi-point motion. To execute single-axis multi-point
motion, use MultiPoint.
The motion executes sequential positioning to each of the specified points, optionally with
dwell in each point.
The method itself does not specify any point, so the created motion starts only after the first
point is specified. The points of motion are specified by using MAddPointM or
ExtAddPointM, methods that follow this method.
The motion finishes when the EndSequenceM method is executed. If the call of
EndSequenceM is omitted, the motion will stop at the last point of the sequence and wait for
the next point. No transition to the next motion in the motion queue will occur until the method
EndSequenceM executes.
The method waits for the controller response.
The controller response indicates that the command was accepted and the motion was planned
successfully. The method cannot wait or validate the end of the motion. To wait for the motion
end, use the WaitMotionEnd method.
During positioning to each point, a vector velocity profile is built using the default values of
velocity, acceleration, deceleration, and jerk of the axis group. If the AFM_VELOCITY flag is
not specified, the default value of velocity is used as well. If the AFM_VELOCITY flag is
specified, the value of velocity specified in subsequent ExtAddPointM methods is used.
If the method fails, the Error object is filled with the error description.
Example
Sub MultiPointM_Sample()
Dim Index As Long
Dim Points(1)
Dim Axes(2)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
On Error GoTo except
'Enable axes XY
Call Ch.EnableM(Axes)
'Create multi-point motion of axes XY
with
'default velocity without dwell in the
'points
Call Ch.MultiPointM(0, Axes, 0)
'Add some points
For Index = 0 To 5
Points(0) = 100 * Index
5.115 OpenCommDirect
The method starts up the Simulator and opens communication with the Simulator.
Syntax
object.OpenCommDirect()
Parameters
None.
Return Value
None.
Remarks
The Simulator is a part of the SPiiPlus COM Library. When the application calls
OpenCommDirect, the library starts up the Simulator as a separate process on the same PC
and opens a simulator communication channel for communication with the simulator.
After a channel is open, any SPiiPlus COM method works with the Simulator exactly as with a
physical controller.
Note
For the simulator to be to be found by OpenCommDirect a copy of the
simulator executable file, sb4.exe (located in the SPiiPlus BIN folder),
must be in the same folder as the application executable file.
If the method fails, the Error object is filled with the error description.
Example
Sub OpenCommDirect_Sample()
On Error GoTo except
'Starts up the Simulator and opens
'communication with the Simulator
Call Ch.OpenCommDirect
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.116 OpenCommEthernet
The method opens communication with the controller via Ethernet.
Syntax
object.OpenCommEthernet(Address, Port)
Parameters
Name Type Description
Address [in] string Pointer to a null-terminated character string that
contains the network address of the controller in
symbolic or TCP/IP dotted form.
Port [in] long Service port.
For point-to-point communication, this parameter must
be ACSC_SOCKET_DGRAM_PORT.
For communication via Internet/Intranet, this
parameter must be
ACSC_SOCKET_STREAM_PORT.
Return Value
None.
Remarks
After a channel is open, any SPiiPlus COM method works with the channel irrespective of the
physical nature of the channel.
If the parameter Port is ACSC_SOCKET_DGRAM_PORT, the library opens communication
using the connectionless socket and UDP communication protocol.
If the parameter Port is ACSC_SOCKET_STREAM_PORT, the library opens communication
using the connection-oriented socket and TCP communication protocol.
The controller supports both protocols. The UDP protocol provides faster communication, but
is not reliable when used in a multi-node network.
Use UDP protocol if the host computer has a point-to-point Ethernet connection to the
controller.
Use TCP protocol if the host computer is connected to the controller through the multi-node
Ethernet network.
If the method fails, the Error object is filled with the error description.
Example
Sub OpenCommEthernet_Sample()
On Error GoTo except
'Open point-to-point Ethernet
communication
'with the controller TCP/IP address
'10.0.0.100
Call Ch.OpenCommEthernet("10.0.0.100", Ch.ACSC_SOCKET_DGRAM_PORT)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.117 OpenCommPCI
The method opens a communication channel with the controller via PCI Bus.
Up to 4-communication channels can be open simultaneously with the same SPiiPlus card
through the PCI Bus.
Syntax
object.OpenCommPCI(SlotNumber)
Parameters
Name Type Description
SlotNumber [in] long Number of the slot of the controller card.
If SlotNumber is ACSC_NONE, the method opens
communication with the first found controller card.
Return Value
None.
Remarks
To open PCI communication the host PC, one or more controller cards must be inserted into the
computer PCI Bus.
After a channel is open, any SPiiPlus COM method works with the channel irrespective of the
physical nature of the channel.
If the method fails, the Error object is filled with the error description.
Example
Sub OpenCommPCI_Sample()
On Error GoTo except
'Open communication with the first found
'controller card
Call Ch.OpenCommPCI(Ch.ACSC_NONE)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.118 OpenCommSerial
The method opens communication with the controller via a serial port.
Syntax
object.OpenCommSerial(Channel, Rate)
Parameters
Name Type Description
Rate [in] long Communication rate in bits per second (baud).
This parameter must be equal to the controller variable
IOBAUD for the successful link with the controller. If
ACSC_AUTO property is passed, the method will
automatically determine the baud rate.
Return Value
None.
Remarks
After a channel is open, any SPiiPlus COM method works with the channel irrespective of the
physical nature of the channel.
If the method fails, the Error object is filled with the error description.
Example
Sub OpenCommSerial_Sample()
On Error GoTo except
'Open serial communication through port
COM1
'with baud rate 115200
Call Ch.OpenCommSerial(1, 115200)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.119 OpenHistoryBuffer
The method opens a history buffer.
Syntax
object.OpenHistoryBuffer(Size)
Parameters
Name Type Description
Size [in] long Required size of the buffer in bytes
Return Value
None.
Remarks
The method allocates a history buffer that stores all commands sent to the controller and all
responses and unsolicited messages received from the controller.
Only one history buffer can be open for each communication channel.
The buffer works as a cyclic buffer. When the amount of the stored data exceeds the buffer size,
the newly stored data overwrites the earliest data in the buffer.
If the method fails, the Error object is filled with the error description.
Example
Sub OpenHistoryBuffer_Sample()
On Error GoTo except
'The method opens a history buffer
'size of the buffer is 5000
Call Ch.OpenHistoryBuffer(5000)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.120 OpenLogFile
The method opens a log file.
Syntax
object.OpenLogFile(FileName)
Parameters
Name Type Description
FileName [in] long Pointer to the null-terminated string contained name or
path of the log file.
Return Value
None.
Remarks
The method opens a binary file that stores all communication history.
Only one log file can be open for each communication channel.
If the log file has been open, the library writes all incoming and outgoing messages to the
specified file. The messages are written to the file in binary format, i.e. exactly as they are
received and sent, including all service bytes.
Unlike the history buffer, the log file cannot be read within the library. The main usage of the
log file is for debug purposes.
If the method fails, the Error object is filled with the error description.
Example
Sub OpenLogFile_Sample()
On Error GoTo except
'Opens log file
Call Ch.OpenLogFile("C:\COMLogFile.log")
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.121 OpenMessageBuffer
The method opens an unsolicited messages buffer.
Syntax
object.OpenMessageBuffer(Size)
Parameters
Name Type Description
Size [in] long Required size of the buffer in bytes.
Return Value
None.
Remarks
The method allocates a buffer that stores unsolicited messages from the controller.
Unsolicited messages are messages that the controller sends on its own initiative and not as a
response to command. For example, the disp command in an ACSPL+ program forces the
controller to send an unsolicited message.
Only one message buffer can be open for each communication channel.
If the message buffer has been open, the library separates unsolicited messages from the
controller responses and stores them in the message buffer. In this case, the Receive method
retrieves only the controller replies, and the GetSingleMessage method retrieves unsolicited
messages. If the message buffer is not open, Receive retrieves both replies and unsolicited
messages. If the user application does not call Receive or GetSingleMessage and uses only
Transaction and Command the unsolicited messages are discarded.
The message buffer works as a FIFO buffer: GetSingleMessage extracts the earliest message
stored in the buffer. If GetSingleMessage extracts the messages slower than the controller
produces them, buffer overflow can occur, and some messages will be lost. Generally, the
greater the buffer, the less likely is buffer overflow to occur.
If the method fails, the Error object is filled with the error description.
Example
Sub OpenMessageBuffer_Sample()
On Error GoTo except
'The method opens an unsolicited
messages
'buffer size of the opened buffer is
5000
Call Ch.OpenMessageBuffer(5000)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.122 ParseCOMErrorCode
The method is used to parse the SPiiPlus error code and components of HRESULT.
Syntax
object.ParseCOMErrorCode (COMErrorCode, Code, Facility, Severity)
Parameters
Name Type Description
COMErrorCode [in] long HRESULT: a 32-bit standard COM value representing
the method return status. It consists of a severity code,
a facility code, and an error code.
HRESULT can be retrieved from the Error object (see
Chapter 8, Error Handling).
Code [out] long Optional. HRESULT error code. The SPiiPlus error
code is a component of the HRESULT error code.
Facility [out] long Optional. HRESULT facility code.
Severity [out] long Optional. HRESULT severity code.
Return Value
Long.
The function returns the SPiiPlus error codes (see Section 8.4,Error Codes) parsed from
COMErrorCode (which is HRESULT).
Remarks
Note
In VBScript the method can only be used to retrieve the SPiiPlus error
code. It cannot be used to retrieve values for Code, Facility, or
Severity.
Example
5.123 PegI
The method initiates incremental PEG. The Incremental PEG method is defined by the first
point,the last point and the interval.
Syntax
object.PegI(Flags, Axis, Width, FirstPoint, Interval, LastPoint, TbNumber, TbPeriod)
Parameters
Name Type Description
Flags [in] long Bit-mapped parameter that can include following flag:
ACSC_AMF_SYNCHRONOUS: PEG starts
synchronously with the motion sequence.
Return Value
None.
Remarks
The method initiates incremental PEG generation. See details in the SPiiPlus ACSPL+
Programmer’s Guide. The time-based pulse generation is optional, if it is not used, TbPeriod
and TbNumber should be ACSC_NONE.
If the method fails, the Error object is filled with the error description.
Example
Sub PegI_Sample()
On Error GoTo except
'Enable axis Z
Call Ch.Enable(Ch.ACSC_AXIS_Z)
'Wait till Z enabled during 5 sec
Call Ch.WaitMotorEnabled(Ch.ACSC_AXIS_Z, 1, 5000)
'Relative motion with target position of
'10000
Call Ch.ToPoint(Ch.ACSC_AMF_RELATIVE, Ch.ACSC_AXIS_Z, 10000)
'Parameters: Ch.ACSC_AMF_SYNCRONOUS -
'synchronous PEG
'Ch.ACSC_AXIS_Z - axis Z
'0.01 - 10 microseconds pulse
width
'0 - start from 0
'50 - generate pulse every 50
units
'10000 - stop generating at 10000
'Ch.ACSC_NONE, Ch.ACSC_NONE -
with No
'time-based pulse generation
Call Ch.PegI(Ch.ACSC_AMF_SYNCRONOUS, Ch.ACSC_AXIS_Z, 0.01, 0, 50,
10000, Ch.ACSC_NONE, Ch.ACSC_NONE)
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequence(Ch.ACSC_AXIS_Z)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.124 PegR
The method initiates random PEG. Random PEG method specifies an array of points where
position-based events should be generated.
Syntax
object.PegR(Flags, Axis, Width, PointArray, StateArray, TbNumber, TbPeriod)
Parameters
Name Type Description
Flags [in] long Bit-mapped parameter that can include following flag:
• ACSC_AMF_SYNCHRONOUS: PEG starts
synchronously with the motion sequence.
Axis [in] long PEG axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Width [in] double Width of desired pulse in milliseconds.
PointArray [in] string Null-terminated string contained the name of the real
array that stores positions at which PEG pulse should
be generated
The array must be declared as a global variable by an
ACSPL+ program or by the DeclareVariable method.
StateArray [in] string Null-terminated string contained the name of the
integer array that stores desired output state at each
position.
The array must be declared as a global variable by an
ACSPL+ program or by the DeclareVariable method.
If output state change is not desired, this parameter
should be NULL.
TbNumber [in] long Number of time-based pulses generated after each
encoder-based pulse, the range is from 0 to 511.
If time-based pulses aren’t desired, assign
ACSC_NONE in this parameter.
TbPeriod [in] double Period of time-based pulses, period from 0.000025 to
0.75
(Milliseconds). If time-based pulses aren’t desired,
assign ACSC_NONE in this parameter.
Return Value
None.
Remarks
The method initiates random PEG generation (see SPiiPlus ACSPL+ Programmer’s Guide).
StateArray should be NULL if output state won’t change because of PEG.
The time-based pulse generation is optional, if it is not used, TbPeriod and TbNumber should
be ACSC_NONE.
If the method fails, the Error object is filled with the error description.
Example
Sub PegR_Sample()
On Error GoTo except
'Declare variable "PointArr(10)"
Call Ch.DeclareVariable(Ch.ACSC_REAL_TYPE, "PointArr(10)")
'Declare variable "StateArr(10)"
Call Ch.DeclareVariable(Ch.ACSC_INT_TYPE, "StateArr(10)")
'Enable axis Z
Call Ch.Enable(Ch.ACSC_AXIS_Z)
'Wait till axis Z enabled during 5 sec
Call Ch.WaitMotorEnabled(Ch.ACSC_AXIS_Z, 1, 5000)
'Relative motion of axis Z with target
'position of 10000
Call Ch.ToPoint(Ch.ACSC_AMF_RELATIVE, Ch.ACSC_AXIS_Z, 10000)
'Parameters: 0 - Not-Synchronous PEG
'Ch.ACSC_AXIS_Z - axis Z
'0.01 - 10 microseconds pulse
width
'"PointArr" - point array
'"StateArr" - State array
'Ch.ACSC_NONE, Ch.ACSC_NONE -
with No
'time-based pulse generation
Call Ch.PegR(0, Ch.ACSC_AXIS_Z, 0.01, "PointArr", "StateArr",
Ch.ACSC_NONE, Ch.ACSC_NONE)
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequence(Ch.ACSC_AXIS_Z)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.125 Projection
The method sets a projection matrix for segmented motion.
Syntax
object.Projection(Axes, Matrix)
Parameters
Name Type Description
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Matrix [in] string Pointer to the null-terminated string containing the
name of the matrix that provides the specified
projection.
Return Value
None.
Remarks
The method sets a projection matrix for segmented motion.
The projection matrix connects the plane coordinates and the axis values in the axis group. The
projection can provide any transformation as rotation or scaling. The number of the matrix rows
must be equal to the number of the specified axes. The number of the matrix columns must
equal two.
The matrix must be declared before as a global variable by an ACSPL+ program or by the
DeclareVariable method and must be initialized by an ACSPL+ program or by the method.
For more information about projection, see the SPiiPlus ACSPL+ Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub Projection_Sample()
Dim Axes(3)
Dim Point(2) As Double
Dim Center(2) As Double
Dim Matrix(0 To 2, 0 To 1) As Double
'Prepare the projection matrix
Matrix(0, 0) = 1
Matrix(0, 1) = 0
Matrix(1, 0) = 0
Matrix(1, 1) = 1.41421
Matrix(2, 0) = 0
Matrix(2, 1) = 1.41421
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = Ch.ACSC_AXIS_Z
Axes(3) = -1
Point(0) = 10000
Point(1) = 10000
On Error GoTo except
'Declare the matrix that will contain
the
'projection
Call Ch.DeclareVariable(Ch.ACSC_REAL_TYPE, "ProjectionMatrix(3)(2)")
'Initialize the projection matrix
Call Ch.WriteVariable(Matrix, "ProjectionMatrix", Ch.ACSC_NONE)
Call Ch.EnableM(Axes)
'Create a group of the involved axes
Call Ch.Group(Axes)
'Create segmented motion, coordinates of
‘the initial point are(10000,10000)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
Call Ch.Segment(0, Axes, Point)
'Incline the working plane XY by 45°
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = Ch.ACSC_AXIS_Z
Axes(3) = -1
Call Ch.Projection(Axes, "ProjectionMatrix")
'Describe circle with center (1000, 0),
'clockwise rotation
'Although the circle was defined, really
‘on the plane XY we will get the Ellipse
'stretched along the Y axis
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
Center(0) = 1000
Center(1) = 0
Call Ch.Arc2(Axes, Center, -2 * 3.141529)
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequenceM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.126 ReadDPRAMInteger
The method reads 32-bit integer from the DPRAM.
Syntax
ReadDPRAMInteger(Address)
Parameters
Name Type Description
Address [in] long Must be even number from 128 to 508.
Return Value
Long.
The method reads 32-bit integer from the DPRAM.
Remarks
Address has to be even number in the range of 128 to 508, because of 16-bit alignment when
working with DPRAM. Addresses less than 128 are used for internal purposes.
Note
The method can be used only with the PCI and Simulator
communication channels.
If the method fails, the Error object is filled with the error description.
Example
Sub ReadDPRAMInteger_Sample()
Dim DPRint As Long
On Error GoTo except
'Reads 32-bit integer from the DPRAM
from
'address 0xA0
DPRint = Ch.ReadDPRAMInteger(160)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.127 ReadDPRAMReal
The method reads 64-bit Real from the DPRAM.
Syntax
object.ReadDPRAMReal(Address)
Parameters
Name Type Description
Address [in] long Address has to be even number from 128 to 508.
Return Value
Double.
The method reads 64-bit Real from the DPRAM.
Remarks
Address has to be even number in the range of 128 to 504, because of 16-bit alignment when
working with DPRAM. Addresses less than 128 are used for internal purposes.
Note
The method can be used only with the PCI and Simulator
communication channels.
If the method fails, the Error object is filled with the error description.
Example
Sub ReadDPRAMReal_Sample()
Dim DPRreal As Double
On Error GoTo except
'Reads 32-bit real from the DPRAM from
'address 0xA0
DPRreal = Ch.ReadDPRAMReal(160)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.128 ReadVariable
Reads a variable from the controller and returns it as VARIANT.
Syntax
object.ReadVariable(Variable, NBuf, [From1], [To1], [From2], [To2])
Parameters
Name Type Description
Variable [in] string Name of the controller variable
NBuf [in] long Number of program buffer for local variable or
ACSC_NONE for global and standard variable.
From1, To1 [in] long Default value: ASCS_NONE.
Index range (first dimension) starting from zero.
From2, To2 [in] long Default value: ASCS_NONE.
Index range (second dimension) starting from zero.
Return Value
Variant.
The type of return value is real or integer, depending on the type of controller variable..
The return value can be scalar, vector (one-dimensional array) or matrix (two-dimensional
array) depending on data that the controller retrieves.
Remarks
Reads scalar variable, vector, row of matrix, column of matrix or matrix from a controller and
retrieves data as VARIANT. The resultant data are initialized depending on what data is
received from the controller: scalar, vector or matrix.
If you want the return value to be in some specified type, use ReadVariableAsScalar,
ReadVariableAsVector or ReadVariableAsMatrix methods.
The variable can be a standard controller variable, a user global variable, or a user local
variable.
Standard and user global variables have global scope. Therefore, parameter Nbuf must be
ACSC_NONE (-1) for these classes of variables.
User local variable exists only within a buffer. The buffer number must be specified for user
local variable.
The index parameters can be specified as follows:
• To read the whole variable
• To read one element of the variable
• To read several elements of the variable
The following explains how to specify indexes in several typical cases.
1. Reading whole variable
The From1, To1, From2 and To2 indexes should be omitted or specified as ACSC_NONE.
The method returns all elements of Variable as VARIANT initialized as:
• Scalar, if the Variable is scalar
• Vector, if the Variable is a one-dimensional array
• Matrix, if the Variable is a two-dimensional array
• Reading one element from vector (one-dimensional array)
The From1 and To1 should be equal and specify the index of the element. From2 and To2
should be omitted or specified as ACSC_NONE. The method returns the element value as
VARIANT, initialized as scalar.
2. Reading one element from matrix (two-dimensional array)
From1 should equal To1 and specify row number. The From2 and To2 should be equal
and specify column number. The method returns the element value as VARIANT,
initialized as scalar method
3. Reading a sub-vector (more than one vector element)
From1 and To1 should specify the sub-vector index range, where From1 should be less
than To1. From2 and To2 should be omitted or specified as ACSC_NONE. The method
returns data as VARIANT, initialized as a vector with the number of elements equal to
To1–From1+1.
4. Reading a row or part of a row from a matrix
From1 should equal To1 and specify the row number. The From2 and To2 should specify
the element range within the specified row, where From2 should be less than To2. The
method returns data as VARIANT, initialized as a vector with the number of elements equal
To2–From2+1.
5. Reading a column or part of a column from a matrix
From1 and To1 should specify the range of rows within the specified column, where
From1 should be less than To1. From2 and To2 should be equal and specify the column
number. The method returns data as VARIANT, initialized as a vector with the number of
elements equal to To1–From1+1.
6. Reading sub-matrix from matrix
From1 and To1 should specify the range of rows, where From1 should be less then To1.
From2 and To2 should specify columns range, where From2 should be less than To2. The
method returns data as VARIANT, initialized as a matrix with the number of rows equal to
To1–From1+1 and the number of columns equal to To2–From2+1.
If the method fails, the Error object is filled with the error description.
Example
Sub ReadVariable_Sample()
Dim Var
On Error GoTo except
'Reading whole variable, if the variable is scalar
'Parameters: "BAUD " - controller variable name
' Ch.ACSC_NONE - standard variable
Var = Ch.ReadVariable ("BAUD ", Ch.ACSC_NONE)
'Now Var is a scalar value
' 1 – From1
' 5 – To1
Var = Ch.ReadVariable("VEL", Ch.ACSC_NONE,1,5)
'Now Var is a vector of size 5
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.129 ReadVariableAsScalar
Reads variable from a controller and returns as scalar.
Syntax
object.ReadVariableAsScalar (Variable, NBuf, [Ind1], [Ind2])
Parameters
Name Type Description
Variable [in] string Name of the controller variable
NBuf [in] long Number of program buffer for local variable or
ACSC_NONE for global and standard variable.
Ind1 [in] long Default value: ASCS_NONE.
Index of first dimension (row number) starting from
zero.
Ind2 [in] long Default value: ASCS_NONE.
Index of second dimension (column number) starting
from zero.
Return Value
Variant.
The return value is scalar. The type of return value is real or integer, corresponding to the type
of controller variable.
Remarks
Reads a scalar variable, one element of a vector or one element of a matrix from a controller
and returns the value as scalar.
If you require a method return value as one vector element, use the ReadVariableAsVector
method. If you require a method return value as one matrix element, use the
ReadVariableAsMatrix method.
The variable can be a standard controller variable, a user-defined global variable, or a user-
defined local variable.
Standard and user global variables have global scope. Therefore, Nbuf must be ACSC_NONE
(–1) for these classes of variables.
User-defined local variables exist only within a buffer. The buffer number must be specified for
user-defined local variables.
The following explains how to read indexes in several typical cases.
1. Reading a scalar variable:
The Ind1 and Ind2 indexes should be omitted or specified as ACSC_NONE.
2. Reading one element from a vector (one-dimensional array):
Ind1 should specify index of the element in the vector. Ind2 should be omitted or specified
as ACSC_NONE.
3. Reading one element from a matrix (two-dimensional array):
Ind1 should specify a row number and Ind2 should specify a column number of the element
in the matrix.
If the method fails, the Error object is filled with the error description.
Example
Sub ReadVariableAsScalar_Sample()
'Var in the next 3 examples is returned as scalar
Dim Var
Dim Str As String
On Error GoTo except
'Reading scalar variable
'Parameters: "BAUD" - controller variable name.
5.130 ReadVariableAsVector
Reads variable from a controller and returns it as vector.
Syntax
object.ReadVariable(Variable, NBuf, [From1], [To1], [From2], [To2]))
Parameters
Name Type Description
Variable [in] string Name of the controller variable
NBuf [in] long Number of program buffer for local variable or
ACSC_NONE for global and standard variable.
From1, To1 [in] long Default value: ASCS_NONE.
Index range (first dimension) starting from zero.
From2, To2 [in] long Default value: ASCS_NONE.
Index range (second dimension) starting from zero.
Return Value
Variant.
The return value is one-dimensional array (vector). The type of return value is real or integer,
corresponding to the type of controller variable.
Remarks
Reads variable from a controller and returns it as vector.
If you want a return value as scalar or matrix use ReadVariableAsScalar or
ReadVariableAsMatrix methods correspondingly.
The variable can be a standard controller variable, a user global variable, or a user local
variable.
Standard and user global variables have global scope. Therefore, parameter Nbuf must be
ACSC_NONE (-1) for these classes of variables.
User local variable exists only within a buffer. The buffer number must be specified for user
local variable.
The index parameters can be specified in many different ways to read whole variable, one
element of the variable or several elements of the variable. The following explains how to
specify indexes in several typical cases.
1. Reading whole variable:
The From1, To1, From2 and To2 indexes should be omitted or specified as ACSC_NONE.
The method returns all elements of Variable as VARIANT initialized as:
Vector of size 1 , if the Variable is scalar
Vector of size N, if the Variable is vector of size N
If the Variable is matrix, the method will return an error.
2. Reading sub-vector from vector:
The From1 and To1 should specify sub-vector index range, From1 should be less than or
equal to To1. The From2 and To2 should be omitted or specified as ACSC_NONE. The
methods returns data as vector with number of elements equals to To1-From1+1.
3. Reading a row or part of a row from matrix::
The From1 and To1 should be equal and specify row number. The From2 and To2 should
specify elements range within the specified row, From2 should be less than or equal to To2.
The methods returns data as vector with number of elements equals to To2-From2+1.
4. Reading a column or part of a column from matrix:
The From1 and To1 should specify rows range within the specified column, From1 should
be less than or equal to To1. The From2 and To2 should be equal and specify column
number. The methods returns data as vector with number of elements equals to To1-
From1+1.
If the method fails, the Error object is filled with the error description.
Example
Sub ReadVariableAsVector_Sample()
'Var in the next 3 examples is returned as vector
Dim Var
Dim Str As String
On Error GoTo except
'Reading whole variable, if the variable is scalar
'Parameters: "BAUD" - controller variable name.
' Ch.ACSC_NONE - standard variable
Var = Ch.ReadVariableAsVector("BAUD ", Ch.ACSC_NONE)
'Now Var is a vector of size 1
' 1 – To1
' 0 – From2
' 2 – To2
Var = Ch.ReadVariableAsVector("MyMatrix", Ch.ACSC_NONE, 1,1,0,2)
'Now Var is a vector of size 3
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.131 ReadVariableAsMatrix
Reads variable from a controller and returns it as matrix.
Syntax
object.ReadVariableAsMatrix(Variable, NBuf, [From1], [To1], [From2], [To2])
Parameters
Name Type Description
Variable [in] string Name of the controller variable
NBuf [in] long Number of program buffer for local variable or
ACSC_NONE for global and standard variable.
Return Value
Variant.
The return value is a two-dimensional array (matrix). The type of return value is real or integer,
corresponding to the type of controller variable.
Remarks
Reads a variable from a controller and returns it as matrix.
If you want a return value as scalar or vector use ReadVariableAsScalar or
ReadVariableAsVector methods correspondingly.
The variable can be a standard controller variable, a user global variable, or a user local
variable.
Standard controller variables and user global variables have a global scope. Therefore, the
parameter Nbuf must be ACSC_NONE (–1) for these classes of variables.
User local variable exists only within a buffer. The buffer number must be specified for user
local variable.
The index parameters can be specified in many different ways to read whole variable, one
element of the variable or several elements of the variable. The following explains how to
specify indexes in several typical cases.
• Reading a whole variable
From1, To1, From2 and To2 indexes should be omitted or specified as ACSC_NONE. The
method returns all elements of Variable as VARIANT initialized as follows:
Matrix 1x1 , if the Variable is scalar
Matrix 1xN, if the Variable is vector of size N
Matrix NxM, if the Variable matrix NxM
• Reading a sub-vector from a vector
From1 and To1 should specify the sub-vector index range, From1 should be less than or
equal to To1. From2 and To2 should be omitted or specified as ACSC_NONE. The method
returns data as VARIANT, initialized as a matrix of size ( To1–From1+1)x1.
• Reading a sub-matrix from a matrix
From1 and To1 should specify a range of rows, where From1 should be less than or equal
to To1. From2 and To2 should specify a range of columns , where From2 should be less
than or equal to To2. The method returns data as VARIANT, initialized as matrix with the
number of rows equal to To1–From1+1 and the number of columns equals To2–From2+1.
If the method fails, the Error object is filled with the error description.
Example
Sub ReadVariableAsMatrix_Sample()
'Var in the next 3 examples is returned as matrix
Dim Var
On Error GoTo except
'Reading whole variable, if the variable is scalar
'Read the controller scalar variable BAUD to variable Var
'Parameters: "BAUD " - controller variable name.
' Ch.ACSC_NONE - standard variable
Var = Ch.ReadVariableAsMatrix ("BAUD ", Ch.ACSC_NONE)
'Now Var is a matrix of size 1x1
' 5 – To1
Var = Ch.ReadVariableAsMatrix ("VEL", Ch.ACSC_NONE,1,5)
'Now Var is a matrix of size 1x5
Exit Sub
except:MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.132 Receive
The method receives a message from the controller.
Syntax
object.Receive()
Parameters
None
Return Value
String.
The method receives a message from the controller.
If no characters were received, the method returns zero.
Remarks
The method retrieves currently stored data from an input internal library buffer.
Note
This method is only used for compatibility with the previous version of
zero-library. To communicate with the controller, use the Transaction
or the Command methods.
If the method fails, the Error object is filled with the error description.
Example
Sub Receive_Sample()
Dim Rec As String
Dim Cmd As String
Cmd = "?FPOS0" 'Feedcack position of axis X
On Error GoTo except
Call Ch.Send(Cmd)
'The method retrieves currently stored
data
'from an input internal library buffer
Rec = Ch.Receive
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.133 ReleaseComm
The method releases a communication channel.
object.ReleaseComm()
Parameters
None.
Return Value
None.
Remarks
The method releases the communication channel captured by CaptureComm and allows other
threads to communicate through the channel.
If the method fails, the Error object is filled with the error description.
Example
Sub ReleaseComm_Sample()
On Error GoTo except
'The method releases a communication
channel
Call Ch.ReleaseComm
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.134 ResetIndexState
The method resets the specified bit of the index/mark state.
Syntax
object.ResetIndexState(Axis, Mask)
Parameters
Name Type Description
Mask [in] long The parameter contains bit to be cleared. Only one of
the following flags can be specified:
• ACSC_IST_IND – a primary encoder index of the
specified axis is latched
• ACSC_IST_IND2 – a secondary encoder index of
the specified axis is latched
• ACSC_IST_MARK – a MARK1 signal has been
generated and position of the specified axis was
latched
• ACSC_IST_MARK2 – a MARK2 signal has been
generated and position of the specified axis was
latched
Return Value
None.
Remarks
The method resets the specified bit of the index/mark state. The parameter Mask contains a bit,
which must be cleared, i.e. the method resets only that bit of the index/mark state, which
corresponds to non-zero bit of the parameter Mask. To get the current index/mark state, use the
GetIndexState method.
If the method fails, the Error object is filled with the error description.
Example
Sub ResetIndexState_Sample()
Dim IState As Long
On Error GoTo except
'Resets the specified bit of the
index/mark
'state
Call Ch.ResetIndexState(Ch.ACSC_AXIS_X, Ch.ACSC_IST_IND)
Call Ch.ResetIndexState(Ch.ACSC_AXIS_X, Ch.ACSC_IST_IND2)
Call Ch.ResetIndexState(Ch.ACSC_AXIS_X, Ch.ACSC_IST_MARK)
Call Ch.ResetIndexState(Ch.ACSC_AXIS_X, Ch.ACSC_IST_MARK2)
IState = Ch.GetIndexState(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.135 RunBuffer
The method starts up ACSPL+ program in the specified buffer.
Syntax
object.RunBuffer(Buffer, [Label])
Parameters
Name Type Description
Label [in] string Default value: “”. Label in the program that the
execution starts from.
If NULL is specified instead of a pointer, the execution
starts from the first line.
Return Value
None.
Remarks
The method starts up ACSPL+ program in the specified buffer. The execution starts from the
specified label, or from the first line if the label is not specified.
If the program was not compiled before, the method first compiles the program and then starts
it. If an error was encountered during compilation, the program does not start.
If the program was suspended by the SuspendBuffer method, the method resumes the program
execution from the powhere the program was suspended.
The method waits for the controller response.
The controller response indicates that the program in the specified buffer was started
successfully. The method does not wait for the program end. To wait for the program end, use
the WaitProgramEnd method.
If the method fails, the Error object is filled with the error description.
Example
Sub RunBuffer_Sample()
Dim Index As Long
Dim PState As Long
'Appends and runs buffers 0 to 8
On Error GoTo except
For Index = 0 To 8
Call Ch.AppendBuffer(Index, "ST:")
Call Ch.AppendBuffer(Index, "!an empty loop")
Call Ch.AppendBuffer(Index, "goto ST")
Call Ch.RunBuffer(Index)
Next Index
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.136 Send
The method sends a message to the controller.
Syntax
object.Send(Command)
Parameters
Name Type Description
Command [in] string Command to be sent
Return Value
None.
Remarks
The method sends a command to the controller. The method does not receive a controller
response.
The method can be useful for applications like communication terminal to send any commands
to the controller. All background communication can be received with help of the GetHistory
method, which retrieves communication history.
If the method fails, the Error object is filled with the error description.
Example
Sub Send_Sample()
Dim Cmd As String
Cmd = "?VR" 'Firmware version
On Error GoTo except
'The method sends the message ?VR to the
'controller
Call Ch.Send(Cmd)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.137 Segment
The method initiates a multi-axis segmented motion.
Syntax
object.Segment(Flags, Axes, Point)
Parameters
Name Type Description
Flags [in] long Bit-mapped parameter that can include one or more of
the following flags:
• ACSC_AMF_WAIT: plan the motion but don’t
start it until the method GoM is executed.
• ACSC_AMF_VELOCITY: the motion will use
velocity specified for each segment instead of the
default velocity.
• ACSC_AMF_CYCLIC: the motion uses the
segment sequence as a cyclic array: after the last
segment, move along the first segment etc.
• ACSC_AMF_VELOCITYLOCK: slaved motion:
the motion advances in accordance to the master
value of the leading axis.
• ACSC_AMF_POSITIONLOCK: slaved motion,
strictly conformed to master.
• ACSC_AMF_EXTRAPOLATED: if a master
value travels beyond the specified path, the last or
the first segment is extrapolated.
• ACSC_AMF_STALLED: if a master value travels
beyond the specified path, the motion stalls at the
last or first point.
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Point [in] variant Array of the coordinates of the initial point on the
plane. The number and order of values must
correspond to the Axes array. The Point must specify a
value for each element of Axes except the last –1
element.
Return Value
None.
Remarks
The method initiates a multi-axis segmented motion.
Segmented motion moves axes along a continuous path. The path is defined as a sequence of
linear and arc segments on the plane. Although segmented motion follows a flat path, it can
involve any number of axes, because the motion plane can be connected to the axes at any
projection transformation. To use such transformation, use the Projection method.
The method itself does not specify any segment, so the created motion starts only after the first
segment is specified. The segments of motion are specified by using Line1, Arc1, Arc2,
ExtLine, ExtArc1, or ExtArc2 methods that follow this method.
The motion finishes when the ExtAddPointM method is executed. If the call of
EndSequenceM is omitted, the motion will stop at the last segment of the sequence and wait
for the next segment. No transition to the next motion in the motion queue will occur until the
method EndSequenceM is executed.
During positioning to each point, a vector velocity profile is built using the default values of
velocity, acceleration, deceleration, and jerk of the axis group. If the AFM_VELOCITY flag is
not specified, the default value of VELOCITY is used as well. If the AFM_VELOCITY flag
is specified, the value of VELOCITY specified in subsequent ExtLine, ExtArc1, or ExtArc2
methods is used.
The flags ACSC_AMF_EXTRAPOLATED and ACSC_AMF_STALLED are relevant only
for slaved motion and must be used with ACSC_AMF_VELOCITYLOCK or
ACSC_AMF_POSITIONLOCK flags.
The method waits for the controller response.
The controller response indicates that the command was accepted and the motion was planned
successfully. The method does not wait and does not validate the end of the motion. To wait for
the motion end, use the WaitMotionEnd method.
If the method fails, the Error object is filled with the error description.
Example
Call Ch.EnableM(Axes)
Sub Segment_Sample()
Dim Points(1) As Double
Dim Center(1) As Double
Dim Axes(2)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
On Error GoTo except
'Create segmented motion, coordinates of
the
'initial point are (1000,1000)
Points(0) = 1000
Points(1) = 1000
SetAcceleration
Syntax
object.SetAcceleration(Axis, Acceleration)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Acceleration [in] double The value specifies required motion acceleration. The
value will be used in the subsequent motions except the
master-slave motions.
Return Value
None.
Remarks
The method writes the specified value to the controller.
One value can be specified for each axis.
A single-axis motion uses the value of the corresponding axis. A multi-axis motion uses the
value of the leading axis. The leading axis is an axis specified first in the motion command.
The method affects the motions initiated after the method call. The method has no effect on any
motion that was started or planned before the method call. To change acceleration of an
executed or planned motion, use the SetAccelerationImm method.
The method has no effect on the master-slave motions.
If the method fails, the Error object is filled with the error description.
Example
Sub SetAcceleration_Sample()
On Error GoTo except
'Defines a value of motion acceleration
to
'200000
Call Ch.SetAcceleration(Ch.ACSC_AXIS_X, 200000)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.138 SetAccelerationImm
The method defines a value of motion acceleration. Unlike SetAcceleration, the method has
immediate effect on any executed and planned motion.
Syntax
object.SetAccelerationImm(Axis, Acceleration)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Acceleration [in] double The value specifies required motion acceleration.
Return Value
None.
Remarks
The method writes the specified value to the controller.
Example
Sub SetAccelerationImm_Sample()
On Error GoTo except
'Writes the specified acceleration value
to
'the controller
Call Ch.SetAccelerationImm(Ch.ACSC_AXIS_X, 300000)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.139 SetAnalogOutput
The method writes the current numerical value to the specified analog outputs.
Syntax
object.SetAnalogOutput(Port, Value)
Parameters
Name Type Description
Port [in] long Number of the output port.
Value [in] long The value to be writes to the specific analog outputs.
Return Value
None.
Remarks
The method writes the current numerical value to the specified analog outputs. To get a value
of the specific analog outputs, use the GetAnalogOutput method.
Analog outputs are represented in the controller variable AOUT. For more information about
analog outputs, see the SPiiPlus ACSPL+ Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub SetAnalogOutput_Sample()
'The method writes the value 100 to the analog outputs of port 0 to 15
Dim Index As Long
On Error GoTo except
For Index = 0 To 15
Call Ch.SetAnalogOutput(Index, 100)
Next Index
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.140 SetCommOptions
The method sets the communication options.
Syntax
object.SetCommOptions(Options)
Parameters
Return Value
None.
Remarks
The method sets the communication options. To get current communication option, call
GetCommOptions.
To add some communication options to the current configuration, modify an Option parameter
that has been filled in by a call to GetCommOptions. This ensures that the other
communication options will have same values.
If the method fails, the Error object is filled with the error description.
Example
Sub SetCommOptions_Sample()
'The example sets the mode with checksum
Dim Options As Long
On Error GoTo except
Options = Ch.GetCommOptions
Options = Options Or Ch.ACSC_COMM_USE_CHECKSUM
Call Ch.SetCommOptions(Options)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.141 SetConf
The method writes system configuration data.
Syntax
object.SetConf(Key, Index, Value)
Parameters
Name Type Description
Key [in] long Configuration Keys (see Section 6.14) that specify
the configured feature. Assigns value of key argument
in ACSPL+ SetConf method.
Index [in] long Specifies corresponding axis or buffer number.
Assigns value of index argument in ACSPL+ SetConf
method.
Value [in] double Value to write to specified key. Assigns value of value
argument in ACSPL+ SetConf method.
Return Value
None.
Remarks
The method writes system configuration data. The Key parameter specifies the feature number
and the Index parameter defines axis or buffer to which it should be applied. Use
ACSC_CONF_XXX properties in the value field. For detailed description of system
configuration see the description of the SetConf method in the SPiiPlus ACSPL+
Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub SetConf_Sample()
On Error GoTo except
'Writes system configuration data of
axis X
'to 1 with key 205
Call Ch.SetConf(Ch.ACSC_CONF_DIGITAL_SOURCE_KEY, Ch.ACSC_AXIS_X, 1)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.142 SetDeceleration
The method defines a value of motion deceleration.
Syntax
object.SetDeceleration(Axis, Deceleration)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Deceleration [in] double The value specifies a required motion deceleration. The
value will be used in the subsequent motions except the
master-slave motions.
Return Value
None.
Remarks
The method writes the specified value to the controller.
One value can be specified for each axis.
A single-axis motion uses the value of the corresponding axis. A multi-axis motion uses the
value of the leading axis. The leading axis is an axis specified first in the motion command.
The method affects the motions initiated after the method call. The method has no effect on any
motion that was started or planned before the method call. To change deceleration of an
executed or planned motion, use the SetDecelerationImm method.
The method has no effect on the master-slave motions.
If the method fails, the Error object is filled with the error description.
Example
Sub SetDeceleration_Sample()
On Error GoTo except
'Sets deceleration value of 200000 to
axis X
Call Ch.SetDeceleration(Ch.ACSC_AXIS_X, 200000)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.143 SetDecelerationImm
The method defines a value of motion deceleration. Unlike SetDeceleration, the method has
immediate effect on any executed and planned motion.
Syntax
object.SetDecelerationImm(Axis, Deceleration)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Deceleration [in] double The value specifies required motion deceleration.
Return Value
None.
Remarks
The method writes the specified value to the controller.
One value can be specified for each axis.
A single-axis motion uses the value of the corresponding axis. A multi-axis motion uses the
value of the leading axis. The leading axis is an axis specified first in the motion command.
The method affects:
• The currently executed motion.
• The waiting motions that were planned before the method call.
• The motions that will be commanded after the method call.
The method has no effect on the master-slave motions.
If the method fails, the Error object is filled with the error description.
Example
Sub SetDecelerationImm_Sample()
On Error GoTo except
'Writes the specified deceleration value
to
'the controller
Call Ch.SetDecelerationImm(Ch.ACSC_AXIS_X, 300000)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.144 SetExtOutput
The method sets the specified extended output to the specified value.
Syntax
object.SetExtOutput(Port, Bit, Value)
Parameters
Name Type Description
Port [in] long Number of the extended output port.
Bit [in] long Number of the specific bit.
Value [in] long The value to be written to the specified output. Any
non-zero value is interpreted as 1.
Return Value
None.
Remarks
The method sets the specified extended output to the specified value. To set values of all outputs
of the specific extended port, use the SetExtOutputPort method.
Extended outputs are represented in the controller EXTOUT variable. For more information
about extended outputs, see the SPiiPlus ACSPL+ Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub SetExtOutput_Sample()
'The method sets output 0 of extended
port 0
'to 1
'(ACSPL+ equivalent: EXTOUT(0).0 = 1)
On Error GoTo except
Call Ch.SetExtOutput(0, 0, 1)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.145 SetExtOutputPort
The method sets the specified extended output port to the specified value.
Syntax
object.SetExtOutputPort(Port, Value)
Parameters
Name Type Description
Port [in] long Number of the extended output port.
Value [in] long The value to be written to the specified output port.
Return Value
None.
Remarks
The method sets the specified extended output port to the specified value. To set the value of
the specific output of the specific extended port, use the SetExtOutput method.
Extended outputs are represented in the controller variable EXTOUT. For more information
about extended outputs, see the SPiiPlus ACSPL+ Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub SetExtOutputPort_Sample()
'The method sets outputs of extended
port 0
'to 15 to 100
Dim Index As Double
5.146 SetFaultMask
Note
Certain controller faults provide protection against potential serious
bodily injury and damage to the equipment. Be aware of the
implications before disabling any alarm, limit, or error.
The method sets the mask that enables or disables the examination and processing of the
controller faults.
Syntax
object.SetFaultMask(Axis, Mask)
Parameters
Name Type Description
Axis [in] long The parameter specifies the axis (ACSC_AXIS_X
corresponds to X, ACSC_AXIS_Y – to Y etc.) to mask
the motor faults, or ACSC_NONE to mask the system
faults.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Return Value
None.
Remarks
The method sets the mask, that enables/disables the examination and processing of the
controller faults. The two types of controller faults are motor faults and system faults.
The motor faults are related to a specific motor, the power amplifier or the Servo processor. For
example: Position Error, Encoder Error or Driver Alarm.
The system faults are not related to any specific motor. For example: Emergency Stop or
Memory Fault.
For more information about the controller faults, see the SPiiPlus ACSPL+ Programmer’s
Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub SetFaultMask_Sample()
On Error GoTo except
'Enable all faults of axis X
Call Ch.SetFaultMask(Ch.ACSC_AXIS_X, ACSC_NONE)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.147 SetFPosition
The method assigns a current value of feedback position.
Syntax
object.SetFPosition(Axis, FPosition)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
FPosition [in] double The value specifies the current value of feedback
position.
Return Value
None.
Remarks
The method assigns a current value to the feedback position. No physical motion occurs. The
motor remains in the same position; only the internal controller offsets are adjusted so that the
periodic calculation of the feedback position will provide the required results.
For more information see the explanation of the SET command in the SPiiPlus ACSPL+
Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub SetFPosition_Sample()
Dim Index As Long
On Error GoTo except
'Sets feedback position value of 0 to
all
'axes
For Index = 0 To 7
Call Ch.SetFPosition(Ch.ACSC_AXIS_X, 0)
Next Index
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.148 SetInterruptMask
The method sets the mask for specified interrupt.
Syntax
object.SetInterruptMask(Interrupt, Mask)
Parameters
Name Type Description
Interrupt [in] long Specifies one of the following interrupts:
• ACSC_INTR_PEG – a position event signal (PEG)
has been generated
• ACSC_INTR_MARK1 – a MARK1 signal has
been generated
• ACSC_INTR_MARK2 – a MARK2 signal has
been generated
• ACSC_INTR_PHYSICAL_MOTION_END – a
physical motion has finished
• ACSC_INTR_LOGICAL_MOTION_END – a
logical motion has finished
• ACSC_INTR_MOTION_FAILURE – a motion
has been interrupted due to a fault
• ACSC_INTR_MOTOR_FAILURE – a motor has
been disabled due to a fault
• ACSC_INTR_PROGRAM_END – an ACSPL+
program has finished
• ACSC_INTR_COMMAND – a line of ACSPL+
commands has been executed in a dynamic buffer
• ACSC_INTR_ACSPL_PROGRAM – an ACSPL+
program has generated the interrupt by
INTERRUPT command
• ACSC_INTR_INPUT – a digital input changed
from 0 to 1
• ACSC_INTR_MOTION_START – motion starts
• ACSC_INTR_MOTION_PHASE_CHANGE –
motion profile changes the phase
• ACSC_INTR_TRIGGER – AST.#TRIGGER bit
goes high
Return Value
None.
Remarks
The method sets the bit mask for specified interrupt. To get current mask for specified interrupt,
call GetInterruptMask.
Using a mask, you can reduce the number of generated events. The event will be generated only
if the interrupt is caused by an axis/buffer/input that corresponds to non-zero bit in the related
mask.
Note
The method can be used only with the PCI communication channel.
If the method fails, the Error object is filled with the error description.
Example
Sub SetInterruptMask_Sample()
On Error GoTo except
'Sets the mask for specified interrupt
only
'for axis X
Call Ch.SetInterruptMask(Ch.ACSC_INTR_PROGRAM_END,
Ch.ACSC_MASK_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.149 SetIterations
The method sets the number of iterations in one transaction.
Syntax
object.SetIterations(Iterations)
Parameters
Name Type Description
Iterations [in] long Number of iterations
Return Value
None.
Remarks
If, after the transmission of command to the controller, the controller response is not received
during the predefined time, the library repeats the command transmission. The number of those
iterations is defined by the Iterations parameter for each communication channel
independently.
Most of the SPiiPlus COM methods perform communication with the controller by transactions
(i.e. they send commands and wait for responses) that are based on the Transaction method.
Therefore, the changing of the number of iterations can have an influence on the behavior of the
user application.
The default number of iterations for all communication channels is 2.
If the method fails, the Error object is filled with the error description.
Example
Sub SetIterations_Sample()
On Error GoTo except
'Sets the number of iterations in one
'transaction number of iterations for
all
'communication channels is 2.
Call Ch.SetIterations(2)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.150 SetJerk
The method defines a value of motion jerk.
Syntax
object.SetJerk(Axis, Jerk)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Jerk [in] double The value specifies a required motion jerk. The value
will be used in the subsequent motions except for the
master-slave motions.
Return Value
None.
Remarks
The method writes the specified value to the controller.
One value can be specified for each axis.
A single-axis motion uses the value of the corresponding axis. A multi-axis motion uses the
value of the leading axis. The leading axis is an axis specified first in the motion command.
The method affects the motions initiated after the method call. The method has no effect on any
motion that was started or planned before the method call. To change the jerk of an executed or
planned motion, use the SetJerkImm method.
The method has no effect on the master-slave motions.
If the method fails, the Error object is filled with the error description.
Example
Sub SetJerk_Sample()
Dim Index As Long
On Error GoTo except
'Sets jerk value of 2e7 to all axes
For Index = 0 To 7
Call Ch.SetJerk(Index, 20000000)
Next Index
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.151 SetJerkImm
The method defines a value of motion jerk. Unlike SetJerk, the method has an immediate effect
on any executed and planned motion.
Syntax
object.SetJerkImm(Axis, Jerk)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Jerk [in] double The value specifies required motion jerk.
Return Value
None.
Remarks
The method writes the specified value to the controller.
One value can be specified for each axis.
A single-axis motion uses the value of the corresponding axis. A multi-axis motion uses the
value of the leading axis. The leading axis is an axis specified first in the motion command.
The method affects:
• The currently executed motion.
• The waiting motions that were planned before the method call.
• The motions that will be commanded after the method call.
The method has no effect on the master-slave motions.
If the method fails, the Error object is filled with the error description.
Example
Sub SetJerkImm_Sample()
On Error GoTo except
'Writes the specified jerk value to the
'controller
Call Ch.SetJerkImm(Ch.ACSC_AXIS_X, 2000000)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.152 SetKillDeceleration
The method defines a value of motion kill deceleration.
Syntax
object.SetKillDeceleration(Axis, KillDeceleration)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
KillDeceleration [in] double The value specifies a required motion kill deceleration.
The value will be used in the subsequent motions.
Return Value
None.
Remarks
The method writes the specified value to the controller.
One value can be specified for each axis.
A single-axis motion uses the value of the corresponding axis. A multi-axis motion uses the
value of the leading axis. The leading axis is an axis specified first in the motion command.
The method affects the motions initiated after the method call. The method has no effect on any
motion that was started or planned before the method call.
If the method fails, the Error object is filled with the error description.
Example
Sub SetKillDeceleration_Sample()
Dim Index As Long
Dim Axes(8)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = Ch.ACSC_AXIS_Z
Axes(3) = Ch.ACSC_AXIS_T
Axes(4) = Ch.ACSC_AXIS_A
Axes(5) = Ch.ACSC_AXIS_B
Axes(6) = Ch.ACSC_AXIS_C
Axes(7) = Ch.ACSC_AXIS_D
Axes(8) = -1
On Error GoTo except
'Sets kill deceleration value of 100000
to
'all axes
For Index = 0 To 7
Call Ch.SetKillDeceleration(Axes(Index), 100000)
Next Index
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.153 SetKillDecelerationImm
The method defines a value of motion kill deceleration. Unlike SetKillDeceleration, the
method has an immediate effect on any executed and planned motion.
Syntax
object.SetKillDecelerationImm(Axis, Deceleration)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
KillDeceleration [in] double The value specifies the required motion deceleration.
Return Value
None.
Remarks
The method writes the specified value to the controller.
One value can be specified for each axis.
A single-axis motion uses the value of the corresponding axis. A multi-axis motion uses the
value of the leading axis. The leading axis is an axis specified first in the motion command.
The method affects:
• The currently executed motion.
• The waiting motions that were planned before the method call.
• The motions that will be commanded after the method call.
The method has no effect on the master-slave motions.
If the method fails, the Error object is filled with the error description.
Example
Sub SetKillDecelerationImm_Sample()
On Error GoTo except
'Defines a value of motion kill deceleration of 200000
Call Ch.SetKillDecelerationImm(Ch.ACSC_AXIS_X, 200000)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.154 SetMaster
The method initiates calculating of master value for an axis.
Syntax
object.SetMaster(Axis, Formula)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Formula [in] string ASCII string that specifies a rule for calculating master
value.
Return Value
None.
Remarks
The method initiates calculating of master value for an axis.
The master value for each axis is presented in the controller as one element of the MPOS array.
Once the SetMaster method is called, the controller is calculates the master value for the
specified axis each controller cycle.
The SetMaster method can be called again for the same axis at any time. At that moment, the
controller discards the previous formula and accepts the newly specified formula for the master
calculation.
The method waits for the controller response.
The controller response indicates that the command was accepted and the controller starts
calculating the master value according to the formula.
The Formula string can specify any valid ACSPL+ expression that uses any standard or user
global variables as its operands.
If the method fails, the Error object is filled with the error description.
Example
Sub SetMaster_Sample()
Dim MFormula As String
'Master value is calculated as feedback
5.155 SetOutput
The method sets the specified digital output to the specified value.
Syntax
object.SetOutput(Port, Bit, Value)
Parameters
Name Type Description
Port [in] long Number of the output port.
Return Value
None.
Remarks
The method sets the specified digital output to the specified value. To set values of all outputs
of a specific port, use the SetOutputPort method.
Digital outputs are represented in the controller variable OUT. For more information about
digital outputs, see the SPiiPlus ACSPL+ Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub SetOutput_Sample()
'The method sets output 0 of port 0 to 1
'( ACSPL+ equivalent: OUT(0).0 = 1 )
On Error GoTo except
Call Ch.SetOutput(0, 0, 1)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.156 SetOutputPort
The method sets the specified digital output port to the specified value.
Syntax
object.SetOutputPort(Port, Value)
Parameters
Name Type Description
Port [in] long Number of the output port.
Value [in] long The value to be writes to the specified output port.
Return Value
None.
Remarks
The method sets the specified digital output port to the specified value. To set the value of the
specific output of the specific port, use the SetOutput method.
Digital outputs are represented in the controller variable OUT. For more information about
digital outputs, see the SPiiPlus ACSPL+ Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub SetOutputPort_Sample()
'The method sets outputs 0 to 15 to 100
Dim Index As Long
5.157 SetResponseMask
Note
Certain controller default responses provide protection against
potential serious bodily injury and damage to equipment. Be aware of
the implications before disabling responses to any alarm, limit, or
error.
The method retrieves the mask that defines the motor or the system faults for which the
controller provides the default response.
Syntax
object.SetResponseMask(Axis, Mask)
Parameters
Name Type Description
Return Value
None.
Remarks
The method retrieves the mask that defines the motor or the system faults for which the
controller provides the default response.
The default response is a controller-predefined action for the corresponding fault. For more
information about the controller faults and default responses, see the SPiiPlus ACSPL+
Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub SetResponseMask_Sample()
On Error GoTo except
'Enable all default responses
Call Ch.SetResponseMask(Ch.ACSC_AXIS_X, ACSC_NONE)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.158 SetRPosition
The method assigns a current value of reference position.
Syntax
object.SetRPosition(Axis, RPosition)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Rposition [in] long The value specifies the current value of reference
position.
Return Value
None.
Remarks
The method assigns a current value to the reference position. No physical motion occurs. The
motor remains in the same position; only the internal controller offsets are adjusted so that the
periodic calculation of the reference position will provide the required results.
For more information see explanation of the SET command in the SPiiPlus ACSPL+
Programmer’s Guide.
If the method fails, the Error object is filled with the error description.
Example
Sub SetRPosition_Sample()
Dim Index As Long
Dim Axes(8)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = Ch.ACSC_AXIS_Z
Axes(3) = Ch.ACSC_AXIS_T
Axes(4) = Ch.ACSC_AXIS_A
Axes(5) = Ch.ACSC_AXIS_B
Axes(6) = Ch.ACSC_AXIS_C
Axes(7) = Ch.ACSC_AXIS_D
Axes(8) = -1
5.159 SetSafetyInputPortInv
The method sets the set of bits that define inversion for the specified safety input port.
Syntax
object.SetSafetyInputPortInv(Axis, Value)
Parameters
Name Type Description
Axis [in] long The parameter specifies the axis (ACSC_AXIS_X
corresponds to X, ACSC_AXIS_Y – to Y etc.) to set
the specified safety motor inputs port, or
ACSC_NONE to set the specified safety system inputs
port.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Value [in] long The specific inversion.
To set a specific bit, use the following properties:
• ΑCSC_SAFETY_RL
• ACSC_SAFETY_LL
• ACSC_SAFETY_RL2
• ACSC_SAFETY_LL2,
• ACSC_SAFETY_HOT
• ACSC_SAFETY_DRIVE.
To set an inversion for the specific system safety input
port, use only the ACSC_SAFETY_ES property.
See Section 6.11, Safety Control Masks for a detailed
description of these properties.
Return Value
None.
Remarks
The method sets the bits that define inversion for the specified safety input port. To retrieve an
inversion for the specific safety input port, use the GetSafetyInputPortInv method.
If a bit of the set is zero, the corresponding signal will not be inverted and therefore high voltage
is considered an active state. If a bit is raised, the signal will be inverted and low voltage is
considered an active state.
The inversions of safety inputs are represented in the controller variables SAFINI and
S_SAFINI. For more information about safety, inputs see SPiiPlus ACSPL+ Programmer’s
Guide.
I
Note
Some safety inputs can be unavailable in a specific controller model.
For example, SPiiPlus SA controller does not provide Motor Overheat,
Preliminary Left Limit and Preliminary Right Limit safety inputs.
See specific model documentation for details.
If the method fails, the Error object is filled with the error description.
Example
Sub SetSafetyInputPortInv_Sample()
'The method sets the inversion for
safety
'input port of the axis X to 100
On Error GoTo except
Call Ch.SetSafetyInputPortInv(Ch.ACSC_AXIS_X, 100)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.160 SetServer
The method defines the communication server IP address.
Syntax
object.SetServer(IP)
Parameters
Name Type Description
IP [in] BSTR IP address of the communication server. It may be
entered as an IP address (10.0.0.102) or as local
machine name (ACS110)
Return Value
None.
Remarks
Use the method only if application needs to establish communication with a controller through
the remote computer.
If the method is not called, by default all connections are established through the local
computer. Only controller connected to the local computer by serial cable, PCI bus or Ethernet
can be accessed.
Once the method is called, it defines the remote computer to be used as a communication server.
Any subsequent acsc_OpenCommxxx call will attempt to establish communication with a
controller connected to that remote computer.
Application can simultaneously communicate through several communication servers. Use the
following pattern to open communication channels through several servers:
'controllers
'connected to'Server2
Note
When the application calls SetServer(Server2) all channels related to
the local computer or to Server1 remain valid. Then the application can
use all channels to provide simultaneous communication with many
controllers through different servers.
The remote computer addressed in the SetServer method must have the SPiiPlus C Library
installed. Otherwise, the computer cannot be used as a communication server, and the
SetServer call fails.
If the method fails, the Error object is filled with the error description.
Example
Sub SetServer_Sample()
On Error GoTo except
'Defines remote server
Call Ch.SetServer(“10.0.0.134”);
'Attempts to open communication with PCI
'card via remote server at 10.0.0.134
Ch.OpenCommPCI(-1))
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.161 SetServerExt
The method defines the communication server IP address and the explicit port number.
Syntax
object.SetServerExt([in] string IPAddress,[in] long Port)
Parameters
Name Type Description
IPAddress [in] string IP address of the remote User-Mode Driver (UMD).
The address should equal the address displayed in the
remote UMD dialog.
Port [in] long Port through which communication with the remote
UMD occurs. The port number should be the same that
is displayed in the remote UMD dialog
Return Value
None.
Remarks
The method allows setting the remote UMD port number if the default port number is not
available on the remote computer.
Example
Sub SetServerExt
Dim
On Error GoTo except
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.162 SetServerExtLogin
The method sets the remote User-Mode Driver (UMD) with a specified IP address, port
number, and user login.
Syntax
object.SetServerExtLogin([in] string IPAddress,[in] long Port, [in] string Password,[in[
string Domain
Parameters
Name Type Description
IPAddress [in] string IP address of the remote UMD. This address should be
the same address displayed in the remote UMD dialog.
Return Value
None.
Remarks
The method sets the temote UMD with the specified IP address, port number, and user login
information. User login information is required if the remote UMD does not run in the current
domain, or the remote computer was not previously logged in to the current domain.
Example
Sub SetServerExtLogin()
Dim
On Error GoTo except
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.163 SetTimeout
The method sets the communication timeout.
Syntax
object.SetTimeout(Timeout)
Parameters
Name Type Description
Timeout [in] long Maximum waiting time in milliseconds.
Return Value
None.
Remarks
The method sets the communication timeout.
All of the subsequent waiting calls of the methods will wait for the controller response Timeout
in milliseconds. If the controller does not respond to the sent command during this time,
SPiiPlus COM methods return with zero value. In this case, the the Error object is assigned
ACSC_TIMEOUT.
If the method fails, the Error object is filled with the error description.
Example
Sub SetTimeout_Sample()
Dim TimeO As Double
On Error GoTo except
'Sets the communication timeout of 2000
Call Ch.SetTimeout(2000)
TimeO = Ch.GetTimeout
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.164 SetVelocity
The method defines a value of motion velocity.
Syntax
object.SetVelocity(Axis, Velocity)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Velocity [in] double The value specifies required motion velocity. The
value will be used in the subsequent motions except for
the master-slave motions and the motions activated
with the ACSC_AMF_VELOCITY flag.
Return Value
None.
Remarks
The method writes the specified value to the controller.
One value can be specified for each axis.
A single-axis motion uses the value of the corresponding axis. A multi-axis motion uses the
value of the leading axis. The leading axis is an axis specified first in the motion command.
The method affects the motions initiated after the method call. The method has no effect on any
motion that was started or planned before the method call. To change velocity of an executed
or planned motion, use the SetVelocityImm method.
The method has no effect on the master-slave motions and the motions activated with the
ACSC_AMF_VELOCITY flag.
If the method fails, the Error object is filled with the error description.
Example
Sub SetVelocity_Sample()
Dim Index As Long
Dim Axes(8)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = Ch.ACSC_AXIS_Z
Axes(3) = Ch.ACSC_AXIS_T
Axes(4) = Ch.ACSC_AXIS_A
Axes(5) = Ch.ACSC_AXIS_B
Axes(6) = Ch.ACSC_AXIS_C
Axes(7) = Ch.ACSC_AXIS_D
Axes(8) = -1
On Error GoTo except
'Sets the velocity to 10000 to all axes
For Index = 0 To 7
Call Ch.SetVelocity(Axes(Index), 10000)
Next Index
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.165 SetVelocityImm
The method defines a value of motion velocity. Unlike SetVelocity, the method has immediate
effect on any executed or planned motion.
Syntax
object.SetVelocityImm(Axis, Velocity)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Velocity [in] double The value specifies required motion velocity.
Return Value
None.
Remarks
The method writes the specified value to the controller.
One value can be specified for each axis.
A single-axis motion uses the value of the corresponding axis. A multi-axis motion uses the
value of the leading axis. The leading axis is an axis specified first in the motion command.
The method affects:
• The currently executed motion. The controller provides a smooth transition from the instant
current velocity to the specified new value.
• The waiting motions that were planned before the method call.
• The motions that will be commanded after the method call.
The method has no effect on the master-slave motions.
If the method fails, the Error object is filled with the error description.
Example
Sub SetVelocityImm_Sample()
On Error GoTo except
'Writes the specified value of velocity
to
'the controller
Call Ch.SetVelocityImm(Ch.ACSC_AXIS_X, 80000)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.166 Slave
The method initiates a master-slave motion.
Syntax
object.Slave(Flags, Axis)
Parameters
Name Type Description
Flags [in] long Bit-mapped parameter that can include one or more of
the following flags:
• ACSC_AMF_WAIT: plan the motion but don’t
start it until the method Go is executed.
• ACSC_AMF_POSITIONLOCK: the motion will
use position lock. If the flag is not specified,
velocity lock is used (see Remarks).
Axis [in] long Slaved axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
None.
Remarks
The method initiates a single-axis master-slave motion with an unlimited area of following. If
the area of following must be limited, use SlaveStalled.
The master-slave motion continues until the motion is killed or the motion fails for any reason.
The method waits for the controller response.
The controller response indicates that the command was accepted and the motion was planned
successfully.
The master value for the specified axis must be defined before by the call to SetMaster method.
The SetMaster method can be called again in order to change the formula of master calculation.
If at this moment the master-slave motion is in progress, the slave can come out from
synchronism. The controller then regains synchronism, probably with a different value of offset
between the master and slave.
If the ACSC_AMF_POSITIONLOCK flag is not specified, the method activates a velocity-
lock mode of slaved motion. When synchronized, the APOS axis reference follows the MPOS
with a constant offset:
APOS = MPOS + C
The value of C is latched at the moment when the motion comes to synchronism, and then
remains unchanged as long as the motion is synchronous. If at the moment of motion start the
master velocity is zero, the motion starts synchronously and C is equal to the difference
between initial values of APOS and MPOS.
If the ACSC_AMF_POSITIONLOCK flag is specified, the method activates a position-lock
mode of slaved motion. When synchronized, the APOS axis reference strictly follows the
MPOS:
APOS = MPOS
If the method fails, the Error object is filled with the error description.
Example
Sub Slave_Sample()
Dim MFormula As String
'Master value is calculated as
feedback
'position of the axis T with scale
factor
'equal 2
MFormula = "2 * T_FPOS"
Dim Axes(2)
Axes(0) = Ch.ACSC_AXIS_Z
Axes(1) = Ch.ACSC_AXIS_T
Axes(2) = -1
On Error GoTo except
'Enable axes ZT
Call Ch.EnableM(Axes)
'Set master formula "Z_MPOS=2 * T_FPOS"
Call Ch.SetMaster(Ch.ACSC_AXIS_Z, MFormula)
'Set axis Z to slave
Call Ch.Slave(0, Ch.ACSC_AXIS_Z)
'Relative motion with target position of
'10000
5.167 SlaveStalled
The method initiates master-slave motion within predefined limits.
Syntax
object.SlaveStalled(Flags, Axis, Left, Right)
Parameters
Name Type Description
Flags [in] long Bit-mapped parameter that can include one or both of
the following flags:
• ACSC_AMF_WAIT: plan the motion but don’t
start it until the Go method is executed.
• ACSC_AMF_POSITIONLOCK: the motion will
use position lock. If the flag is not specified,
velocity lock is used (see Remarks).
Axis [in] long Slaved axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions
Left [in] double Left (negative) limit of the axis.
Right [in] double Right (positive) limit of the axis.
Return Value
None.
Remarks
The method initiates single-axis master-slave motion within predefined limits. Use Slave to
initiate unlimited motion. For sophisticated forms of master-slave motion, use slaved variants
of segmented and spline motions.
The method waits for the controller response.
The controller response indicates that the command was accepted and the motion was planned
successfully.
The master-slave motion continues until the Kill command is executed, or the motion fails for
any reason.
The master value for the specified axis must be defined before by the call to SetMaster method.
The SetMaster method can be called again in order to change the formula of master calculation.
If at this moment the master-slave motion is in progress, the slave can come out from
synchronism. The controller then regains synchronism, probably with a different value of offset
between the master and slave.
If the ACSC_AMF_POSITIONLOCK flag is not specified, the method activates a velocity-
lock mode of slaved motion. When synchronized, the APOS axis reference follows the MPOS
with a constant offset:
APOS = MPOS + C
The value of C is latched at the moment when the motion comes to synchronism, and then
remains unchanged as long as the motion is synchronous. If at the moment of motion start the
master velocity is zero, the motion starts synchronously and C is equal to the difference
between initial values of APOS and MPOS.
If the ACSC_AMF_POSITIONLOCK flag is specified, the method activates a position-lock
mode of slaved motion. When synchronized, the APOS axis reference strictly follows the
MPOS:
APOS = MPOS
The Left and Right values define the allowed area of changing the APOS value. The MPOS
value is not limited and can exceed the limits. In this case, the motion comes out from
synchronism, and the APOS value remains (stalls) in one of the limits until the change of MPOS
allows following again.
If the method fails, the Error object is filled with the error description.
Example
Sub SlaveStalled_Sample()
Dim MFormula As String
'Master value is calculated as
‘feedback position of the axis T with
‘scale factor equal 2
5.168 Spline
The method initiates a single-axis spline motion. The motion follows an arbitrary path defined
by a set of points.
Syntax
object.Spline(Flags, Axis, Period)
Parameters
Name Type Description
Flags [in] long Bit-mapped parameter that can include one or more of
the following flags:
ACSC_AMF_WAIT: plan the motion but don’t start it
until the Go method is executed.
• ACSC_AMF_RELATIVE: use the coordinates of
each point as relative. The first point is relative to
the instant position when the motion starts; the
second point is relative to the first, etc. If the flag is
not specified, the coordinates of each point are
absolute.
Flags [in] long • ACSC_AMF_VARTIME: the time interval
between adjacent points is non-uniform and is
specified along with each added point. If the flag is
not specified, the interval is uniform and is
specified in the Period argument.
• ACSC_AMF_CYCLIC: use the point sequence as a
cyclic array: after the last point come to the first
point and continue.
• ACSC_AMF_CUBIC: use a cubic interpolation
between the specified points (third-order spline).
• If the flag is not specified, linear interpolation is
used (first-order spline).
• If the flag is specified and the
ACSC_AMF_VARTIME is not specified, the
controller builds PV spline motion.
• If the flag is specified and the
ACSC_AMF_VARTIME is specified, the
controller builds PVT spline motion.
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Period [in] double Time interval between adjacent points. The parameter
is used only if the ACSC_AMF_VARTIME flag is not
specified.
Return Value
None.
Remarks
The method initiates a single-axis spline motion. To execute multi-axis spline motion, use
SplineM.
The method waits for the controller response.
The controller response indicates that the command was accepted and the motion was planned
successfully. The method cannot wait or validate the end of the motion. To wait for the motion
end, use the WaitProgramEnd method.
The motion does not use the default values of velocity, acceleration, deceleration, and jerk. The
points and the time intervals between the points completely define the motion profile.
Points for arbitrary path motion are defined by the consequent calls of AddPoint or
ExtAddPoint methods. The EndSequence method terminates the point sequence. After
execution of the EndSequence method, no AddPoint or ExtAddPoint methods for this motion
are allowed.
The trajectory of the motion follows through the defined points. Each point presents the instant
desired position at a specific moment. Time intervals between the points are uniform, or non-
uniform as defined by the ACSC_AMF_VARTIME flag.
This motion does not use a motion profile generation. The time intervals between the points are
typically short, so that the array of the points implicitly specifies the desired velocity in each
point.
If the time interval does not coincide with the controller cycle, the controller provides
interpolation of the points according to the ACSC_AMF_CUBIC flag.
If the method fails, the Error object is filled with the error description.
Example
Sub Spline_Sample()
Dim Index As Long
Dim Points(1) As Double
On Error GoTo except
'Enable axis X
Call Ch.Enable(Ch.ACSC_AXIS_X)
'Wait till axis X enabled during 5 sec
Call Ch.WaitMotorEnabled(Ch.ACSC_AXIS_X, 1, 5000)
'Create the arbitrary path motion to
axis X
'use a cubic interpolation between the
'specified Points with uniform interval
500
'ms
Call Ch.Spline(Ch.ACSC_AMF_CUBIC, Ch.ACSC_AXIS_X, 500)
5.169 SplineM
The method initiates a multi-axis spline motion. The motion follows an arbitrary path defined
by a set of points.
Syntax
object.SplineM(Flags, Axes, Period)
Parameters
Name Type Description
Flags [in] long Bit-mapped parameter that can include one or more of
the following flags:
• ACSC_AMF_WAIT: plan the motion but don’t
start it until the GoM method is executed.
• ACSC_AMF_RELATIVE: the coordinates of each
point are relative. The first point is relative to the
instant position when the motion starts; the second
point is relative to the first, etc. If the flag is not
specified, the coordinates of each point are
absolute.
• ACSC_AMF_VARTIME: the time interval
between adjacent points is non-uniform and is
specified along with each added point. If the flag is
not specified, the interval is uniform and is
specified in the Period argument.
• ACSC_AMF_CYCLIC: the motion uses the point
sequence as a cyclic array: after the last point the
motion comes to the first point and continues.
• ACSC_AMF_CUBIC: use a cubic interpolation
between the specified points (third-order spline). If
the flag is not specified, linear interpolation is used
(first-order spline). [In the present version third-
order spline is not supported].
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Period [in] double Time interval between adjacent points. The parameter
is used only if the ACSC_AMF_VARTIME flag is not
specified.
Return Value
None.
Remarks
The method initiates a multi-axis spline motion. To execute a single-axis spline motion, use
Spline.
The method waits for the controller response.
The controller response indicates that the command was accepted and the motion was planned
successfully. The method cannot wait or validate the end of the motion. To wait for the motion
end, use the WaitMotionEnd method.
The motion does not use the default values of velocity, acceleration, deceleration, and jerk. The
points and the time intervals between the points define the motion profile completely.
Points for arbitrary path motion are defined by the consequent calls of the AddPVPointM or
ExtAddPointM methods. The EndSequenceM method terminates the point sequence. After
execution of the EndSequenceM method, no AddPointM or ExtAddPointM methods for this
motion are allowed.
The trajectory of the motion follows through the defined points. Each point presents the instant
desired position at a specific moment. Time intervals between the points are uniform, or non-
uniform as defined by the ACSC_AMF_VARTIME flag.
This motion does not use motion profile generation. Typically, the time intervals between the
points are short, so that the array of the points implicitly specifies the desired velocity in each
point.
If the time interval does not coincide with the controller cycle, the controller provides
interpolation of the points according to the ACSC_AMF_CUBIC flag.
If the method fails, the Error object is filled with the error description.
Example
Sub SplineM_Sample()
Dim Index As Long
Dim Points(1) As Double
Dim Axes(2)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
On Error GoTo except
'Enable axes XY
Call Ch.EnableM(Axes)
'Create the arbitrary path motion to
axes XY
For Index = 0 To 5
Points(0) = 100 * Index
Points(1) = 200 * Index
Call Ch.AddPVPointM(Axes, Points, Points)
Next Index
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequenceM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.170 Split
The method breaks down a previously created axis group.
Syntax
object.Split(Axes)
Parameters
Name Type Description
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Return Value
None.
Remarks
The method breaks down an axis group created before by the Group method. The Axes
parameter must specify the same axes as for the Group method that created the group. After the
splitting up the group no longer exists.
If the method fails, the Error object is filled with the error description.
Example
Sub Split_Sample()
Dim Axes(4)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = Ch.ACSC_AXIS_Z
Axes(3) = Ch.ACSC_AXIS_T
Axes(4) = -1
On Error GoTo except
'Group of axes XYZT
Call Ch.Group(Axes)
'Split the group of axes XYZT
Call Ch.Split(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.171 SplitAll
The method breaks down all axis groups created before.
Syntax
object.SplitAll()
Parameters
None.
Return Value
None.
Remarks
The method breaks down all axis groups created before by the Group method.
The application may call this method to ensure that no axes are grouped. If no groups currently
exist the method has no effect.
If the method fails, the Error object is filled with the error description.
Example
Sub SplitAll_Sample()
Dim Axes(4)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = Ch.ACSC_AXIS_Z
Axes(3) = Ch.ACSC_AXIS_T
Axes(4) = -1
On Error GoTo except
'Group of axes XYZT
Call Ch.Group(Axes)
'Split the group of axes XYZT
Call Ch.SplitAll
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.172 StopBuffer
The method stops the execution of ACSPL+ program in the specified buffer(s).
Syntax
object.StopBuffer(Buffer)
Parameters
Name Type Description
Buffer [in] long Buffer number, from 0 to 9.
Use ACSC_NONE instead of the buffer number, to
stop the execution of all programs in all buffers.
Return Value
None.
Remarks
The method stops ACSPL+ program execution in the specified buffer or in all buffers if the
parameter Buffer is ACSC_NONE.
The method has no effect if the program in the specified buffer is not running.
If the method fails, the Error object is filled with the error description.
Example
Sub StopBuffer_Sample()
Dim Index As Long
On Error GoTo except
For Index = 0 To 8
'Appends a line to all buffers
Call Ch.AppendBuffer(Index, "ST:;! Empty buffer;goto ST")
'Run all buffers
Call Ch.RunBuffer(Index)
'Stop running all the buffers
Call Ch.StopBuffer(Index)
Next Index
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.173 StopCollect
The method terminates data collection.
Syntax
object.StopCollect()
Parameters
None.
Return Value
None.
Remarks
The usual system data collection finishes when the required number of samples is collected or
the StopCollect method is executed. The application can wait for data collection end with the
WaitCollectEnd method.
The temporal data collection runs until the StopCollect method is executed.
The method terminates the data collection prematurely. The application can determine the
number of actually collected samples from the S_DCN variable and the actual sampling period
from the S_DCP variable.
If the method fails, the Error object is filled with the error description.
Example
Sub StopCollect_Sample()
'Matrix consisting of two rows with 1000
'columns each
Dim ArrayName As String
ArrayName = "DCA(2)(1000)"
'Positions of axes X and Y will be
collected
Dim Vars As String
Vars = "FPOS(0)” & Chr$(13)& FPOS(1)"
On Error GoTo except
'Enable axis X
Call Ch.Enable(Ch.ACSC_AXIS_X)
'Wait till axis X enabled during 5 sec
Call Ch.WaitMotorEnabled(Ch.ACSC_AXIS_X, 1, 5000)
Call Ch.ExtToPoint(Ch.ACSC_AMF_VELOCITY Or Ch.ACSC_AMF_ENDVELOCITY,
Ch.ACSC_AXIS_X, 10000, 5000, 1000)
'Array to collect
Call Ch.DeclareVariable(Ch.ACSC_REAL_TYPE, ArrayName)
Call Ch.CollectB(0, ArrayName, 1000, 1, Vars)
'Stop to collect
Call Ch.StopCollect
'End of the multi-point motion
Call Ch.EndSequence(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.174 StopPeg
The method stops PEG.
Syntax
object.StopPeg(Axis)
Parameters
Name Type Description
Axis [in] long PEG axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
None.
Remarks
If the method fails, the Error object is filled with the error description.
Example
Sub StopPeg_Sample()
On Error GoTo except
'Enable axis Z
Call Ch.Enable(Ch.ACSC_AXIS_Z)
'Wait till axis Z enabled during 5 sec
Call Ch.WaitMotorEnabled(Ch.ACSC_AXIS_Z, 1, 5000)
Call Ch.ToPoint(Ch.ACSC_AMF_RELATIVE, Ch.ACSC_AXIS_Z, 1000000)
Call Ch.PegI(0, Ch.ACSC_AXIS_Z, 1, 0, 50, 10000, Ch.ACSC_NONE,
Ch.ACSC_NONE)
'Stop the peg in axis Z
Call Ch.StopPeg(Ch.ACSC_AXIS_Z)
'End of the multi-point motion
Call Ch.EndSequence(Ch.ACSC_AXIS_Z)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.175 Stopper
The method provides a smooth transition between two segments of segmented motion.
Syntax
object.Stopper(Axes)
Parameters
Name Type Description
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y, etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Return Value
None.
Remarks
The controller builds the motion so that the vector velocity follows a smooth velocity diagram.
The segments define the projection of the vector velocity to axis velocities. If all segments are
connected smoothly, axis velocity is also smooth. However, if the user defined a path with an
inflection point, axis velocity has a jump in this point. The jump can cause a motion failure due
to the acceleration limit.
The method is used to avoid velocity jump in the inflection points. If the method is specified
between two segments, the controller provides smooth deceleration to zero in the end of first
segment and smooth acceleration to specified velocity in the beginning of second segment.
If the method fails, the Error object is filled with the error description.
Example
Sub Stopper_Sample()
Dim Points(1) As Double
Dim Axes(2)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
On Error GoTo except
'Create segmented motion, coordinates of
the
'initial point are(1000,1000)
Points(0) = 1000
Points(1) = 1000
'Enable axes XY
Call Ch.EnableM(Axes)
Call Ch.Segment(0, Axes, Points)
'Add line segment with final point
(1000,
'-1000), vector velocity 25000
Points(0) = 1000
Points(1) = -1000
Call Ch.ExtLine(Axes, Points, 25000)
Call Ch.Stopper(Axes)
'Add line segment with final point (-
1000,
'-1000), vector velocity 25000
Points(0) = -1000
Points(1) = -1000
Call Ch.ExtLine(Axes, Points, 25000)
Call Ch.Stopper(Axes)
'Add line segment with final point (-
1000,
'1000), vector velocity 25000
Points(0) = -1000
Points(1) = 1000
Call Ch.ExtLine(Axes, Points, 25000)
Call Ch.Stopper(Axes)
'Add line segment with final point
(1000,
'1000), vector velocity 25000
Points(0) = 1000
Points(1) = 1000
Call Ch.ExtLine(Axes, Points, 25000)
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequenceM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.176 SuspendBuffer
The method suspends the execution of ACSPL+ program in the specified program buffer(s).
Syntax
object.SuspendBuffer(Buffer)
Parameters
Name Type Description
Buffer [in] long Buffer number, from 0 to 9.
Use ACSC_NONE instead of the buffer number, to
suspend the execution of all programs in all buffers.
Return Value
None.
Remarks
The method suspends ACSPL+ program execution in the specified buffer or in all buffers if the
parameter Buffer is ACSC_NONE. The method has no effect if the program in the specified
buffer is not running.
To resume execution of the program in the specified buffer, call the RunBuffer method.
If the method fails, the Error object is filled with the error description.
Example
Sub SuspendBuffer_Sample()
Dim Index As Long
On Error GoTo except
For Index = 0 To 8
'Appends all buffers
Call Ch.AppendBuffer(Index, "ST:;! Empty buffer;goto ST")
'Run all buffers
Call Ch.RunBuffer(Index)
'Suspends all buffers
Call Ch.SuspendBuffer(Index)
Next Index
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.177 Track
The method initiates a single-axis track motion.
Syntax
object.Track(Flags, Axis)
Parameters
Name Type Description
Flags [in] long Bit-mapped parameter that can include the following
flag:
ACSC_AMF_WAIT: plan the motion but don’t start it
until the method Go is executed.
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Return Value
None.
Remarks
The method initiates a single-axis track motion. After the motion is initialized, PTP motion will
be generated with every change in TPOS value.
The controller response indicates that the command was accepted and the motion was planned
successfully.
If the method fails, the Error object is filled with the error description.
Example
Sub Track_Sample()
On Error GoTo except
'Enable axis X
Call Ch.Enable(Ch.ACSC_AXIS_X)
'Wait axis X enabled during 5 sec
Call Ch.WaitMotorEnabled(Ch.ACSC_AXIS_X, 1, 5000)
'Start up immediately the motion of the
axis
'X
5.178 ToPoint
The method initiates a single-axis motion to the specified point.
Syntax
object.ToPoint(Flags, Axis, Point)
Parameters
Name Type Description
Flags [in] long Bit-mapped parameter that can include one or more of
the following flags:
ACSC_AMF_WAIT: plan the motion but don’t start it
until the method Go is executed.
ACSC_AMF_RELATIVE: the Point value is relative
to the end point of the previous motion. If the flag is not
specified, the Point specifies an absolute coordinate.
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Point [in] double Coordinate of the target point.
Return Value
None.
Remarks
The method initiates a single-axis point-to-point motion.
The motion is executed using the required motion velocity and finishes with zero end velocity.
The required motion velocity is the velocity specified by the previous call of the SetVelocity
method or the default velocity if the method was not called.
To execute multi-axis point-to-point motion, use ToPointM. To execute motion with other
motion velocity or non-zero end velocity, use ExtToPoint or ExtToPointM.
The controller response indicates that the command was accepted and the motion was planned
successfully. The method does not wait for the motion end. To wait for the motion end, use
WaitMotionEnd method.
The motion builds the velocity profile using the required values of velocity, acceleration,
deceleration, and jerk of the specified axis.
If the method fails, the Error object is filled with the error description.
Example
Sub ToPoint_Sample()
On Error GoTo except
'Enable axis X
Call Ch.Enable(Ch.ACSC_AXIS_X)
'Wait axis X enabled during 5 sec
Call Ch.WaitMotorEnabled(Ch.ACSC_AXIS_X, 1, 5000)
'Relative motion of axis X to target
point
'of 10000
Call Ch.ToPoint(Ch.ACSC_AMF_RELATIVE, Ch.ACSC_AXIS_X, 10000)
'Wait till motion ends
Call Ch.WaitMotionEnd(Ch.ACSC_AXIS_X, 10000)
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequence(Ch.ACSC_AXIS_X)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.179 ToPointM
The method initiates a multi-axis motion to the specified point.
Syntax
object.ToPointM(Flags, Axes, Point)
Parameters
Name Type Description
Flags [in] long Bit-mapped parameter that can include one or more of
the following flags:
• ΑCSC_AMF_WAIT: plan the motion but don’t
start it until the method GoM is executed.
• ACSC_AMF_RELATIVE: the Point values are
relative to the end point of the previous motion. If
the flag is not specified, the Point specifies absolute
coordinates.
• ACSC_AMF_MAXIMUM: not to use the motion
parameters from the leading axis but to calculate
the maximum allowed motion velocity,
acceleration, deceleration, and jerk of the involved
axes.
Axes [in] variant Array of axes. Each element specifies one involved
axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. After the last axis, one
additional element must be located that contains –1
and marks the end of the array.
For the full list of the axis properties, see Section 6.4,
Axis Definitions.
Point [in] variant Array of the target coordinates. The number and order
of values must correspond to the Axes array. The Point
must specify a value for each element of Axes except
the last –1 element.
Return Value
None.
Remarks
The method initiates a multi-axis point-to-point motion.
The motion is executed using the required motion velocity and finishes with zero end velocity.
The required motion velocity is the velocity specified by the previous call of the SetVelocity
method, or the default velocity if the method was not called.
To execute single-axis point-to-point motion, use ToPoint. To execute motion with other
motion velocity or non-zero end velocity, use ExtToPoint or ExtToPointM.
The controller response indicates that the command was accepted and the motion was planned
successfully. The method does not wait for the motion end. To wait for the motion end,
useWaitMotionEnd method.
The motion builds the velocity profile using the required values of velocity, acceleration,
deceleration, and jerk of the leading axis. The leading axis is the first axis in the Axes array.
If the method fails, the Error object is filled with the error description.
Example
Sub ToPointM_Sample()
Dim Point(1) As Double
Dim Index As Long
Dim result(1) As Double
Dim Axes(2)
Axes(0) = Ch.ACSC_AXIS_X
Axes(1) = Ch.ACSC_AXIS_Y
Axes(2) = -1
Point(0) = 10000
Point(1) = 10000
On Error GoTo except
'Enable axes XY
Call Ch.EnableM(Axes)
'Immediately start the motion of the
axes XY
'to the absolute target points
10000,10000
Call Ch.ToPointM(0, Axes, Point)
'Finish the motion
'End of the multi-point motion
Call Ch.EndSequenceM(Axes)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.180 Transaction
The method executes one transaction with the controller, i.e. it sends a command and receives
a controller response.
Syntax
object.Transaction (Command)
Parameters
Return Value
String.
Remarks
The full operation of transaction includes the following steps:
1. Send Command to the controller.
2. Wait until the controller response is received or the timeout occurs.
3. Return a controller response
4. If the method fails, the Error object is filled with the error description.
Example
Sub Transaction_Sample()
Dim Cmd As String
Cmd = "?SN" 'get controller serial number
On Error GoTo except
'The method executes one transaction
with the controller
reply = Ch.Transaction(Cmd)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.181 UploadBuffer
The method uploads ACSPL+ program from the specified program buffer.
Syntax
object.UploadBuffer(Buffer)
Parameters
Name Type Description
Buffer [in] long Number of a program buffer in the controller.
Return Value
String.
Remarks
The method uploads ACSPL+ program from the specified program buffer.
If the method fails, the Error object is filled with the error description.
Example
Sub UploadBuffer_Sample()
Dim Str(1) As String
Str(1) = "!This is an empty buffer" & Chr$(10)
5.182 WaitCollectEnd
The method waits for the end of data collection.
Syntax
object.WaitCollectEnd(Timeout)
Parameters
Name Type Description
Timeout [in] long Maximum waiting time in milliseconds.
If Timeout is INFINITE, the method's time-out
interval never elapses.
Return Value
None.
Remarks
The method does not return while the system data collection is in progress and the specified
time-out interval has not elapsed. The method verifies the S_ST.#DC system flag.
If the method fails, the Error object is filled with the error description.
Example
Sub WaitCollectEnd_Sample()
On Error GoTo except
'Wait data collection ends during 10
sec
Call Ch.WaitCollectEnd(10000)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.183 WaitInput
The method waits for the specified state of digital input.
Syntax
object.WaitInput (Port, Bit, State, Timeout)
Parameters
Name Type Description
Port [in] long Number of input port: 0 corresponds to IN0, 1 – to IN1,
etc.
Bit [in] long Selects one bit from the port, from 0 to 31.
State [in] long Specifies a desired state of the input, 0 or 1.
Timeout [in] long Maximum waiting time in milliseconds.
If Timeout is INFINITE, the method's time-out
interval never elapses.
Return Value
None.
Remarks
The basic configuration of the SPiiPlus PCI model provides only 16 inputs. Therefore, the Port
must be 0, and the Bit can be specified from 0 to 15.
If the method fails, the Error object is filled with the error description.
Example
Sub WaitInput_Sample()
On Error GoTo except
'Wait for IN0.0 = 1 during 5 sec
'Parameters: 0 - IN0
' 0 - IN0.0
' 1 - wait for IN0.0 = 1
' 5000 - during 5 sec
Call Ch.WaitInput(0, 0, 1, 5000)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.184 WaitLogicalMotionEnd
The method waits for the logical end of a motion.
Syntax
object.WaitLogicalMotionEnd (Axis, Timeout)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
The axis must be either a single axis not included in any
group or a leading axis of a group.
Timeout [in] long Maximum waiting time in milliseconds.
If Timeout is INFINITE, the method's time-out
interval never elapses.
Return Value
None.
Remarks
The method does not return while the specified axis is involved in a motion and the specified
time-out interval has not elapsed.
The method differs from the WaitMotionEnd method. Examining the same motion, the
WaitMotionEnd method will return later. The WaitLogicalMotionEnd method returns when
the generation of the motion finishes. On the other hand, the WaitMotionEnd method returns
when the generation of the motion finishes and the motor has settled in the final position.
If the method fails, the Error object is filled with the error description.
Example
Sub WaitLogicalMotionEnd_Sample()
On Error GoTo except
'Wait for the logical end of motion of
axis
'X during 10 sec
Call Ch.WaitLogicalMotionEnd(Ch.ACSC_AXIS_X, 10000)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.185 WaitMotionEnd
The method waits for the end of a motion.
Syntax
object.WaitMotionEnd (Axis, Timeout)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
Timeout [in] long Maximum waiting time in milliseconds.
If Timeout is INFINITE, the method's time-out
interval never elapses.
Return Value
None.
Remarks
The method does not return while the specified axis is involved in a motion, the motor has not
settled in the final position and the specified time-out interval has not elapsed.
The method differs from the WaitLogicalMotionEnd method. Examining the same motion,
the WaitMotionEnd method will return latter. The WaitLogicalMotionEnd method returns
when the generation of the motion finishes. On the other hand, the WaitMotionEnd method
returns when the generation of the motion finishes and the motor has settled in the final
position.
If the method fails, the Error object is filled with the error description.
Example
Sub WaitMotionEnd_Sample()
On Error GoTo except
'Wait for the end of motion of axis X
during
'10 sec
Call Ch.WaitMotionEnd(Ch.ACSC_AXIS_X, 10000)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.186 WaitMotorEnabled
The method waits for the specified state of the specified motor.
Syntax
object.WaitMotorEnabled (Axis, State, Timeout)
Parameters
Name Type Description
Axis [in] long Axis: ACSC_AXIS_X corresponds to X,
ACSC_AXIS_Y – to Y etc. For the full list of the axis
properties, see Section 6.4, Axis Definitions.
State [in] long 1 – the method wait for the motor enabled,
0 – the method wait for the motor disabled.
Timeout [in] long Maximum waiting time in milliseconds.
If Timeout is INFINITE, the method's time-out
interval never elapses.
Return Value
None.
Remarks
The method does not return while the specified motor is not in the desired state and the specified
time-out interval has not elapsed. The method examines the MST.#ENABLED motor flag.
If the method fails, the Error object is filled with the error description.
Example
Sub WaitMotorEnabled_Sample()
On Error GoTo except
'Enable axis X
Call Ch.Enable(Ch.ACSC_AXIS_X)
'Wait motor X enabled during 5 sec
Call Ch.WaitMotorEnabled(Ch.ACSC_AXIS_X, 1, 5000)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.187 WaitProgramEnd
The method waits for the program termination in the specified buffer.
Syntax
object.WaitProgramEnd (Buffer, Timeout)
Parameters
Name Type Description
Buffer [in] long Buffer number, from 0 to 9.
Timeout [in] long Maximum waiting time in milliseconds.
If Timeout is INFINITE, the method's time-out
interval never elapses.
Return Value
None.
Remarks
The method does not return while the ACSPL+ program in the specified buffer is in progress
and the specified time-out interval has not elapsed.
If the method fails, the Error object is filled with the error description.
Example
Sub WaitProgramEnd_Sample()
Dim Index As Long
On Error GoTo except
For Index = 0 To 8
'Append a line to all buffers
Call Ch.AppendBuffer(Index, "WAIT 5000;STOP")
'Run all buffers
Call Ch.RunBuffer(Index)
'Wait program ends during 10 sec
Call Ch.WaitProgramEnd(Index, 10000)
Next Index
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.188 WriteDPRAMInteger
The method writes 32-bit integer to the DPRAM.
Syntax
object.WriteDPRAMInteger(address,Value)
Parameters
Name Type Description
Address [in] long Address has to be even number from 128 to 508
Value [in] long Value to be written
Return Value
The method returns non-zero on success.
Remarks
Address has to be even number in the range of 128 to 508, because we use 16-bit alignment
when working with DPRAM. Addresses less than 128 are used for internal purposes.
Note
The method can be used only with the PCI and Simulator
communication channels.
If the method fails, the Error object is filled with the error description.
Example
Sub WriteDPRAMInteger_Sample()
On Error GoTo except
'Write to DPRAM address 0xA0 the value
100
Call Ch.WriteDPRAMInteger(160, 100)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.189 WriteDPRAMReal
The method writes 64-bit Real to the DPRAM.
Syntax
object.WriteDPRAMReal(address, Value)
Parameters
Name Type Description
Address [in] long Address has to be even number from 128 to 508
Value [in] double Value to be written
Return Value
The method returns non-zero on success.
If the method fails, the Error object is filled with the error description.
Remarks
Address has to be even number in the range of 128 to 504, because we use 16-bit alignment
when working with DPRAM. Addresses less than 128 are used for internal purposes.
If the method fails, the Error object is filled with the error description.
Example
Sub WriteDPRAMReal_Sample()
On Error GoTo except
'Write to DPRAM address 0xA0 the value
100
Call Ch.WriteDPRAMReal(160, 100)
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
5.190 WriteVariable
The method writes a value defined as VARIANT to the controller variable(s).
Syntax
object.WriteVariable(Value, Variable, Nbuf, [From1], [To1], [From2], [To2])
Parameters
Name Type Description
Value [in] variant Value to be assigned to the Variable. The Value can
contain an integer or real number(s). The Value can be
scalar, one-dimensional array (vector) or two-
dimensional array (matrix).
Variable [in] string Name of the controller variable.
NBuf [in] long Number of the program buffer for local variable or
ACSC_NONE for global and standard variable.
From1, To1 [in] long Default value: ASCS_NONE.
Index range (first dimension) starting from zero of the
Variable (not of the Value).
From2, To2 [in] long Default value: ASCS_NONE.
Index range (second dimension) starting from zero of
the Variable (not of the Value).
Return Value
None.
Remarks
This method writes Value to a specified Variable. The Variable can be scalar, vector (one-
dimensional array) or matrix (two-dimensional array).
The variable can be either a standard controller variable, user global variable or a user local
variable.
Standard and user global variables have global scope. Therefore, parameter Nbuf must be
ACSC_NONE (–1) for these classes of variables.
User local variable exist only within a buffer. The buffer number must be specified for user
local variable.
The index parameters can be specified in many different ways. Write the entire variable, a
single element of the variable or several elements of the variable as follows:
• Write value to whole variable
From1, To1, From2 and To2 indexes should be omitted or specified as ACSC_NONE.
The Value dimension should correspond to the Variable dimension as follows:
• If Variable is scalar, Value should be scalar, or vector of size 1, or matrix of size 1x1
• If Variable is vector of size N, Value should be vector of size N, or matrix of size 1xN,
or matrix of size Nx1
• If Variable is matrix of size NxM, Value should be matrix of size NxM
• Writing value to one element of vector (one-dimensional array)
The From1 and To1 should be equal and specify index of the element. From2 and To2
should be omitted or specified as ACSC_NONE.
• Writing value to one element of matrix (two-dimensional array)
The From1 and To1 should be equal and specify row number. The From2 and To2 should
be equal and specify column number.
• Writing value to sub-vector (more then one element) of vector
The From1 and To1 should specify sub-vector index range, From1 should be less then
To1. The From2 and To2 should be omitted or specified as ACSC_NONE.
• Writing value to row or part of row of matrix
The From1 and To1 should be equal and specify row number. The From2 and To2 should
specify elements range within the specified row, From2 should be less then To2.
• Writing value to column or part of column of matrix
The From1 and To1 should specify rows range within the specified column, From1 should
be less than To1. The From2 and To2 should be equal and specify column number.
• Writing value to sub-matrix of matrix
The From1 and To1 should specify rows range, From1 should be less then To1. The
From2 and To2 should specify columns range, From2 should be less then To2.
If indexes (From1, To1, From2, To2) are specified, their values must correspond to Value
Dimensions described below
Value type is not required to be the same as Variable type. The library provides automatic
conversion from integer to real and from real to integer.
If the method fails, the Error object is filled with the error description.
Example
Sub WriteVariable_Sample()
Dim Scalar, Vector(7), Matrix(2, 3), SubVector(1), SubMatrix(1, 1)
On Error GoTo except
'Initialize Scalar
Scalar = 57600
'Initialize Vector
For Index = 0 To 7
Vector(Index) = 1.1
Next Index
'Initialize Matrix
For Row = 0 To 2
For Colomn = 0 To 3
Matrix(Row, Colomn) = 2
Next Colomn
Next Row
'Initialize SubVector
SubVector(0) = 3
SubVector(1) = 3
'Initialize SubMatrix
For Row = 0 To 1
For Colomn = 0 To 1
SubMatrix(Row, Colomn) = 4
Next Colomn
Next Row
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
End Sub
5.191 WriteLogFile
The method writes to log file.
Syntax
object.WriteLogFile(Buf, Count)
Parameters
Name Type Description
Buf [in] string String to be written to log file.
Return Value
None.
Remarks
The method writes data from a buffer to log file. The log file should be previously opened by
the method OpenLogFile.
The method adds its arguments to the internal UMD binary buffer. In previous C Library
versions, the log file had to be explicitly opened by the method OpenLogFile, otherwise the
function would return an error. Starting with COM Library version 5.0, this is no longer the
case. See, FlushLogFile.
If the method fails, the Error object is filled with the error description.
Example
Sub WriteLogFile_Sample()
On Error GoTo except
'Opens a log file
Call Ch.OpenLogFile("C:\COMLogFile.log")
'Write to log file
Call Ch.WriteLogFile("Writing to log file")
'Close the log file
Call Ch.CloseLogFile
Exit Sub
except:
MyErrorMsg 'See Error Handling in Visual Basic
End Sub
6 Properties
6.1 General
Note
See the SPiiPlus ACSPL+ Programmer’s Guide for detailed
explanations of faults.
7 Events
SPiiPlus COM Library has events for the following types of interrupts:
The bit-mapped event parameter Param is an interrupt mask that determines which
axis/buffer/input a given interrupt was generated for. See Section 6.13, Interrupt Masks for a
description of Param for each interrupt.
8 Error Handling
The SPiiPlus COM Library supports a standard COM error object to provide error information.
Each COM error object contains:
• The source reporting the error as follows: SpiiPlusCom510.Channel.
• A string with a description of the error and the SPiiPlus Error Codes (see Section 8.4). For
example:
Communication Initialization failure. Error – 132
• HRESULT - a 32-bit standard COM value representing the method return status. To get the
SPiiPlus error code from HRESULT, use ParseCOMErrorCode (see Section 5.122). For
more information about HRESULT, refer to Microsoft documentation.
Sub MyErrorMsg()
Dim Str
Str = "Error from " & Err.Source & Chr$(10) & Chr$(13)
Str = Str & Err.Description & Chr$(10) & Chr$(13)
Str = Str & "HRESULT: " & Hex$(Err.Number)
MsgBox Str
End Sub
If communication is not established, the following error message appears:
Note
Any error code greater than 1000 is a controller error defined in the
SPiiPlus ACSPL+ Programmer’s Guide.
Table 53 (page 1 of 4)
Error Description
102 No such file or directory.
This error is returned by the OpenLogFile method if a component of a path does not
specify an existing directory.
103 The FW version does not support the current C Library version.
This error is returned by one of the OpenComm methods. Upgrde the FW of the
controller.
109 Internal library error: Invalid file handle.
113 File permission denied.
This error is returned by the OpenLogFile method if attempt was made to open a
read-only file, or file’s sharing mode does not allow a write operation.
122 Internal library error: Cannot open Log file.
124 Too many open files.
This error is returned by the OpenLogFile method if no more file handles available.
128 No space left on device.
This error is returned by the WriteLogFile method if no more space for writing is
available on the device (for example, when the disk is full).
130 Timeout expired.
This error indicates that during specified timeout the controller did not respond or
response was invalid.
132 Communication initialization failure.
This error is returned by one of the Open*** methods in the following cases:
the specified communication parameters are invalid
the corresponding physical connection is not established
the controller does not respond for specified communication channel.
133 Internal library error: Creating communication object failure.
134 Invalid communication handle.
Specified communication handle must be a handle returned by one of the Open***
methods.
135 All channels are busy.
The maximum number of the concurrently opened communication channels is 10.
136 Invalid name of Log file.
This error is returned by the OpenLogFile method if the specified log file name is
invalid or more than 256 characters.
137 Received message is too long (more than size of user buffer).
This error cannot be returned and is present for compatibility with previous versions
of the library.
138 The program string is long.
This error is returned by one of the an AppendBuffer or LoadBuffer method if
ACSPL+ program contains a string longer than 2032 bytes.
Table 53 (page 2 of 4)
Error Description
139 Method parameters are invalid.
140 History buffer is closed.
141 Name of variable must be specified.
142 Error in index specification.
This error is returned by the ReadVariable, ReadVariableAsScalar,
ReadVariableAsVector, ReadVariableAsMatrix, WriteVariable methods if the
parameters From1, To1, From2, To2 were specified incorrectly.
143 Controller reply contains less values than expected.
This error is returned by the ReadVariable, ReadVariableAsScalar,
ReadVariableAsVector, ReadVariableAsMatrixmethods.
147 Internal error: Error of the history buffer initialization.
150 Unsolicited messages buffer is closed.
151 Callback registration error.
This error is returned by the EnableEvent method for any of the communication
channels.
In the present version of library, only PCI Bus communication supports user
callbacks.
152 Callback method has been already installed.
This error is returned by the EnableEvent method if the application tries to enable
another event for the same interrupt that was already used. Only one event can be
enabled for each interrupt.
153 Checksum of the controller response is incorrect.
154 Internal library error: The controller replies sequence is invalid.
155 Internal library error: WaitForSingleObject method returns error.
157 Internal library error: Error of the unsolicited messages buffer initialization.
162 The library cannot send to the specified communication channel.
Check physical connection with the controller (or settings) and try to reconnect.
163 The library cannot receive from the specified communication channel.
Check physical connection with the controller (or settings) and try to reconnect.
164 Internal library error: Sending of the chain is failed.
179 Internal library error: Thread local storage error.
180 PCI driver initialization error. Returned by the GetPCICards method in the
following cases:
• SpiiPlus PCI driver is not installed correctly
• The version of the SpiiPlus PCI Bus driver is incorrectly - in this case, it is
necessary to reinstall the SpiiPlus PCI driver (WINDRIVER) and the library.
190 Cannot access DPRAM directly through any channel but PCI and Direct.
Returned by DPRAM access methods, when attempting to call them with Serial or
Ethernet channels.
Table 53 (page 3 of 4)
Error Description
191 Problem occurred while activating one of SpiiPlus device drivers. Returned by
OpenCommPCI.
192 Invalid DPRAM address was specified
Returned by DPRAM access methods, when attempting to access illegal address
193 This version of simulator does not support work with DPRAM.
Returned by DPRAM access methods, when attempting to access old version
Simulator that does not support DPRAM.
194 Problem in SpiiPlus PCI Hardware was detected. Returned by OpenCommPCI
195 Returned by methods that work with host file system when a specified filename is not
found.
Check the path and filename.
196 Returned by methods that analyze SPiiPlus application files when application file
format is incorrect.
Check application file and replace with a valid file.
197 The application cannot establish communication with the SPiiPlus UMD.
Returned by one of the OpenComm methods.
Check the following:
• SPiiPlus UMD is loaded (whether the UMD icon appears in the Task tray).
• SPiiPlus UMD shows an error message.
• In case of remote connection, access from a remote application is enabled.
198 The controller does not reply for more than 20 seconds.
Returned by any method that exchanges data with the controller.
Check the following:
• Controller is powered on (MPU LED is green)
• Controller connected properly to host
• Controller executes a time consuming command like compilation of a large
program, save to flash, load to flash, etc.
199 The DLL and the UMD versions are not compatible.
Returned by one of the OpenComm methods.
Verify that the files ACSCL.DLL and ACSCSRV.EXE are of the same version.
502 No interrupt
504 Interrupt period
506 No interrupt notification event
508 SPii failure
601 Error in array and/or index definition
602 Communication channel is already open
Table 53 (page 4 of 4)
Error Description
603 Argument Value has incorrect type
604 Argument Value is not initialized