ICP PISO-PS200 User manual

Type
User manual
PISO-PS200 Function Reference
(Version 3.0)
PISO-PS200 Function Reference Version 3.0
1
Warranty
All products manufactured by ICPDAS Inc. are warranted against defective
materials for a period of one year from the date of delivery to the original purchaser.
Warning
ICPDAS Inc. assumes no liability for damages consequent to the use of this
product. ICPDAS Inc. reserves the right to change this manual at any time without
notice. The information furnished by ICPDAS Inc. is believed to be accurate and
reliable. However, no responsibility is assumed by ICPDAS Inc. for its use, or for any
infringements of patents or other rights of third parties resulting from its use.
Trademark
The names used for identification only maybe registered trademarks of their
respective companies.
License
The user can use, modify and backup this software on a single machine. The user
may not reproduce, transfer or distribute this software, or any copy, in whole or in
part.
PISO-PS200 Function Reference Version 3.0
2
Contents
INTRODUCTION..............................................................................................................................................................6
SYSTEM INITIALIZATION............................................................................................................................................8
2.1 OPERATING-SYSTEM CONFIGURATION ...............................................................................................................8
2.1.1 ps200_scan....................................................................................................................................................8
2.1.2 ps200_get_cardinfo.....................................................................................................................................10
2.1.3 ps200_open.................................................................................................................................................11
2.1.4 ps200_close.................................................................................................................................................12
2.1.5 ps200_reset.................................................................................................................................................13
2.1.6 ps200_open_all...........................................................................................................................................14
2.1.7 ps200_close_all ..........................................................................................................................................15
2.1.8 ps200_reset_all...........................................................................................................................................16
2.2 HARDWARE CONFIGURATION (REQUIRED)........................................................................................................17
2.2.1 ps200_set_pls_cfg.......................................................................................................................................17
2.2.2 ps200_set_enc_cfg......................................................................................................................................19
2.2.3 ps200_set_limit...........................................................................................................................................20
2.3 HARDWARE CONFIGURATION (OPTIONAL)........................................................................................................21
2.3.1 ps200_set_range.........................................................................................................................................21
2.3.2 ps200_get_range_settings...........................................................................................................................23
2.3.3 ps200_set_inp .............................................................................................................................................24
2.3.4 ps200_set_alarm.........................................................................................................................................25
2.3.5 ps200_set_filter...........................................................................................................................................26
2.3.6 ps200_set_softlimit .....................................................................................................................................28
2.3.7 ps200_load_config......................................................................................................................................30
2.3.8 ps200_servo_on ..........................................................................................................................................31
AUTOMATIC HOME SEARCH....................................................................................................................................32
3.1 ps200_set_home_cfg...................................................................................................................................33
3.2 ps200_home_start.......................................................................................................................................35
INDEPENDENT MOVING FUNCTIONS.....................................................................................................................37
4.1 ps200_velocity_move..................................................................................................................................37
4.2 ps200_const_move......................................................................................................................................39
4.3 ps200_const_moveall..................................................................................................................................40
4.4 ps200_t_move .............................................................................................................................................41
4.5 ps200_t_moveall.........................................................................................................................................43
PISO-PS200 Function Reference Version 3.0
3
4.6
ps200_s_move.............................................................................................................................................45
4.7 ps200_s_moveall.........................................................................................................................................47
INTERPOLATION MOVING FUNCTIONS................................................................................................................49
5.1 INDIVIDUAL INTERPOLATION MOVING..............................................................................................................49
5.1.1 ps200_t_line2_move ...................................................................................................................................49
5.1.2 ps200_s_line2_move...................................................................................................................................52
5.1.3 ps200_t_arc2_move....................................................................................................................................54
5.2 CONTINUOUS INTERPOLATION MOVING ...........................................................................................................58
5.2.1 ps200_conti_interp_begin...........................................................................................................................60
5.2.2 ps200_conti_interp_next_ready..................................................................................................................62
5.2.3 ps200_conti_line2_move.............................................................................................................................63
5.2.4 ps200_conti_arc2_move .............................................................................................................................65
5.2.5 ps200_conti_interp_end..............................................................................................................................67
OTHER MOTION FUNCTIONS ...................................................................................................................................68
6.1 ps200_stop_move........................................................................................................................................68
6.2 ps200_stop_move_all..................................................................................................................................70
6.3 ps200_drv_hold ..........................................................................................................................................71
6.4 ps200_drv_start..........................................................................................................................................72
ADVANCED MOTION CONFIGURATIONS ..............................................................................................................73
7.1 ps200_set_vring..........................................................................................................................................73
7.2 ps200_set_mpg............................................................................................................................................75
7.3 ps200_set_int_factor...................................................................................................................................77
7.4 ps200_int_event_config ..............................................................................................................................79
MISCELLANEOUS FUNCTIONS.................................................................................................................................80
8.1 ps200_t_change_v.......................................................................................................................................80
8.2 ps200_t_set_avtri........................................................................................................................................82
8.3 ps200_change_p .........................................................................................................................................83
8.4 ps200_set_cmdcounter................................................................................................................................84
8.5 ps200_set_position......................................................................................................................................85
STATUS.............................................................................................................................................................................86
9.1 ps200_motion_done....................................................................................................................................86
9.2 ps200_get_cmdcounter...............................................................................................................................88
9.3 ps200_get_position.....................................................................................................................................89
9.4 ps200_get_speed.........................................................................................................................................90
9.5 ps200_get_acc ............................................................................................................................................91
PISO-PS200 Function Reference Version 3.0
4
9.6
ps200_get_mdi_status.................................................................................................................................92
9.7 ps200_get_in3.............................................................................................................................................93
9.8 ps200_get_int_status...................................................................................................................................94
9.9 ps200_get_error_status...............................................................................................................................95
FRNET I/O EXTENSION................................................................................................................................................96
10.1 ps200_scan_FRnet_DI................................................................................................................................96
10.2 ps200_reset_FRnet......................................................................................................................................98
10.3 ps200_config_FRnet...................................................................................................................................99
10.4 ps200_get_FRnet_DI................................................................................................................................100
10.5 ps200_set_FRnet_DO...............................................................................................................................102
ERROR CODE...............................................................................................................................................................104
PISO-PS200 Function Reference Version 3.0
5
CHAPTER 1
Introduction
This software package is dedicated to PISO-PS200 pulse-based motion controller. It includes the
WDM (Windows Driver Model) driver and ANSI-C Library for Windows 2000 and Windows XP.
The changes between the Version 3.0 and the older version are:
î‚—
The function-names are changed.
î‚—
The driver is re-designed to embed all Motion-control in OS kernel.
î‚—
The routines are re-defined and the simpler programming follow-chart (refer to the figure 1).
One unique Card ID will be referred by every function in Library. This Card ID is configured with
on-board Dip-Switch, and helps to identify multiple PISO-PS200 cards in your system. In other words,
you no longer worry about the order that Operating System scans your cards; the only thing you must
take care is the correct connections between terminal-boards and PISO-PS200 cards.
There are samples that are provided for Microsoft
®
Visual Studio 6.0 (VC and VB) and Borland
®
BCB
6.0 to demonstrate the functions of PISO-PS200 Library. Some samples need the Generic-type
terminal-board (DN-8237) to connect external sensor, output pulse and encoder-input.
This documentation provides the detailed information of PISO-PS200 APIs, including the
function-decelerations, definitions of both parameters and return codes. The APIs will be cataloged
and described in the following chapters:
z
CHAPTER 2 – System Initialization
z
CHAPTER 3 – Automatic Home Search
z
CHAPTER 4 – Independent Moving Functions
z
CHAPTER 5 – Interpolation Moving Functions
z
CHAPTER 6 – Other Motion Functions
z
CHAPTER 7 – Advanced Motion Configurations
z
CHAPTER 8 – Miscellaneous Functions
z
CHAPTER 9 – Status
PISO-PS200 Function Reference Version 3.0
6
z
CHAPTER 10 – FRnet I/O extension
Figure 1 - typical programming follow-chart
PISO-PS200 Function Reference Version 3.0
7
CHAPTER 2
System Initialization
2.1 Operating-System Configuration
The functions in this chapter provide the interface to Operating-System. By calling these functions,
your applications can sane all PISO-PS200 cards that are active in your system, and get the specific
Card-IDs configured with the on-board Dip-Switch. Open the card and access the internal
Motion-Control ASIC with the other functions in PISO-PS200 Library.
2.1.1 ps200_scan
VC6 / BCB6
short ps200_scan(short* pCardNum, BYTE* pAvailCards = NULL)
VB6
ps200_scan(ByRef pCardNum As Interger, pAvailCards As Byte = 0) As Integer
Description:
This function scans all active PISO-PS200 cards in your system. The pCardNum saves the numbers
of active PISO-PS200 cards. The optional user-provided Array, pAvailCards, indicates the presence
of active PISO-PS200 card. (1: present, 0: absent)
Parameters:
pCardNum: The pointer to the memory that stores the numbers of active PISO-PS200 cards.
pAvailCard: The address of user-provided
BYTE
-Array. Based on the Card ID, each element
indicates the presence of active PISO-PS200 card. The user must prepare one
BYTE
-Array with
PS200_MaxCards
elements.
For instance, there are three active PISO-PS200 cards with Card ID 3, 5 and 7. The
PISO-PS200 Function Reference Version 3.0
8
content of pAvailCard Array will be
{ 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 }
Return Code:
SUCCESS_NO_ERROR: The function returns successfully.
ERROR_NO_CARD_FOUND: There is no active card available in your system.
ERROR_CARD_ID_DUPLICATED: There are multiple cards are assigned the same Card ID, please
check the settings of on-board Dip-Switch.
ERROR_ACCESS_VIOLATION_DATA_COPY: Some system exception occurs while copying
memory, please check the pointer-type parameter you assign to this function.
PISO-PS200 Function Reference Version 3.0
9
2.1.2 ps200_get_cardinfo
VC6 / BCB6
short ps200_get_cardinfo(int ScannedIndex, BYTE* pCardID)
VB6
ps200_get_cardinfo(ByVal ScannedIndex As Interger, ByRef pCardID As Byte) As Integer
Description:
This function returns the Card ID based on the scanned-index. This routine will get the Card ID
configured with on-board Dip-Switch.
Parameters:
ScannedIndex: The index that the active PISO-PS200 card is scanned. This index begins from 0,
and is less than the active PISO-PS200 cards.
pCardID: The pointer to the memory that stores the specific Card ID.
Return Code:
SUCCESS_NO_ERROR: The function returns successfully.
ERROR_NO_CARD_FOUND: There is no active card available in your system.
ERROR_INVALID_SCANNED_INDEX: Indicates the ScannedIndex is not less than the numbers of
active PISO-PS200 cards.
ERROR_ACCESS_VIOLATION_DATA_COPY: Some system exception occurs while copying
memory, please check the pointer-type parameter you assign to this function.
PISO-PS200 Function Reference Version 3.0
10
2.1.3 ps200_open
VC6 / BCB6
short ps200_open(BYTE bCardID)
VB6
ps200_open(ByVal bCardID As Byte) As Integer
Description:
This function opens the device node of PISO-PS200 based on the specific Card ID. If this function
returns successfully, the process that calls this function owns the device until ps200_close() is called.
The device node of PISO-PS200 is ought to be owned before accessing the Motion-Control ASIC
with the other functions. It’s recommended to call ps200_scan() and ps200_get_cardinfo() to get the
Card ID.
Parameters:
bCardID: The specific Card ID that is configured with the on-board Dip-Switch.
Return Code:
SUCCESS_NO_ERROR: The function returns successfully.
ERROR_INVALID_CARD_ID: There is no active PISO-PS200 card configured with bCardID, or the
given Card ID is invalid (for instance, Card ID is assigned to 254).
ERROR_IOCTL_FAILED: Cannot get the settings of
Range
register, please call GetLastError() for
further system information.
ERROR_DEVICE_OPEN: Fail to open the device-node of PISO-PS200. Please make sure no other
process owns that PISO-PS200 card.
ERROR_MEMORY_MAP: Indicates the Memory-Mapping is failed, please check the event logs in
Event Viewer.
PISO-PS200 Function Reference Version 3.0
11
2.1.4 ps200_close
VC6 / BCB6
short ps200_close(BYTE bCardID)
VB6
ps200_close(ByVal bCardID As Byte) As Integer
Description:
This function closes the device node of PISO-PS200 based on the specific Card ID. After calling this
function, the PISO-PS200 card will be released, and other process can open it.
Parameters:
bCardID: The specific Card ID that is configured with the on-board Dip-Switch.
Return Code:
SUCCESS_NO_ERROR: The function returns successfully.
ERROR_INVALID_CARD_ID: There is no opened PISO-PS200 card with assigned Card ID, or the
given Card ID is invalid (for instance, Card ID is assigned to 254).
ERROR_DEVICE_CLOSE: Fail to close the device-node of PISO-PS200.
ERROR_MEMORY_UNMAP: Indicates the Memory-Un-mapping is failed, please check the event
longs in Event Viewer.
PISO-PS200 Function Reference Version 3.0
12
2.1.5 ps200_reset
VC6 / BCB6
short ps200_reset(BYTE bCardID)
VB6
ps200_reset(ByVal bCardID As Byte) As Integer
Description:
This function re-sets the internal Motion-Control ASIC and re-configures the basic registers with
default value. After calling this function, all configuration set before will be ignored. This function
terminates the current motion, too.
Parameters:
bCardID: The specific Card ID that is configured with the on-board Dip-Switch.
Return Code:
SUCCESS_NO_ERROR: The function returns successfully.
ERROR_INVALID_CARD_ID: There is no opened PISO-PS200 card with assigned Card ID, or the
given Card ID is invalid (for instance, Card ID is assigned to 254).
ERROR_CARD_RESET: Cannot reset the Motion-Control ASIC, please call GetLastError() for
further system information.
PISO-PS200 Function Reference Version 3.0
13
2.1.6 ps200_open_all
VC6 / BCB6
short ps200_open_all(void)
VB6
ps200_open_all() As Integer
Description:
This function opens the all active PISO-PS200 cards. If this function returns successfully, the process
that calls this function owns all devices until ps200_close_all() is called.
Parameters:
None
Return Code:
SUCCESS_NO_ERROR: The function returns successfully.
ERROR_IOCTL_FAILED: Cannot get the settings of
Range
register, please call GetLastError() for
further system information.
ERROR_DEVICE_OPEN: Fail to open the device-node of PISO-PS200. Please make sure no other
process occupies that PISO-PS200 card.
ERROR_MEMORY_MAP: Indicates the Memory-Mapping is failed, please check the event logs in
Event Viewer.
PISO-PS200 Function Reference Version 3.0
14
2.1.7 ps200_close_all
VC6 / BCB6
short ps200_close_all(void)
VB6
ps200_close_all() As Integer
Description:
This function closes all opened PISO-PS200 cards. After calling this function, the all PISO-PS200
cards will be released, and other process can open them.
Parameters:
None
Return Code:
SUCCESS_NO_ERROR: The function returns successfully.
ERROR_DEVICE_CLOSE: Fail to close the device-node of PISO-PS200.
ERROR_MEMORY_UNMAP: Indicates the Memory-Un-mapping is failed, please check the event
longs in Event Viewer.
PISO-PS200 Function Reference Version 3.0
15
2.1.8 ps200_reset_all
VC6 / BCB6
short ps200_reset_all(void)
VB6
ps200_reset_all() As Integer
Description:
This function re-sets the internal Motion-Control ASIC of all active PISO-PS200 cards and
re-configures the basic registers with default value. After calling this function, all configuration set
before will be ignored. This function terminates the current motion of all active PISO-PS200 cards,
too.
Parameters:
None
Return Code:
SUCCESS_NO_ERROR: The function returns successfully.
ERROR_CARD_RESET: Cannot reset the Motion-Control ASIC, please call GetLastError() for
further system information.
PISO-PS200 Function Reference Version 3.0
16
2.2 Hardware Configuration (required)
After the driver is loaded, the pre-defined configurations are assigned to the relative registers of
Motion-Control ASIC. The functions in this chapter configure/change the default-settings and polarities
of output-pulse, input-encoder and hardware-limit sensors.
2.2.1 ps200_set_pls_cfg
VC6 / BCB6
short ps200_set_pls_cfg(BYTE bCardID, WORD wAxis, WORD wPulseMode, WORD
wPulseLogic, WORD wDirectionLogic)
VB6
ps200_set_pls_cfg(ByVal bCardID As Byte, ByVal wAxis As Integer, ByVal wPulseMode As
Integer, ByVal wPulseLogic As Integer, ByVal wDirectionLogic As Integer) As Integer
Description:
This function configures the output-pulse mode of PISO-PS200.
Parameters:
bCardID: The specific Card ID that is configured with the on-board Dip-Switch.
wAxis: Can be one of AXIS_X, AXIS_Y.
wPulseMode: PULSE_MODE_CW_CCW or PULSE_MODE_PULSE_DIRECTION.
wPulseLogic: PULSE_LOGIC_ACTIVE_HIGH or PULSE_LOGIC_ACTIVE_LOW
wDirectionLogic: PULSE_FORWARD_ACTIVE_HIGH or PULSE_FORWARD_ACTIVE_LOW. This
parameter will be ignored if the parameter
wPulseMode
is assigned to
PULSE_MODE_CW_CCW.
Return Code:
SUCCESS_NO_ERROR: The function returns successfully.
ERROR_INVALID_CARD_ID: There is no active PISO-PS200 card configured with bCardID, or the
given Card ID is invalid (for instance, Card ID is assigned to 254).
ERROR_MULTI_AXES_ASSIGNED: Multiple axes are assigned to parameter
wAxis
.
ERROR_NO_VALID_AXIS_ASSIGNED: No valid axis ID is assigned to parameter
wAxis
.
ERROR_INVALID_PULSE_MODE: Neither PULSE_MODE_CW_CCW nor
PULSE_MODE_PULSE_DIRECTION is assigned to parameter
wPulseMode
.
ERROR_INVALID_PULSE_LEVEL: Neither PULSE_LOGIC_ACTIVE_HIGH nor
PULSE_LOGIC_ACTIVE_LOW is assigned to parameter
wPulseLogic
.
PISO-PS200 Function Reference Version 3.0
17
ERROR_INVALID_PULSE_DIRECTION: Neither PULSE_FORWARD_ACTIVE_HIGH nor
PULSE_FORWARD_ACTIVE_LOW is assigned to parameter
wDirectionLogic
.
ERROR_PULSE_MODE_SET: Cannot change the output pulse mode, please call GetLastError() for
further system information.
PISO-PS200 Function Reference Version 3.0
18
2.2.2 ps200_set_enc_cfg
VC6 / BCB6
short ps200_set_enc_cfg(BYTE bCardID, WORD wAxis, WORD wEncoderMode, BYTE
bCounterSource = 0)
VB6
(ByVal bCardID As Byte, ByVal wAxis As Integer, ByVal wEncoderMode As Integer, Optional
ByVal bCounterSource As Byte = 0) As Integer
Description:
This function configures the input-encoder mode of PISO-PS200.
Parameters:
bCardID: The specific Card ID that is configured with the on-board Dip-Switch.
wAxis: Can be one of AXIS_X, AXIS_Y.
wEncoderMode: ENCODER_MODE_AB, ENCODER_MODE_AB_DIVID_2,
ENCODER_MODE_AB_DIVID_4 or ENCODER_MODE_CW_CCW.
bCounterSource: The optional parameter that is reserved for future.
Return Code:
SUCCESS_NO_ERROR: The function returns successfully.
ERROR_INVALID_CARD_ID: There is no active PISO-PS200 card configured with bCardID, or the
given Card ID is invalid (for instance, Card ID is assigned to 254).
ERROR_MULTI_AXES_ASSIGNED: Multiple axes are assigned to parameter
wAxis
.
ERROR_NO_VALID_AXIS_ASSIGNED: No valid axis ID is assigned to parameter
wAxis
.
ERROR_INVALID_ENCODER_MODE: No valid encoder mode is assigned to parameter
wEncoderMode
.
ERROR_ENCODER_MODE_SET: Cannot change the input encoder mode, please call
GetLastError() for further system information.
PISO-PS200 Function Reference Version 3.0
19
2.2.3 ps200_set_limit
VC6 / BCB6
short ps200_set_limit(BYTE bCardID, WORD wAxis, WORD wLimitLogic, WORD wStopMode
= LIMIT_STOP_SUDDEN)
VB6
ps200_set_limit(ByVal bCardID As Byte, ByVal wAxis As Integer, ByVal wLimitLogic As Integer,
Optional ByVal wStopMode As Integer = LIMIT_STOP_SUDDEN) As Integer
Description:
This function configures the polarity and stop-mode of hardware-limit sensor.
Parameters:
bCardID: The specific Card ID that is configured with the on-board Dip-Switch.
wAxis: Can be one of AXIS_X, AXIS_Y.
wLimitLogic: LIMIT_LOGIC_ACTIVE_HIGH or LIMIT_LOGIC_ACTIVE_LOW.
wStopMode: LIMIT_STOP_SUDDEN or LIMIT_STOP_SLOWDOWN. This optional parameter is set
as LIMIT_STOP_SUDDEN by default.
Return Code:
SUCCESS_NO_ERROR: The function returns successfully.
ERROR_INVALID_CARD_ID: There is no active PISO-PS200 card configured with bCardID, or the
given Card ID is invalid (for instance, Card ID is assigned to 254).
ERROR_MULTI_AXES_ASSIGNED: Multiple axes are assigned to parameter
wAxis
.
ERROR_NO_VALID_AXIS_ASSIGNED: No valid axis ID is assigned to parameter
wAxis
.
ERROR_INVALID_LIMIT_LOGIC: Neither LIMIT_LOGIC_ACTIVE_HIGH nor
LIMIT_LOGIC_ACTIVE_LOW is assigned to parameter
wLimitLogic
.
ERROR_INVALID_STOP_MODE: Neither LIMIT_STOP_SUDDEN nor LIMIT_STOP_SLOWDOWN
is assigned to parameter
wStopMode
.
ERROR_LIMIT_SENSOR_SET: Cannot configure the hardware-limit sensor, please call
GetLastError() for further system information.
PISO-PS200 Function Reference Version 3.0
20
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74
  • Page 75 75
  • Page 76 76
  • Page 77 77
  • Page 78 78
  • Page 79 79
  • Page 80 80
  • Page 81 81
  • Page 82 82
  • Page 83 83
  • Page 84 84
  • Page 85 85
  • Page 86 86
  • Page 87 87
  • Page 88 88
  • Page 89 89
  • Page 90 90
  • Page 91 91
  • Page 92 92
  • Page 93 93
  • Page 94 94
  • Page 95 95
  • Page 96 96
  • Page 97 97
  • Page 98 98
  • Page 99 99
  • Page 100 100
  • Page 101 101
  • Page 102 102
  • Page 103 103
  • Page 104 104
  • Page 105 105
  • Page 106 106
  • Page 107 107
  • Page 108 108
  • Page 109 109

ICP PISO-PS200 User manual

Type
User manual

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI