PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ......

119
1 PISO-MN200 Function Reference V1.0 PISO-MN200 Function Reference (Version 1.0)

Transcript of PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ......

Page 1: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

1

PISO-MN200 Function Reference V1.0

PISO-MN200 Function Reference (Version 1.0)

Page 2: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

2

PISO-MN200 Function Reference V1.0

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.

Page 3: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

3

PISO-MN200 Function Reference V1.0

Contents

Introduction ......................................................................................................................................... 6

System Initialization ........................................................................................................................... 8

2.1 Operating-System Configuration .................................................................................. 8

2.1.1 mn_open_all .......................................................................................................... 8

2.1.2 mn200_get_lineinfo ............................................................................................ 10

2.1.3 mn200_get_cardinfo ............................................................................................11

2.1.4 mn_close_all ....................................................................................................... 12

2.1.5 mn_reset .............................................................................................................. 13

2.1.6 mn_set_comm_speed .......................................................................................... 14

2.1.7 mn_start_line....................................................................................................... 15

2.1.7 mn_stop_line ....................................................................................................... 16

2.2 Hardware Configuration ....................................................................................................... 17

2.2.1 mn_set_motion_cfg............................................................................................. 17

2.2.2 mn_get_motion_cfg ............................................................................................ 24

2.3 Hardware Configuration (optional)....................................................................................... 25

2.3.1 mn_set_filter ....................................................................................................... 25

2.3.2 mn_set_softlimit ................................................................................................. 27

2.3.3 mn_servo_on ....................................................................................................... 29

2.3.4 mn_set_erc .......................................................................................................... 30

2.3.5 mn_alarm_reset ................................................................................................... 31

2.3.6 mn_load_ezgo_cfg .............................................................................................. 32

Automatic Home Search ................................................................................................................... 33

3.1 mn_home_start ........................................................................................................ 33

Independent Moving Functions ....................................................................................................... 42

4.1 mn_velocity_move .................................................................................................. 42

4.2 mn_fix_move .......................................................................................................... 45

4.3 mn_stop_move ........................................................................................................ 48

Interpolation Moving Functions ...................................................................................................... 49

5.1 mn_set_group .......................................................................................................... 49

5.2 mn_get_group ......................................................................................................... 51

5.3 mn_line2_move....................................................................................................... 52

5.4 mn_arc2_move ........................................................................................................ 55

5.5 mn_line3_move....................................................................................................... 59

5.6 mn_linen_move....................................................................................................... 62

5.7 mn_conti_interp_next_ready .................................................................................. 65

Other Motion Functions ................................................................................................................... 66

Page 4: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

4

PISO-MN200 Function Reference V1.0

6.1 mn_group_stop_move............................................................................................. 66

6.2 mn_group_hold_move ............................................................................................ 68

6.3 mn_group_start_move ............................................................................................ 69

Advanced Motion Configurations ................................................................................................... 70

7.1 mn_set_vring........................................................................................................... 70

7.2 mn_cnst_cmptrig_config ........................................................................................ 72

Miscellaneous Functions ................................................................................................................... 74

8.1 mn_change_v .......................................................................................................... 74

8.2 mn_change_p .......................................................................................................... 77

8.3 mn_set_cmdcounter ................................................................................................ 78

8.4 mn_set_enccounter ................................................................................................. 79

Status .................................................................................................................................................. 80

9.1 mn_get_dev_info .................................................................................................... 80

9.2 mn_motion_done .................................................................................................... 82

9.3 mn_get_cmdcounter ................................................................................................ 83

9.4 mn_get_enccounter ................................................................................................. 84

9.5 mn_get_speed ......................................................................................................... 85

9.6 mn_get_mdio_status ............................................................................................... 86

9.7 mn_get_error_status ................................................................................................ 88

I/O extension ...................................................................................................................................... 89

10.1 mn200_get_di ......................................................................................................... 89

10.2 mn200_set_do ......................................................................................................... 91

10.3 mn200_get_do......................................................................................................... 92

10.4 mn_get_di_bit ......................................................................................................... 93

10.5 mn_set_do_bit ......................................................................................................... 94

10.6 mn_get_do_bit ........................................................................................................ 95

10.7 mn_get_di_byte....................................................................................................... 96

10.8 mn_set_do_byte ...................................................................................................... 98

10.9 mn_get_do_byte .................................................................................................... 100

10.10 mn_get_di_word ............................................................................................... 102

10.11 mn_set_do_word ............................................................................................... 104

10.12 mn_get_do_word .............................................................................................. 106

Advanced I/O Functions ................................................................................................................. 108

11.1 mn_get_port_bit .................................................................................................... 108

11.2 mn_set_port_bit .....................................................................................................110

11.3 mn_get_port_byte .................................................................................................. 111

11.4 mn_set_port_byte ...................................................................................................112

11.5 mn_get_line_status ................................................................................................113

Page 5: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

5

PISO-MN200 Function Reference V1.0

11.6 mn_get_slave_error_table ......................................................................................115

11.7 mn_clear_slave_error_flag ....................................................................................116

Error Code ........................................................................................................................................ 117

Page 6: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

6

PISO-MN200 Function Reference V1.0

CHAPTER 1

Introduction

This software package is dedicated to PISO-MN200 pulse-based motion controller. It includes the

WDM (Windows Driver Model) driver, ANSI-C Library for Windows XP and Windows 7 and related

sample program.

One PISO-MN200 provides two Motionnet serial communication lines. If more than one card exists,

the sequence of line numbers will be allocated by the card ID that was configured with on-board

Dip-Switch. One unique line number will be referred by each function in Library, and helps to identify

multiple PISO-MN200 cards in your system. User can define communication line number by adjusting

the Card ID. In other words, you no longer worry about the order that an Operating System scans

PISO-MN200 cards.

There are samples that are provided for Microsoft® Visual Studio 6.0 C++, Visual Studio 2005 .NET C#

and Borland® BCB 6.0 samples to demonstrate the functions of PISO-MN200 Library.

This documentation provides the detailed information of PISO-MN200 APIs, including the function,

definitions of both parameters and return codes. The APIs will be cataloged and described in the

following chapters:

CHAPTER 2 – System Initialization

CHAPTER 3 – Automatic Home Search

CHAPTER 4 – Independent Moving Functions

CHAPTER 5 – Interpolation Moving Functions

CHAPTER 6 – Other Motion Functions

CHAPTER 7 – Advanced Motion Configurations

CHAPTER 8 – Miscellaneous Functions

CHAPTER 9 – Status

CHAPTER 10 – I/O extension

Page 7: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

7

PISO-MN200 Function Reference V1.0

CHAPTER 11 – Advanced I/O Functions

Fig1. Typical programming flow chart

Page 8: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

8

PISO-MN200 Function Reference V1.0

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 scan all Motionnet communication lines that can be used in your system, and get

their numbers. According to the order of specific Card-IDs configured with the on-board Dip-Switch,

system will define communication line numbers for several PISO-MN200. (System allocates

communication line number by Card-ID order, and there are two continuous communication line

numbers can be used in a PISO-MN200 card.) The communication line number is used in other

functions to control the specified Motionnet communication line on the board.

2.1.1 mn_open_all

VC6 / BCB6

short mn_open_all( BYTE* pNumLine )

C#

Int16 mn_open_all( ref Byte pNumLine )

Description:

This function will scan all Motionnet cards that can be used in an operating system. The

parameter pNumLine is used to save the number of all Motionnet communication lines which can be

used in an operating system.

Parameters:

pNumLine: The pointer to the memory stores the number of active communication lines.

Page 9: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

9

PISO-MN200 Function Reference V1.0

Return Code:

SUCCESS: The function returns successfully.

ERROR_CARD_ID_DUPLICATED: There are multiple cards are assigned the same Card ID, please

check the settings of on-board Dip-Switch.

ERROR_NO_CARD_FOUND: There is no active card available in your system.

Line: No.0, No1

Fig2. When you install a PISO-MN200 board and parameter pNumLine will be 2.

Page 10: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

10

PISO-MN200 Function Reference V1.0

2.1.2 mn200_get_lineinfo

VC6 / BCB6

short mn200_get_lineinfo( BYTE bScannedIndex, BYTE* pLineNo )

C#

Int16 mn200_get_lineinfo( Byte ScannedIndex, ref Byte pLineNo )

Description:

This function returns the line number based on the scanned Card ID index. The parameter

“pLineNo” stores the first of two line numbers in specified card (PISO-MN200 provides two lines,

pLineNo plus one is the other line number)

Parameters:

bScannedIndex: The index value of PISO-MN200 Card ID which an operating system scaned. Index

value starts from 0 and less than the number of cards you can use in an operating

system.

pLineNo: The pointer to the memory stores the first of two communication line numbers in

PISO-MN200.

Return Code:

SUCCESS: The function returns successfully.

ERROR_NO_CARD_FOUND: There is no active card available in your system.

ERROR_SET_SCAN_INDEX_OUT_RANGE: The scannedIndex is not less than the number of

active PISO-MN200 cards

Card ID:0

Line: No.0, No.1

Card ID:15

Line: No.4, No.5

Fig3. If your system is installed three PISO-MN200 cards, the parameter bScannedIndex

setted 0 means the minimum Card ID(0) card is selected, and the parameter pLineNo

returns 0. Another example is the parameter bScannedIndex setted 2, then the third Card

ID(15) card is selected, and the parameter pLineNo returns 4.

Card ID:1

Line: No.2, No.3

Page 11: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

11

PISO-MN200 Function Reference V1.0

2.1.3 mn200_get_cardinfo

VC6 / BCB6

short mn200_get_cardinfo( BYTE bScannedIndex, BYTE* pCardID )

C#

Int16 mn200_get_cardinfo( Byte ScannedIndex, ref Byte pCardID )

Description:

This function returns the Card ID based on the scanned Card ID index. This routine will get the

Card ID configured with on-board Dip-Switch.

Parameters:

bScannedIndex: The index value of PISO-MN200 Card ID which an operating system scaned. Index

value starts from 0 and less than the number of cards you can use in an operating

system.

pCardID: The pointer to the memory stores the specific Card ID.

Return Code:

SUCCESS: The function returns successfully.

ERROR_NO_CARD_FOUND: There is no active card available in your system.

ERROR_SET_SCAN_INDEX_OUT_RANGE: The pointer to the memory stores the number of first of

two communication lines in PISO-MN200.

Card ID:0

Line: No.0, No.1

Card ID:15

Line: No.4, No.5

Fig4. If your system is installed three PISO-MN200 cards, the parameter bScannedIndex

setted 0 means the minimum Card ID(0) card is selected, and the parameter pCardID

returns 0. Another example is the parameter bScannedIndex setted 2, then the third Card

ID(15) card is selected, and the parameter pCardID returns 15.

Card ID:1

Line: No.2, No.3

Page 12: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

12

PISO-MN200 Function Reference V1.0

2.1.4 mn_close_all

VC6 / BCB6

short mn_close_all()

C#

Int16 mn_close_all()

Description:

This function closes the HANDLEs of all Motionnet cards in your process. After calling this

function, the Motionnet cards will be released, and other process can operate them.

Return Code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

Page 13: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

13

PISO-MN200 Function Reference V1.0

2.1.5 mn_reset

VC6 / BCB6

short mn_reset( BYTE bLineNo )

C#

Int16 mn_reset( Byte bLineNo )

Description:

This function re-sets the internal Motionnet ASIC and re-configures the basic registers with

default value. After calling this function, all configurations which had been set will be ignored.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

Return Code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

Page 14: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

14

PISO-MN200 Function Reference V1.0

2.1.6 mn_set_comm_speed

VC6 / BCB6

short mn_set_comm_speed( BYTE bLineNo, BYTE bCommSpeed )

C#

Int16 mn_set_comm_speed( Byte bLineNo, Byte bCommSpeed )

Description:

This function configures the Motionnet communication speed.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bCommSpeed:The communication speed can be set as COMMSPEED_2_5M, COMMSPEED_5M,

COMMSPEED_10M and COMMSPEED_20M.

Return Code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_INVALID_COMM_SPEED:The value of communication speed (bCommSpeed) is invalid.

Page 15: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

15

PISO-MN200 Function Reference V1.0

2.1.7 mn_start_line

VC6 / BCB6

short mn_start_line( BYTE bLineNo, BYTE* pNumDev )

C#

Int16 mn_start_line( Byte bLineNo, ref Byte pNumDev )

Description:

This function starts Motionnet communication, and it returns the number of devices which are

active on the communication line.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

pNumDev:The pointer to the memory stores the number of devices which are active on the

communication line.

Return Code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

Page 16: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

16

PISO-MN200 Function Reference V1.0

2.1.7 mn_stop_line

VC6 / BCB6

short mn_stop_line( BYTE bLineNo )

C#

Int16 mn_stop_line( Byte bLineNo )

Description:

This function stops the Motionnet communication.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

Return Code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_COMM_NOT_STOP:The Motionnet communication can’t be stopped.

Page 17: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

17

PISO-MN200 Function Reference V1.0

2.2 Hardware Configuration

After the driver is loaded, PISO-MN200 connects with MN-SERVO series motor controllers to start

Motionnet communication. Hardware configuration could be set / got with functions in this section.

Motion relative settings such as the polarity of output-pulse, input-encoder, and hardware-limit sensors

could be changed.

2.2.1 mn_set_motion_cfg

VC6 / BCB6

short mn_set_motion_cfg( BYTE bLineNo, BYTE bDevNo, MotionConfig CfgItem, DWORD

dwData )

C#

Int16 mn_set_motion_cfg( Byte bLineNo, Byte bDevNo, MotionConfig CfgItem, UInt32

dwData )

Description:

This function is used to configure the parameter of MN-SERVO series device.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

CfgItem:The MotionConfig enumerated type is used to select parameter setting.

Label Value Describe

OUTPLS_MODE 0 Specify output pulse mode.

EL_PROC 3 Specify the process to occur when the

EL input is turned ON.

SD_ENA 31 Enable/Disable the function of SD input.

SD_PROC 4 Specify the process to occur when the

SD input is turned ON.

SDLTC_ENA 5 Enable/Disable the latche function of SD

input.

SD_LOGIC 6 Specify the SD signal input logic.

ORG_LOGIC 7 Specify the ORG signal input logic.

Page 18: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

18

PISO-MN200 Function Reference V1.0

ALM_PROC 8 Specify the process to occur when the

ALM input is turned ON.

ALM_LOGIC 9 Specify the ALM signal input logic.

ERC_ERR_PROC 10 When an error occurs, enable / disable

ERC signal output automatically.

ERC_ORG_PROC 11 When the axis completes an origin

return, enable / disthe ERC signal output

automatically.

ERC_LEN 12 Specify the pulse width of the ERC

output signal.

ERC_LOGIC 15 Specify the ERC signal output logic.

MANUAL_SD_ENA 16 Enable/Disable the manual ramping

down point for high speed operation.

TRIANGLE_DRV_ELIMINATE_ENA 17 Enable/Disable the function of manual

triangle prevention driving.

INP_ENA 18 Enable/Disable the function of INP signal

input.

INP_LOGIC 19 Specify the INP signal input logic.

RESET_OUTPLS

_AFTER_ORG_ENA

20 Enable/Disable the function that reset

pulse counter after origin signal was

triggered.

RESET_ENC_AFTER_ORG_ENA 21 Enable/Disable the function that reset

encoder counter after origin signal was

triggered.

RESET_CNT3_AFTER_ORG_ENA 22 Enable/Disable the function that reset

counter 3 after origin signal was

triggered.

ENC_MODE 23 Specify the EA/EB input mode.

ENC_REV_ENA 25 Enable/Disable reverse encoder input

value.

ENC_Z_LOGIC 26 Specify the EZ signal input logic.

OUTPLS _REV_ENA 27 Enable/Disable reverse pulse output

value.

CNT3_MODE 28 Set counter 3 mode.

ALL_DATA 32 Set all parameters.

Page 19: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

19

PISO-MN200 Function Reference V1.0

dwData: According to parameter CfgItem selection, and gives the corresponding configuration data.

CfgItem = OUTPLS_TYPE

Label Value Describe

PULSE_MODE_PULSE_LOGIC_LO

W_DIR_FORWARD_HIGH

0

PULSE_MODE_PULSE_LOGIC_HIG

H_DIR_FORWARD_HIGH

1

PULSE_MODE_PULSE_LOGIC_LO

W_DIR_FORWARD_LOW

2

PULSE_MODE_PULSE_LOGIC_HIG

H_DIR_FORWARD_LOW

3

PULSE_MODE_CW_LOGIC_LOW 4

PULSE_MODE_CW_LOGIC_HIGH 7

PULSE_MODE_A_LEAD_B 5

PULSE_MODE_A_LAG_B 6

+direction -direction

OUT

DIR

+direction -direction

OUT

DIR

+direction -direction

OUT

DIR Low

Low

+direction -direction

OUT

DIR High

High

+direction -direction

OUT

DIR High Low

+direction -direction

OUT

DIR High Low

+direction -direction

OUT

DIR High Low

+direction -direction

OUT

DIR High Low

Page 20: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

20

PISO-MN200 Function Reference V1.0

CfgItem = EL_PROC / ALM_PROC

Label Value Describe

SUDDEN_STOP 0 Immediately stop( default).

SLOWDOWN_STOP 1 Decelerates to start speed and stop.

CfgItem = SD_ENA / SDLTC_ENA / ERC_ERR_ENA / ERC_ORG_ENA /

MANUAL_SD_ENA / MANUAL_TRI_DRV_ELIMINATE_ENA / INP_ENA /

RESET_OUTPLS_AFTER_ORG_ENA / RESET_ENC_AFTER_ORG_ENA /

RESET_CNT3_AFTER_ORG_ENA / ENC_REV_ENA OUTPLS_REV_ENA

Label Value Describe

DISABLE_FEATURE 0 Disable this function(default).

ENABLE_FEATURE 1 Enable this function.

CfgItem = SD_PROC

Label Value Describe

SLOWDOWN 0 Decelerate to start speed (default).

SLOWDOWN_STOP 1 Decelerate to start speed and stop.

CfgItem = SD_LOGIC / ORG_LOGIC / ALM_LOGIC / ERC_LOGIC / INP_LOGIC /

ENC_Z_LOGIC

Label Value Describe

LOGIC_ACTIVE_LOW 0 Set logic active low (default).

LOGIC_ACTIVE_HIGH 1 Set logic active high.

CfgItem = ERC_LEN

Label Value Describe

ERC_LEN_12us 0 ERC signal pulse width is 12μs.

ERC_LEN_93us 1 ERC signal pulse width is 93μs.

ERC_LEN_371us 2 ERC signal pulse width is 371μs.

ERC_LEN_1500us 3 ERC signal pulse width is 1.5ms.

ERC_LEN_12ms 4 ERC signal pulse width is 12ms.

ERC_LEN_48ms 5 ERC signal pulse width is 48ms.

ERC_LEN_95ms 6 ERC signal pulse width is 95ms.

ERC_LEN_LEVEL_OUTPUT 7 ERC signal is level output.

Page 21: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

21

PISO-MN200 Function Reference V1.0

CfgItem= ENC_MODE

Label Value Describe

ENCODER_MODE_AB 0

ENCODER_MODE_AB_MULT_2 1

ENCODER_MODE_AB_ MULT _4 2

ENCODER_MODE_CW_CCW 3

CfgItem = CNT3_MODE

Label Value Describe

0 Output pulse value

1 Encoder input value.

2 Manual pulse generator input value.

3 Timer(1/4096 division clock of

40MHz.).

4 The difference value between output

pulse and encoder input.

5 The difference value between output

pulse and manual pulse generator

input.

6 The difference value between

encoder input and manual pulse

generator input.

+direction -direction

A

B

A

B

X4

A

B

X2

A

B

X1

Page 22: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

22

PISO-MN200 Function Reference V1.0

CfgItem = ALL_DATA

The data type of parameter dwData is DWORD,and all items can be set by 32 Bits at

same time.

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16

Bits Bit name Description

0 to 2 PLS MODE Set output pulse mode : 0~7(000~111)

3 EL PROC Specify the process to occur when the EL input is

turned ON : 0/1

4 SD PROC Specify the process to occur when the SD input is

turned ON : 0/1

5 SDLTC ENA Enable/Disable the latched function of SD : 0/1

6 SD LOGIC Specify the SD signal input logic : 0/1

7 ORG LOGIC Specify the ORG signal input logic : 0/1

8 ALM PROC Specify the process to occur when the ALM input is

turned ON : 0/1

9 ALM LOGIC Specify the ALM signal input logic : 0/1

10 ERC ERR When an error occurs, enable / disable ERC signal

output : 0/1

11 ERC ORG When orgin signal was triggered, enable / disable

ERC signal output : 0/1

12 to 14 ERC LEN Set length of ERC output signal : 0~7(000~111)

15 ERC LOGIC Specify the ERC signal input logic : 0/1

16 MANUAL SD ENA Enable/Disable the function of manual deceleration

point : 0/1

17 MANUAL TR ENA Enable/Disable the function of manual triangle

prevention driving : 0/1

18 INP ENA Enable/Disable the function of INP signal input : 0/1

19 INP LOGIC Specify the INP signal input logic : 0/1

20 RESET PLS Enable/Disable the function that reset pulse

counter after Original point signal was triggered :

0/1

21 RESET ENC Enable/Disable the function that reset encoder

counter after Original point signal was triggered :

0/1

22 RESET CNT3 Enable/Disable the function that reset counter 3

EL PROC

SD ENA

PLS MODE

SD PROC

SDLTC ENA

SD LOGIC

ORG LOGIC

ALM PROC

ALM LOGIC

ERC ERR

ERC ORG

ERC LEN

ERC LOGIC

MANUAL SD ENA

MANUAL TR ENA

INP ENA

INP LOGIC

RESET PLS

RESET ENC

RESET CNT3

ENC MODE

ENC REV

Z LOGIC

PLS REV

CNT3 MODE

Page 23: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

23

PISO-MN200 Function Reference V1.0

Return Code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

ERROR_INVALID_CONFIG_ITEM:The value of the parameter CfgItem does not belong to

MotionConfig enumeration.

after Original point signal was triggered : 0/1

23 to 24 ENC MODE Set encoder input mode : 0~3(00~11)

25 ENC REV Enable/Disable reverse encoder input value : 0/1

26 Z LOGIC Specify the EZ signal input logic : 0/1

27 PLS REV Enable/Disable reverse pulse output value : 0/1

28 to 30 CNT3 MODE Set counter 3 mode : 0~6(000~110)

31 SD ENA Enable/Disable the function of SD : 0/1

Page 24: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

24

PISO-MN200 Function Reference V1.0

2.2.2 mn_get_motion_cfg

VC6 / BCB6

short mn_get_motion_cfg( BYTE bLineNo, BYTE bDevNo, MotionConfig CfgItem, DWORD

pData )

C#

Int16 mn_get_motion_cfg( Byte bLineNo, Byte bDevNo, MotionConfig CfgItem, ref UInt32

pData )

Description:

This function is used to read configuration of MN-SERVO series device.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

CfgItem:The MotionConfig enumerated type is used to select parameter setting.The same as the

form of parameter CfgItem listed in section 2.2.1.

pData:According to parameter CfgItem selection, and reads the corresponding configuration data.

The same as the form of parameter dwData listed in section 2.2.1.

Return Code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

ERROR_INVALID_CONFIG_ITEM:The value of the parameter CfgItem does not belong to

MotionConfig enumeration.

Page 25: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

25

PISO-MN200 Function Reference V1.0

2.3 Hardware Configuration (optional)

The functions in this chapter enable/disable the additional signals, including servo excitation, ALARM

signal rest and ERC signal output. The signal-filtering feature is built in Motion-Control ASIC, and can

be configured with mn_set_filter(). MN-SERVO series module also provides the software-limit feature,

and is enabled/configured with mn_set_softlimit(). Another helpful function, mn_load_ezgo_cfg(),

configures all motion modules with the pre-defined configuration file, MN_Config.ini that was edited

through utility PCEzGo.

2.3.1 mn_set_filter

VC6 / BCB6

short mn_set_filter( BYTE bLineNo, BYTE bDevNo, BYTE bFilterSelection, BYTE

bFilterEnable )

C#

Int16 mn_get_motion_cfg( Byte bLineNo, Byte bDevNo, Byte bFilterSelection, Byte

bFilterEnable )

Description:

This function enables / disables the signal filter in MN-SERVO series device and configures the

signal-sources. The filtering feature is enabled by default.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

bFilterSelection:Can be one of the following signal-sources:

FILTER_DATA_ENCODER (Filter encoder Z signal, Delay time: 150ns),

FILTER_DATA_EMG_EL_SD_ORG_ALM_INP (Filter EMG, EL, SD, ORG, ALARM and

INP signals, Delay time: 4μs)

bFilterEnable:ENABLE_FEATURE or DISABLE_FEATURE.

Return Code:

SUCCESS:The function returns successfully.

Page 26: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

26

PISO-MN200 Function Reference V1.0

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

ERROR_INVALID_FILTER_ITEM:The value of the parameter bFilterSelection is neither

FILTER_DATA_ENCODER nor FILTER_DATA_EMG_EL_SD_ORG_ALM_INP.

ERROR_SET_DATA:The value of the parameter bFilterEnable is neither ENABLE_FEATURE nor

DISABLE_FEATURE.

Page 27: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

27

PISO-MN200 Function Reference V1.0

2.3.2 mn_set_softlimit

VC6 / BCB6

short mn_set_softlimit( BYTE bLineNo, BYTE bDevNo, BYTE bSWLimitEnable, BYTE

bCmpSource, BYTE bStopMode, long LimitPositive, long LimitNegaitive )

C#

Int16 mn_set_softlimit( Byte bLineNo, Byte bDevNo, Byte bSWLimitEnable, Byte bCmpSource,

Byte bStopMode, Int32 LimitPositive, Int32 LimitNegaitive )

Description:

To keep monitoring the input pulse counter or encoder input counter, if the counter value exceed

specified value, the motor control chip will (decelerative) stop motion immediately. This feature is

active until calling mn_set_softlimit() with DISABLE_FEATURE.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

bSWLimitEnable:ENABLE_FEATURE or DISABLE_FEATURE.

bCmpSource:PULSE_COMMAND or ENCODER_POSITION.

bStopMode:Software limit stop mode.

SLOWDOWN_STOP — slowdown and stop

SUDDEN_STOP — immediately stop

LimitPositive:The pre-defined value for the comparator in forward direction

LimitNegaitive:The pre-defined value for the comparator in reverse direction

Return Code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

Page 28: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

28

PISO-MN200 Function Reference V1.0

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

ERROR_SET_DATA:The value of the parameter bSWLimitEnable is neither ENABLE_FEATURE

nor DISABLE_FEATURE.

ERROR_INVALID_SOFTWARE_LIMIT_SOURCE:The value of the parameter bCmpSource is

neither PULSE_COMMAND nor ENCODER_POSITION.

ERROR_INVALID_STOP_MODE:The value of the parameter bStopMode is neither

SLOWDOWN_STOP nor SUDDEN_STOP.

ERROR_CONFLICT_WITH_VRING:The ASIC internal comparator is currently planning for the

variable-ring counter, it can not be set for software limit using. Please call mn_set_vring ()

to disable the variable-ring counter setting.

Page 29: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

29

PISO-MN200 Function Reference V1.0

2.3.3 mn_servo_on

VC6 / BCB6

short mn_servo_on( BYTE bLineNo, BYTE bDevNo, BYTE bServoOn )

C#

Int16 mn_servo_on( Byte bLineNo, Byte bDevNo, Byte bServoOn )

Description:

This function turns on / off the servo.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

bServoON: TURN_ON or TURN_OFF.

Return Code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

ERROR_SET_DATA:The value of the parameter bServoON is neither TURN_ON nor TURN_OFF.

Page 30: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

30

PISO-MN200 Function Reference V1.0

2.3.4 mn_set_erc

VC6 / BCB6

short mn_set_erc( BYTE bLineNo, BYTE bDevNo, BYTE bErcOn )

C#

Int16 mn_set_erc( Byte bLineNo, Byte bDevNo, Byte bErcOn )

Description:

The ERC signal is used to clear the deviation counter of the servomotor driver. The relative

configurations such as pulse width, polarity and ERC output automatically refer to 2.2.1

mn_set_motion_cfg () function description.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

bErcON: TURN_ON or TURN_OFF.

Return Code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

ERROR_SET_DATA:The value of the parameter bServoON is neither TURN_ON nor TURN_OFF.

Page 31: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

31

PISO-MN200 Function Reference V1.0

2.3.5 mn_alarm_reset

VC6 / BCB6

short mn_alarm_reset( BYTE bLineNo, BYTE bDevNo, BYTE bAlmRstOn )

C#

Int16 mn_alarm_reset( Byte bLineNo, Byte bDevNo, Byte bAlmRstOn )

Description:

This function is used to turn on/off the motor server reset ALARM signal.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

bAlmRstOn:TURN_ON or TURN_OFF.

Return Code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

ERROR_SET_DATA:The value of the parameter bAlmRstON is neither TURN_ON nor TURN_OFF.

Page 32: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

32

PISO-MN200 Function Reference V1.0

2.3.6 mn_load_ezgo_cfg

VC6 / BCB6

short mn_load_ezgo_cfg( BYTE bLineNo, char* FileName )

C#

Int16 mn_load_ezgo_cfg( Byte bLineNo, string FileName )

Description:

This function loads the pre-defined configuration file and configures all active MN-SERVO

devices automatically. The mn_open_all() and mn_start_line() are needed to be called before this

function. It’s strongly recommended to change the settings of configuration file with the utility,

PCEzGO.exe. Please DO NOT modify the configuration file manually.

The following functions actually are used for motion module settings:

mn_set_motion_cfg(), mn_set_filter(), mn_set_softlimit().

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

FileName:The pointer to the memory stores the pathname of configuration file. Without assigning

pathname, the default configuration file, $windir/system32/MN_Config.ini, will be loaded.

This parameter is optional, and NULL is assigned by default.

Return Code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_CONFIG_FILE_LOAD:The configuration file cannot be found.

ERROR_CONFIG_FILE_MATCH:Motion module settings recorded in the configuration file do not

match with the real condition (number of modules or modules’ ID) in the specified

communication line by parameter bLineNo.

Page 33: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

33

PISO-MN200 Function Reference V1.0

CHAPTER 3

Automatic Home Search

With the external slowdown point (SD), origin (ORG) and encoder Z phase (EZ) sensors; the

auto-homing feature provided by Motion-Control ASIC will help to search the Home (ORG)

automatically.

3.1 mn_home_start

VC6 / BCB6

short mn_home_start( BYTE bLineNo, BYTE bDevNo, SPEED_PAR SpeedPar, BYTE

bDirection, BYTE bHomeMode, BYTE bEZcount )

C#

Int16 mn_home_start( Byte bLineNo, Byte bDevNo, SPEED_PAR SpeedPar, Byte bDirection,

Byte bHomeMode, Byte bEZcount )

Description:

This function starts Automatic-Home-Search with the SPEED_PAR structure, the direction and

the homing mode.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

Page 34: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

34

PISO-MN200 Function Reference V1.0

SpeedPar:This parameter is a SPEED_PAR structure, it’s used to define the motion speed profile,

and the structure members are as follows:

bDirection:MOVE_DIRECTION_FORWARD or MOVE_DIRECTION_REVERSE.

Member Describe

Start_Speed The initial speed and stopping speed (PPS)

Drive_Speed Moving speed (PPS)

Correction_Speed It’s the leaving speed (PPS) used in automatic home search

mode 1,4,6,7.

AccDec_Mode

Acc and Dec input units: ADC_MODE_RATE (acceleration and

deceleration rate : PPS / Sec)

or ADC_MODE_TIME (acceleration and deceleration time : Sec)

Acc Acceleration rate (PPS / S) or acceleration time (Sec)

Dec Deceleration rate (PPS / S) or deceleration time (Sec)

SCurve_Enable ENABLE_FEATURE (S curve speed profile) or

DISABLE_FEATURE (trapezoidal curve speed profile)

SCurveAcc_Sect

Specify the S-curve range in S-curve acceleration range:

0 (The ASIC will operate with nearly linear acceleration) ~

(Drive_Speed-Start_Speed) / 2 (The operation will be an S-curve

acceration without a linear component.

SCurveDec_Sect

Specify the S-curve range in S-curve deceleration range:

0 (The ASIC will operate with nearly linear deceleration) ~

(Drive_Speed-Start_Speed) / 2 (The operation will be an S-curve

deceleration without a linear component.

Max_Speed The MaxSpeed enumerated type is used to select the maximum

speed and corresponding resolution.

Page 35: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

35

PISO-MN200 Function Reference V1.0

bHomeMode:Homing mode, you can set mode as 0 to 12.

Mode 0

Use signal Origin(ORG),Limit(EL)

Use signal Slowdown(SD),Origin(ORG),Limit(EL)

Mode 1

Use signal Origin(ORG),Limit(EL)

ORG

EL Operation1

Operation2

Operation3

ON

ON

OFF

OFF

* Correction Speed

SD

ORG

EL Operation1

Operation2

Operation3

Operation4

ON

ON

OFF

OFF

OFF ON

ORG

EL Operation1

Operation2

Operation3

ON

ON

OFF

OFF

Page 36: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

36

PISO-MN200 Function Reference V1.0

Mode 2

Use signal Origin(ORG),Limit(EL) ,Encoder Z phase(EZ),set bEZcount=1

Mode 3

Use signal Origin(ORG),Limit(EL) ,Encoder Z phase(EZ),set bEZcount=1

ORG

EL

EZ Operation1

Operation2

Operation3

ON

ON

OFF

OFF

EZ Count: No.0 No.1

ORG

EL

EZ Operation1

Operation2

Operation3

ON

ON

OFF

OFF

EZ Count: No.0 No.1

Page 37: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

37

PISO-MN200 Function Reference V1.0

Mode 4

Use signal Origin(ORG),Limit(EL) ,Encoder Z phase(EZ),set bEZcount=1

Mode 5

Use signal Origin(ORG),Limit(EL),Encoder Z phase(EZ),set bEZcount=1

Mode 6

Use signal Limit(EL)

EL Operation1

ON OFF

* Correction Speed

(Stop when EL = OFF)

ORG

EL

EZ Operation1

Operation2

Operation3

ON

ON

OFF

OFF

EZ Count: No.1 No.0

ORG

EL

EZ Operation1

Operation2

Operation3

ON

ON

OFF

OFF

EZ Count: No.1 No.0

* Correction Speed

Page 38: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

38

PISO-MN200 Function Reference V1.0

Mode 7

Use signal Limit(EL) ,Encoder Z phase(EZ),set bEZcount=1

Mode 8

Use signal Limit(EL),Encoder Z phase(EZ),set bEZcount=1

Mode 9

Use signal Origin(ORG),Limit(EL)

ORG

EL Operation1

Operation2

Operation3

ON

ON

OFF

OFF

EL

EZ Operation1

ON OFF

EZ Count: No.1 No.0

EL

EZ Operation1

ON OFF

EZ Count: No.1 No.0

* Correction Speed

Page 39: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

39

PISO-MN200 Function Reference V1.0

Mode 10

Use signal Origin(ORG),Limit(EL),Encoder Z phase(EZ),set bEZcount=1

Mode 11

Use signal Origin(ORG),Limit(EL),Encoder Z phase(EZ),set bEZcount=1

Mode 12

Use signal Limit(EL),Encoder Z phase(EZ),set bEZcount=1

EL

EZ Operation1

ON OFF

EZ Count: No.1 No.0

ORG

EL

EZ Operation1

Operation2

Operation3

ON

ON

OFF

OFF

EZ Count: No.1 No.0

ORG

EL

EZ Operation1

Operation2

Operation3

ON

ON

OFF

OFF

EZ Count: No.0 No.1

Page 40: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

40

PISO-MN200 Function Reference V1.0

〔Note〕

Position marked with “@ “reflects the automatic ERC signal output timing.

This feature can be enabled or disabled by setting ERC_ORG_ENA with

mn_set_motion_cfg().

Position marked with “ “reflects the automatic counter reset timing.

This feature can be enabled or disabled by setting

RESET_OUTPLS_AFTER_ORG_ENA or

RESET_ENC_AFTER_ORG_ENA with mn_set_motion_cfg().

When the EL_PROC is set SUDDEN_STOP with mn_set_motion_cfg().

Position marked with “#“ reflects the automatic ERC signal output timing.

This feature can be enabled or disabled by setting ERC_ERR_ENA with

mn_set_motion_cfg().

bEZcount:Specify the number for encoder Z count that will indicate an origin return complete

condition (default: 0). When bHomeMode is 2,3,4,5,7,8,10,11,12, it is necessary to set

this parameter that setting range is 0 ~ 15 (No.0 ~ No.15).

Return Code:

SUCCESS:The function returns successfully.

ERROR_INVALID_MOVE_DIRECTION:The value of the parameter bDirection is neither

MOVE_DIRECTION_FORWARD nor MOVE_DIRECTION_REVERSE.

ERROR_INVALID_HOME_MODE:The value of the parameter bHomeMode is out of range (0~12).

ERROR_INVALID_EZ_COUNT:The value of the parameter bEZcount is out of range (0~15).

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

ERROR_MOVE_HOLD:Indicates the device had been hold, please call mn_group_start_move () to

release the hold-axis first.

ERROR_WAIT_ERC:Indicates the device is waiting for a completion of ERC timer.

Page 41: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

41

PISO-MN200 Function Reference V1.0

ERROR_WAIT_BACKLASH_CORRECT:Indicates the device is waiting for a completion of backlash

compensation.

ERROR_WAIT_INP:Indicates the device is waiting INP signal input.

ERROR_EMG_SIGNAL_ON:The specified device EMG signal is triggered.

ERROR_ALM_SIGNAL_ON:The specified device ALARM signal is triggered.

ERROR_MEL_SIGNAL_ON:The specified device minus limit signal is triggered.

ERROR_PEL_SIGNAL_ON:The specified device positive limit signal is triggered.

ERROR_REGISTER_FULL:The specified device continuous motion registers have been used.

ERROR_START_SPEED_EXCEED_DRIVING_SPEED:Start_Speed set in structure SpeedPar is

bigger than Drive_Speed speed value.

ERROR_INVALID_MAX_SPEED_SELECTION:Max_Speed set in structure SpeedPar does not

belong with MaxSpeed enumeration.

ERROR_SET_START_SPEED_OUT_RANGE:Start_Speed set in structure SpeedPar exceeds the

range of MaxSpeed.

ERROR_SET_DRIVING_SPEED_OUT_RANGE:Drive_Speed set in structure SpeedPar exceeds

the range of MaxSpeed.

ERROR_INVALID_SCURVE_ENABLE:SCurve_Enable set in structure SpeedPar is neither

DISABLE_FEATURE nor ENABLE_FEATURE.

ERROR_SET_CORRECTION_SPD_OUT_RANGE:Correction_Speed set in structure SpeedPar

exceeds the range of MaxSpeed selection.

ERROR_INVALID_ACC_DATA:Acc set in structure SpeedPar is 0.

ERROR_INVALID_ADC_MODE:AccDec_Mode set in structure SpeedPar is neither

ADC_MODE_RATE nor ADC_MODE_TIME.

ERROR_SET_ACC_DOUBLE_DEC:Acceleration set in structure SpeedPar is twice bigger than

Deceleration.

ERROR_SET_ACC_OUT_RANGE:Acceleration set in structure SpeedPar exceeds the range of

MaxSpeed selection.

ERROR_SET_DEC_OUT_RANGE:Deceleration set in structure SpeedPar exceeds the range of

MaxSpeed selection.

ERROR_SET_ACC_SECT_OUT_RANGE:SCurveAcc_Sect set in structure SpeedPar isn’t

between 0 ~ (Drive_Speed-Start_Speed) / 2.

ERROR_SET_DEC_SECT_OUT_RANGE:SCurveDec_Sect set in structure SpeedPar isn’t

between 0 ~ (Drive_Speed-Start_Speed) / 2 .

Page 42: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

42

PISO-MN200 Function Reference V1.0

CHAPTER 4

Independent Moving Functions

These functions in this chapter start the independent motion, including velocity-move and a fixed pulse

acceleration and deceleration motion (fix-move).

4.1 mn_velocity_move

VC6 / BCB6

short mn_velocity_move( BYTE bLineNo, BYTE bDevNo, SPEED_PAR SpeedPar, BYTE

bDirection )

C#

Int16 mn_velocity_move( Byte bLineNo, Byte bDevNo, SPEED_PAR SpeedPar, Byte

bDirection )

Description:

This function starts velocity-move with SPEED_PAR structure and direction. The pulses

will be outputed continuously untill calling mn_stop_move().

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

SpeedPar:This parameter is a SPEED_PAR structure, it’s used to define the motion speed profile,

and the structure members are as follows:

Member Describe

Start_Speed The initial speed and stopping speed (PPS)

Drive_Speed Moving speed (PPS)

Page 43: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

43

PISO-MN200 Function Reference V1.0

bDirection:MOVE_DIRECTION_FORWARD or MOVE_DIRECTION_REVERSE

Return Code:

SUCCESS:The function returns successfully.

ERROR_INVALID_MOVE_DIRECTION:The value of the parameter bDirection is neither

MOVE_DIRECTION_FORWARD nor MOVE_DIRECTION_REVERSE.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

ERROR_MOVE_HOLD:Indicates the device had been hold, please call mn_group_start_move () to

release the hold-axis first.

ERROR_WAIT_ERC:Indicates the device is waiting for a completion of ERC timer.

Correction_Speed It’s the leaving speed (PPS) used in automatic home search

mode 1,4,6,7.

AccDec_Mode

Acc and Dec input units: ADC_MODE_RATE (acceleration and

deceleration rate : PPS / Sec)

or ADC_MODE_TIME (acceleration and deceleration time : Sec)

Acc Acceleration rate (PPS / S) or acceleration time (Sec)

Dec Deceleration rate (PPS / S) or deceleration time (Sec)

SCurve_Enable ENABLE_FEATURE (S curve speed profile) or

DISABLE_FEATURE (trapezoidal curve speed profile)

SCurveAcc_Sect

Specify the S-curve range in S-curve acceleration range:

0 (The ASIC will operate with nearly linear acceleration) ~

(Drive_Speed-Start_Speed) / 2 (The operation will be an S-curve

acceration without a linear component.

SCurveDec_Sect

Specify the S-curve range in S-curve deceleration range:

0 (The ASIC will operate with nearly linear deceleration) ~

(Drive_Speed-Start_Speed) / 2 (The operation will be an S-curve

deceleration without a linear component.

Max_Speed The MaxSpeed enumerated type is used to select the maximum

speed and corresponding resolution.

Page 44: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

44

PISO-MN200 Function Reference V1.0

ERROR_WAIT_BACKLASH_CORRECT:Indicates the device is waiting for a completion of backlash

compensation.

ERROR_WAIT_INP:Indicates the device is waiting INP signal input.

ERROR_EMG_SIGNAL_ON:The specified device EMG signal is triggered.

ERROR_ALM_SIGNAL_ON:The specified device ALARM signal is triggered.

ERROR_MEL_SIGNAL_ON:The specified device minus limit signal is triggered.

ERROR_PEL_SIGNAL_ON:The specified device positive limit signal is triggered.

ERROR_REGISTER_FULL:The specified device continuous motion registers have been used.

ERROR_START_SPEED_EXCEED_DRIVING_SPEED:Start_Speed set in structure SpeedPar is

bigger than Drive_Speed speed value.

ERROR_INVALID_MAX_SPEED_SELECTION:Max_Speed set in structure SpeedPar does not

belong with MaxSpeed enumeration.

ERROR_SET_START_SPEED_OUT_RANGE:Start_Speed set in structure SpeedPar exceeds the

range of MaxSpeed.

ERROR_SET_DRIVING_SPEED_OUT_RANGE:Drive_Speed set in structure SpeedPar exceeds

the range of MaxSpeed.

ERROR_INVALID_SCURVE_ENABLE:SCurve_Enable set in structure SpeedPar is neither

DISABLE_FEATURE nor ENABLE_FEATURE.

ERROR_SET_CORRECTION_SPD_OUT_RANGE:Correction_Speed set in structure SpeedPar

exceeds the range of MaxSpeed selection.

ERROR_INVALID_ACC_DATA:Acc set in structure SpeedPar is 0.

ERROR_INVALID_ADC_MODE:AccDec_Mode set in structure SpeedPar is neither

ADC_MODE_RATE nor ADC_MODE_TIME.

ERROR_SET_ACC_DOUBLE_DEC:Acceleration set in structure SpeedPar is twice bigger than

Deceleration.

ERROR_SET_ACC_OUT_RANGE:Acceleration set in structure SpeedPar exceeds the range of

MaxSpeed selection.

ERROR_SET_DEC_OUT_RANGE:Deceleration set in structure SpeedPar exceeds the range of

MaxSpeed selection.

ERROR_SET_ACC_SECT_OUT_RANGE:SCurveAcc_Sect set in structure SpeedPar isn’t

between 0 ~ (Drive_Speed-Start_Speed) / 2.

ERROR_SET_DEC_SECT_OUT_RANGE:SCurveDec_Sect set in structure SpeedPar isn’t

between 0 ~ (Drive_Speed-Start_Speed) / 2 .

Page 45: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

45

PISO-MN200 Function Reference V1.0

4.2 mn_fix_move

VC6 / BCB6

short mn_fix_move( BYTE bLineNo, BYTE bDevNo, SPEED_PAR SpeedPar, long Position,

BYTE bMoveType )

C#

Int16 mn_fix_move( Byte bLineNo, Byte bDevNo, SPEED_PAR SpeedPar, Int32 Position, Byte

bMoveType )

Description:

This function starts fixed-pulse motion with SPEED_PAR structure.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

SpeedPar:This parameter is a SPEED_PAR structure, it’s used to define the motion speed profile,

and the structure members are as follows:

Member Describe

Start_Speed The initial speed and stopping speed (PPS)

Drive_Speed Moving speed (PPS)

Correction_Speed It’s the leaving speed(PPS) used in automatic home search mode

1,4,6,7.

AccDec_Mode

Acc and Dec input units: ADC_MODE_RATE (acceleration and

deceleration rate : PPS / Sec)

or ADC_MODE_TIME (acceleration and deceleration time : Sec)

Acc Acceleration rate (PPS / S) or acceleration time (Sec)

Dec Deceleration rate (PPS / S) or deceleration time (Sec)

SCurve_Enable ENABLE_FEATURE (S curve speed profile) or

DISABLE_FEATURE (trapezoidal curve speed profile)

SCurveAcc_Sect

Under the area occupied by the S-curve acceleration range: 0 is

no S-curve linear velocity. ~ (Drive_Speed-Start_Speed) / 2 is

complete without the linear segment S curve.

SCurveDec_Sect Under the area occupied by the S-curve deceleration range: 0 is

no S-curve linear velocity. ~ (Drive_Speed-Start_Speed) / 2 is

Page 46: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

46

PISO-MN200 Function Reference V1.0

Position:The output pulse number of motor motion, this parameter is 32-bits long integer (long), less

than zero value represents the negative direction to move.

bMoveType:Fixed pulse output motion mode, you can choose a relative or absolute pulse output

mode.

Label Value Describe

FIX_MOVE_MODE_REL 0x41 Relative motion (default)

FIX_MOVE_MODE_ABS_BY_OUTPLS 0x42 Absolute motion in output pulse

counter

FIX_MOVE_MODE_ABS_BY_ENC 0x43 Absolute motion in encoder input

counter

FIX_MOVE_MODE_ZERO_RETURN_B

Y_OUTPLS

0x44 Zero return of pulse output

counter(parameter Position is

ignored)

FIX_MOVE_MODE_ZERO_RETURN_B

Y_ENC

0x45 Zero return of encoder input

counter(parameter Position is

ignored)

Return code:

SUCCESS:The function returns successfully.

ERROR_INVALID_POSITION:The parameter Position is not from -134217728 to134217727.

ERROR_INVALID_MOVE_DIRECTION:Parameter value is set to bMoveType does not belong to a

relative or absolute pulse output motion mode.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

ERROR_MOVE_HOLD:Indicates the device had been hold, please call mn_group_start_move () to

release the hold-axis first.

ERROR_WAIT_ERC:Indicates the device is waiting for a completion of ERC timer.

complete without the linear segment S curve.

Max_Speed Through MaxSpeed parameter enumeration, select the maximum

speed limit and allows the use of resolution

Page 47: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

47

PISO-MN200 Function Reference V1.0

ERROR_WAIT_BACKLASH_CORRECT:Indicates the device is waiting for a completion of backlash

compensation.

ERROR_WAIT_INP:Indicates the device is waiting INP signal input.

ERROR_EMG_SIGNAL_ON:The specified device EMG signal is triggered.

ERROR_ALM_SIGNAL_ON:The specified device ALARM signal is triggered.

ERROR_MEL_SIGNAL_ON:The specified device minus limit signal is triggered.

ERROR_PEL_SIGNAL_ON:The specified device positive limit signal is triggered.

ERROR_REGISTER_FULL:The specified device continuous motion registers have been used.

ERROR_START_SPEED_EXCEED_DRIVING_SPEED:Start_Speed set in structure SpeedPar is

bigger than Drive_Speed speed value.

ERROR_INVALID_MAX_SPEED_SELECTION:Max_Speed set in structure SpeedPar does not

belong with MaxSpeed enumeration.

ERROR_SET_START_SPEED_OUT_RANGE:Start_Speed set in structure SpeedPar exceeds the

range of MaxSpeed.

ERROR_SET_DRIVING_SPEED_OUT_RANGE:Drive_Speed set in structure SpeedPar exceeds

the range of MaxSpeed.

ERROR_INVALID_SCURVE_ENABLE:SCurve_Enable set in structure SpeedPar is neither

DISABLE_FEATURE nor ENABLE_FEATURE.

ERROR_SET_CORRECTION_SPD_OUT_RANGE:Correction_Speed set in structure SpeedPar

exceeds the range of MaxSpeed selection.

ERROR_INVALID_ACC_DATA:Acc set in structure SpeedPar is 0.

ERROR_INVALID_ADC_MODE:AccDec_Mode set in structure SpeedPar is neither

ADC_MODE_RATE nor ADC_MODE_TIME.

ERROR_SET_ACC_DOUBLE_DEC:Acceleration set in structure SpeedPar is twice bigger than

Deceleration.

ERROR_SET_ACC_OUT_RANGE:Acceleration set in structure SpeedPar exceeds the range of

MaxSpeed selection.

ERROR_SET_DEC_OUT_RANGE:Deceleration set in structure SpeedPar exceeds the range of

MaxSpeed selection.

ERROR_SET_ACC_SECT_OUT_RANGE:SCurveAcc_Sect set in structure SpeedPar isn’t

between 0 ~ (Drive_Speed-Start_Speed) / 2.

ERROR_SET_DEC_SECT_OUT_RANGE:SCurveDec_Sect set in structure SpeedPar isn’t

between 0 ~ (Drive_Speed-Start_Speed) / 2 .

Page 48: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

48

PISO-MN200 Function Reference V1.0

4.3 mn_stop_move

VC6 / BCB6

short mn_stop_move( BYTE bLineNo, BYTE bDevNo, BYTE bStopMode )

C#

Int16 mn_stop_move( Byte bLineNo, Byte bDevNo, Byte bStopMode )

Description:

This function stops current motion with slowdown or stop-sudden mode.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

bStopMode:SLOWDOWN_STOP or SUDDEN_STOP.

Return code:

SUCCESS:The function returns successfully.

ERROR_INVALID_STOP_MODE:The value of the parameter bStopMove is neither

SLOWDOWN_STOP nor SUDDEN_STOP.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

Page 49: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

49

PISO-MN200 Function Reference V1.0

CHAPTER 5

Interpolation Moving Functions

This chapter describes the 2D/3D and multi-axes linear interpolation motion and 2D circular

interpolation motion function.In order to ensure Motionnet serial communication control for multi-axis

synchronization. With the function mn_set_group(), all axes will be set as the same group number to

synchronize interpolation motion starting.

5.1 mn_set_group

VC6 / BCB6

short mn_set_group( BYTE bLineNo, BYTE bGrpNo, BYTE bNumDev, BYTE bDevNo[ ] )

C#

Int16 mn_set_group( Byte bLineNo, Byte bGrpNo, Byte bNumDev, Byte[ ] bDevNo )

Description:

This function is used to group motion control modules into the same group number to ensure

the synchronization of interpolation motion.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bGrpNo:Group number can be set from 1 to 7. The setting value 0 is set to cancel group number.

bNumDev:Set the number of motion control modules.

bDevNo[ ]:The pointer to the BYTE-Array that contains number of motion devices, and the array size

should be equal to parameter bNumDev.

Return code:

SUCCESS:The function returns successfully.

ERROR_INVALID_GROUPNO:The value of the parameter bGrpNo is not from to 0~7.

Page 50: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

50

PISO-MN200 Function Reference V1.0

ERROR_INVALID_NUM_DEV:The parameter bNumDev is out of range.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_GROUP_ALREADY_HOLD:Indicates the group number had been hold, please call

mn_group_start_move () to release the hold-group first.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

Page 51: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

51

PISO-MN200 Function Reference V1.0

5.2 mn_get_group

VC6 / BCB6

short mn_get_group( BYTE bLineNo, BYTE bGrpNo, BYTE* pNumDev, BYTE bDevNo[ ] )

C#

Int16 mn_get_group( Byte bLineNo, Byte bGrpNo, ref Byte pNumDev, Byte[ ] bDevNo )

Description:

This function is used to obtain the number of modules and each module number in the specified

group.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bGrpNo:Group number can be set from 1 to 7. The value 0 means no group setting.

pNumDev:The pointer to the memory stores the number of motion control modules in the specified

group.

bDevNo[ ]:The pointer to the memory stores each module number in the specified group. The array

size should be 64 to prevent the buffer overflow.

Return code:

SUCCESS:The function returns successfully.

ERROR_INVALID_GROUPNO:The value of the parameter bGrpNo does not belong to 0~7.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

Page 52: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

52

PISO-MN200 Function Reference V1.0

5.3 mn_line2_move

VC6 / BCB6

short mn_line2_move ( BYTE bLineNo, BYTE bDev1No, BYTE bDev2No, SPEED_PAR

SpeedPar, long Dev1Pos, long Dev2Pos, BYTE bCnstSpdEnable )

C#

Int16 mn_line2_move( Byte bLineNo, Byte bDev1No, Byte bDev2No, SPEED_PAR SpeedPar,

Int32 Dev1Pos, Int32 Dev2Pos, Byte bCnstSpdEnable )

Description:

This function starts 2-dimension linear interpolation motion with SPEED_PAR structure and

specified position.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDev1No:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

bDev2No:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

SpeedPar:This parameter is a SPEED_PAR structure, it’s used to define the motion speed profile,

and the structure members are as follows:

Member Describe

Start_Speed The initial speed and stopping speed (PPS)

Drive_Speed Moving speed (PPS)

Correction_Speed It’s the leaving speed(PPS) used in automatic home search mode

1,4,6,7.

AccDec_Mode

Acc and Dec input units: ADC_MODE_RATE (acceleration and

deceleration rate : PPS / Sec)

or ADC_MODE_TIME (acceleration and deceleration time : Sec)

Acc Acceleration rate (PPS / S) or acceleration time (Sec)

Dec Deceleration rate (PPS / S) or deceleration time (Sec)

SCurve_Enable ENABLE_FEATURE (S curve speed profile) or

DISABLE_FEATURE (trapezoidal curve speed profile)

SCurveAcc_Sect Under the area occupied by the S-curve acceleration range: 0 is

Page 53: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

53

PISO-MN200 Function Reference V1.0

Dev1Pos:The position of bDev1No is the relative offset to the current position, and the negative

value indicates the direction is reverse.

Dev2Pos:The position of bDev2No is the relative offset to the current position, and the negative

value indicates the direction is reverse.

bCnstSpdEnable:In 2-dimension linear interpolation, make the synthesized speed cnostant. It can

be set as ENABLE_FEATURE or DISABLE_FEATURE.

Return code:

SUCCESS:The function returns successfully.

ERROR_SET_DATA:The value of the parameter bCnstSpdEnable is neither ENABLE_FEATURE

nor DISABLE_FEATURE.

ERROR_INVALID_POSITION: The parameter Dev1Pos or Dev2Pos is not from -134217728

to134217727.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

ERROR_MOVE_HOLD:Indicates the device had been hold, please call mn_group_start_move () to

release the hold-axis first.

ERROR_WAIT_ERC:Indicates the device is waiting for a completion of ERC timer.

ERROR_WAIT_BACKLASH_CORRECT:Indicates the device is waiting for a completion of backlash

compensation.

ERROR_WAIT_INP:Indicates the device is waiting INP signal input.

ERROR_EMG_SIGNAL_ON:The specified device EMG signal is triggered.

ERROR_ALM_SIGNAL_ON:The specified device ALARM signal is triggered.

ERROR_MEL_SIGNAL_ON:The specified device minus limit signal is triggered.

no S-curve linear velocity. ~ (Drive_Speed-Start_Speed) / 2 is

complete without the linear segment S curve.

SCurveDec_Sect

Under the area occupied by the S-curve deceleration range: 0 is

no S-curve linear velocity. ~ (Drive_Speed-Start_Speed) / 2 is

complete without the linear segment S curve.

Max_Speed Through MaxSpeed parameter enumeration, select the maximum

speed limit and allows the use of resolution

Page 54: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

54

PISO-MN200 Function Reference V1.0

ERROR_PEL_SIGNAL_ON:The specified device positive limit signal is triggered.

ERROR_REGISTER_FULL:The specified device continuous motion registers have been used.

ERROR_START_SPEED_EXCEED_DRIVING_SPEED:Start_Speed set in structure SpeedPar is

bigger than Drive_Speed speed value.

ERROR_INVALID_MAX_SPEED_SELECTION:Max_Speed set in structure SpeedPar does not

belong with MaxSpeed enumeration.

ERROR_SET_START_SPEED_OUT_RANGE:Start_Speed set in structure SpeedPar exceeds the

range of MaxSpeed.

ERROR_SET_DRIVING_SPEED_OUT_RANGE:Drive_Speed set in structure SpeedPar exceeds

the range of MaxSpeed.

ERROR_INVALID_SCURVE_ENABLE:SCurve_Enable set in structure SpeedPar is neither

DISABLE_FEATURE nor ENABLE_FEATURE.

ERROR_SET_CORRECTION_SPD_OUT_RANGE:Correction_Speed set in structure SpeedPar

exceeds the range of MaxSpeed selection.

ERROR_INVALID_ACC_DATA:Acc set in structure SpeedPar is 0.

ERROR_INVALID_ADC_MODE:AccDec_Mode set in structure SpeedPar is neither

ADC_MODE_RATE nor ADC_MODE_TIME.

ERROR_SET_ACC_DOUBLE_DEC:Acceleration set in structure SpeedPar is twice bigger than

Deceleration.

ERROR_SET_ACC_OUT_RANGE:Acceleration set in structure SpeedPar exceeds the range of

MaxSpeed selection.

ERROR_SET_DEC_OUT_RANGE:Deceleration set in structure SpeedPar exceeds the range of

MaxSpeed selection.

ERROR_SET_ACC_SECT_OUT_RANGE:SCurveAcc_Sect set in structure SpeedPar isn’t

between 0 ~ (Drive_Speed-Start_Speed) / 2.

ERROR_SET_DEC_SECT_OUT_RANGE:SCurveDec_Sect set in structure SpeedPar isn’t

between 0 ~ (Drive_Speed-Start_Speed) / 2 .

Page 55: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

55

PISO-MN200 Function Reference V1.0

5.4 mn_arc2_move

VC6 / BCB6

short mn_arc2_move( BYTE bLineNo, BYTE bDev1No, BYTE bDev2No, SPEED_PAR

SpeedPar, BYTE bDirection, long Dev1CenterPos, long Dev2CenterPos, long Dev1FinishPos,

long Dev2FinishPos, DWORD Low32BitDummyDevNo, DWORD High32BitDummyDevNo,

BYTE bCnstSpdEnable )

C#

Int16 mn_arc2_move( Byte bLineNo, Byte bDev1No, Byte bDev2No, SPEED_PAR SpeedPar,

Byte bDirection, Int32 Dev1CenterPos, Int32 Dev2CenterPos, Int32 Dev1FinishPos, Int32

Dev2FinishPos, UInt32 Low32BitDummyDevNo, UInt32 High32BitDummyDevNo, Byte

bCnstSpdEnable )

Description:

This function starts the 2-dimension circular interpolation motion. The start-point will be the

origin of circular-interpolation motion. Dev1CenterPos and Dev2CenterPos are center coordinates

related to origin; Dev1FinishPos and Dev2FinishPos are finish coordinates related to Origin.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDev1No:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

bDev2No:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

SpeedPar:This parameter is a SPEED_PAR structure, it’s used to define the motion speed profile,

and the structure members are as follows:

Member Describe

Start_Speed The initial speed and stopping speed (PPS)

Drive_Speed Moving speed (PPS)

Correction_Speed It’s the leaving speed(PPS) used in automatic home search mode

1,4,6,7.

AccDec_Mode

Acc and Dec input units: ADC_MODE_RATE (acceleration and

deceleration rate : PPS / Sec)

or ADC_MODE_TIME (acceleration and deceleration time : Sec)

Page 56: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

56

PISO-MN200 Function Reference V1.0

bDirection:clockwise (MOVE_DIRECTION_CW) or counterclockwise (MOVE_DIRECTION_CCW).

Dev1CenterPos:The center position of bDev1No is the relative offset to the current position. And the

negative value indicates that the center position is in reverse-direction.

Dev2CenterPos:The center position of bDev2No is the relative offset to the current position. And the

negative value indicates that the center position is in reverse-direction.

Dev1FinishPos:The finish position of bDev1No is the relative offset to the current position. And the

negative value indicates that the finish point is in reverse-direction.

Dev2FinishPos:The finish position of bDev2No is the relative offset to the current position. And the

negative value indicates that the finish point is in reverse-direction.

Low32BitDummyDevNo:The default value is zero. Device number from 0 to 31 can be set 1 in

corresponding 32bits address.The effection of the selected device is to mask the output

pulses and make counters ignore the pulses in continuous interpolation motion.

High32BitDummyDevNo:The default value is zero. Device number from 32 to 63 can be set 1 in

corresponding 32bits address.The effection of the selected device is to mask the output

pulses and make counters ignore the pulses in continuous interpolation motion.

bCnstSpdEnable:In 2-dimension circular interpolation, make the synthesized speed cnostant. It can

be set as ENABLE_FEATURE or DISABLE_FEATURE.

Return code:

SUCCESS:The function returns successfully.

ERROR_SET_ARC_FINISH_POS:The coordinate that is set in Dev1FinishPos and

Dev2FinishPos is not on the circular path.

ERROR_SET_DATA:The value of the parameter bCnstSpdEnable is neither ENABLE_FEATURE

nor DISABLE_FEATURE.

Acc Acceleration rate (PPS / S) or acceleration time (Sec)

Dec Deceleration rate (PPS / S) or deceleration time (Sec)

SCurve_Enable ENABLE_FEATURE (S curve speed profile) or

DISABLE_FEATURE (trapezoidal curve speed profile)

SCurveAcc_Sect

Under the area occupied by the S-curve acceleration range: 0 is

no S-curve linear velocity. ~ (Drive_Speed-Start_Speed) / 2 is

complete without the linear segment S curve.

SCurveDec_Sect

Under the area occupied by the S-curve deceleration range: 0 is

no S-curve linear velocity. ~ (Drive_Speed-Start_Speed) / 2 is

complete without the linear segment S curve.

Max_Speed Through MaxSpeed parameter enumeration, select the maximum

speed limit and allows the use of resolution

Page 57: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

57

PISO-MN200 Function Reference V1.0

ERROR_SET_BIT_DUMMY_DEV:The dummy operation device number is set in

Low32BitDummyDevNo or High32BitDummyDevNo included bDev1No or bDev2No.

ERROR_INVALID_POSITION:The parameter value which is set to Dev1CenterPos or

Dev2CenterPos or Dev1FinishPos or Dev2FinishPos is not from -134217728 to

134217727.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

ERROR_MOVE_HOLD:Indicates the device had been hold, please call mn_group_start_move () to

release the hold-axis first.

ERROR_WAIT_ERC:Indicates the device is waiting for a completion of ERC timer.

ERROR_WAIT_BACKLASH_CORRECT:Indicates the device is waiting for a completion of backlash

compensation.

ERROR_WAIT_INP:Indicates the device is waiting INP signal input.

ERROR_EMG_SIGNAL_ON:The specified device EMG signal is triggered.

ERROR_ALM_SIGNAL_ON:The specified device ALARM signal is triggered.

ERROR_MEL_SIGNAL_ON:The specified device minus limit signal is triggered.

ERROR_PEL_SIGNAL_ON:The specified device positive limit signal is triggered.

ERROR_REGISTER_FULL:The specified device continuous motion registers have been used.

ERROR_START_SPEED_EXCEED_DRIVING_SPEED:Start_Speed set in structure SpeedPar is

bigger than Drive_Speed speed value.

ERROR_INVALID_MAX_SPEED_SELECTION:Max_Speed set in structure SpeedPar does not

belong with MaxSpeed enumeration.

ERROR_SET_START_SPEED_OUT_RANGE:Start_Speed set in structure SpeedPar exceeds the

range of MaxSpeed.

ERROR_SET_DRIVING_SPEED_OUT_RANGE:Drive_Speed set in structure SpeedPar exceeds

the range of MaxSpeed.

ERROR_INVALID_SCURVE_ENABLE:SCurve_Enable set in structure SpeedPar is neither

DISABLE_FEATURE nor ENABLE_FEATURE.

ERROR_SET_CORRECTION_SPD_OUT_RANGE:Correction_Speed set in structure SpeedPar

exceeds the range of MaxSpeed selection.

ERROR_INVALID_ACC_DATA:Acc set in structure SpeedPar is 0.

Page 58: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

58

PISO-MN200 Function Reference V1.0

ERROR_INVALID_ADC_MODE:AccDec_Mode set in structure SpeedPar is neither

ADC_MODE_RATE nor ADC_MODE_TIME.

ERROR_SET_ACC_DOUBLE_DEC:Acceleration set in structure SpeedPar is twice bigger than

Deceleration.

ERROR_SET_ACC_OUT_RANGE:Acceleration set in structure SpeedPar exceeds the range of

MaxSpeed selection.

ERROR_SET_DEC_OUT_RANGE:Deceleration set in structure SpeedPar exceeds the range of

MaxSpeed selection.

ERROR_SET_ACC_SECT_OUT_RANGE:SCurveAcc_Sect set in structure SpeedPar isn’t

between 0 ~ (Drive_Speed-Start_Speed) / 2.

ERROR_SET_DEC_SECT_OUT_RANGE:SCurveDec_Sect set in structure SpeedPar isn’t

between 0 ~ (Drive_Speed-Start_Speed) / 2 .

Page 59: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

59

PISO-MN200 Function Reference V1.0

5.5 mn_line3_move

VC6 / BCB6

short mn_line3_move ( BYTE bLineNo, BYTE bDev1No, BYTE bDev2No, BYTE bDev3No,

SPEED_PAR SpeedPar, long Dev1Pos, long Dev2Pos, long Dev3Pos )

C#

Int16 mn_line3_move( Byte bLineNo, Byte bDev1No, Byte bDev2No, Byte bDev3No,

SPEED_PAR SpeedPar, Int32 Dev1Pos, Int32 Dev2Pos, Int32 Dev3Pos )

Description:

This function starts 3-dimension linear interpolation motion with SPEED_PAR structure and

specified position.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDev1No:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

bDev2No:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

bDev3No:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

SpeedPar:This parameter is a SPEED_PAR structure, it’s used to define the motion speed profile,

and the structure members are as follows:

Member Describe

Start_Speed The initial speed and stopping speed (PPS)

Drive_Speed Moving speed (PPS)

Correction_Speed It’s the leaving speed(PPS) used in automatic home search mode

1,4,6,7.

AccDec_Mode

Acc and Dec input units: ADC_MODE_RATE (acceleration and

deceleration rate : PPS / Sec)

or ADC_MODE_TIME (acceleration and deceleration time : Sec)

Acc Acceleration rate (PPS / S) or acceleration time (Sec)

Dec Deceleration rate (PPS / S) or deceleration time (Sec)

Page 60: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

60

PISO-MN200 Function Reference V1.0

Dev1Pos:The position of bDev1No is the relative offset to the current position, and the negative

value indicates the direction is reverse.

Dev2Pos:The position of bDev2No is the relative offset to the current position, and the negative

value indicates the direction is reverse.

Dev3Pos:The position of bDev3No is the relative offset to the current position, and the negative

value indicates the direction is reverse.

Return code:

SUCCESS:The function returns successfully.

ERROR_INVALID_POSITION:The parameter value which is set to Dev1Pos or Dev2Pos or

Dev3Pos is not from -134217728 to 134217727.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

ERROR_MOVE_HOLD:Indicates the device had been hold, please call mn_group_start_move () to

release the hold-axis first.

ERROR_WAIT_ERC:Indicates the device is waiting for a completion of ERC timer.

ERROR_WAIT_BACKLASH_CORRECT:Indicates the device is waiting for a completion of backlash

compensation.

ERROR_WAIT_INP:Indicates the device is waiting INP signal input.

ERROR_EMG_SIGNAL_ON:The specified device EMG signal is triggered.

ERROR_ALM_SIGNAL_ON:The specified device ALARM signal is triggered.

SCurve_Enable ENABLE_FEATURE (S curve speed profile) or

DISABLE_FEATURE (trapezoidal curve speed profile)

SCurveAcc_Sect

Under the area occupied by the S-curve acceleration range: 0 is

no S-curve linear velocity. ~ (Drive_Speed-Start_Speed) / 2 is

complete without the linear segment S curve.

SCurveDec_Sect

Under the area occupied by the S-curve deceleration range: 0 is

no S-curve linear velocity. ~ (Drive_Speed-Start_Speed) / 2 is

complete without the linear segment S curve.

Max_Speed Through MaxSpeed parameter enumeration, select the maximum

speed limit and allows the use of resolution

Page 61: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

61

PISO-MN200 Function Reference V1.0

ERROR_MEL_SIGNAL_ON:The specified device minus limit signal is triggered.

ERROR_PEL_SIGNAL_ON:The specified device positive limit signal is triggered.

ERROR_REGISTER_FULL:The specified device continuous motion registers have been used.

ERROR_START_SPEED_EXCEED_DRIVING_SPEED:Start_Speed set in structure SpeedPar is

bigger than Drive_Speed speed value.

ERROR_INVALID_MAX_SPEED_SELECTION:Max_Speed set in structure SpeedPar does not

belong with MaxSpeed enumeration.

ERROR_SET_START_SPEED_OUT_RANGE:Start_Speed set in structure SpeedPar exceeds the

range of MaxSpeed.

ERROR_SET_DRIVING_SPEED_OUT_RANGE:Drive_Speed set in structure SpeedPar exceeds

the range of MaxSpeed.

ERROR_INVALID_SCURVE_ENABLE:SCurve_Enable set in structure SpeedPar is neither

DISABLE_FEATURE nor ENABLE_FEATURE.

ERROR_SET_CORRECTION_SPD_OUT_RANGE:Correction_Speed set in structure SpeedPar

exceeds the range of MaxSpeed selection.

ERROR_INVALID_ACC_DATA:Acc set in structure SpeedPar is 0.

ERROR_INVALID_ADC_MODE:AccDec_Mode set in structure SpeedPar is neither

ADC_MODE_RATE nor ADC_MODE_TIME.

ERROR_SET_ACC_DOUBLE_DEC:Acceleration set in structure SpeedPar is twice bigger than

Deceleration.

ERROR_SET_ACC_OUT_RANGE:Acceleration set in structure SpeedPar exceeds the range of

MaxSpeed selection.

ERROR_SET_DEC_OUT_RANGE:Deceleration set in structure SpeedPar exceeds the range of

MaxSpeed selection.

ERROR_SET_ACC_SECT_OUT_RANGE:SCurveAcc_Sect set in structure SpeedPar isn’t

between 0 ~ (Drive_Speed-Start_Speed) / 2.

ERROR_SET_DEC_SECT_OUT_RANGE:SCurveDec_Sect set in structure SpeedPar isn’t

between 0 ~ (Drive_Speed-Start_Speed) / 2 .

Page 62: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

62

PISO-MN200 Function Reference V1.0

5.6 mn_linen_move

VC6 / BCB6

short mn_linen_move( BYTE bLineNo, BYTE bDevNo[ ], SPEED_PAR SpeedPar, long

DevPos[ ], BYTE bNumDev )

C#

Int16 mn_linen_move( Byte bLineNo, Byte bDevNo[ ], SPEED_PAR SpeedPar, Int32 DevPos[ ],

Byte bNumDev )

Description:

This function starts multiple-dimension linear interpolation motion with SPEED_PAR structure

and specified position.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo[ ]:The pointer to the byte-array stores the device numbers to be execute.The array size

should be equal bNumDev parameter. The specific device number is configured with

Dip-Switch on MN-SERVO series device. Value can be set as 0 to 63. Duplicate number

on the same communication line is not permitted.

SpeedPar:This parameter is a SPEED_PAR structure, it’s used to define the motion speed profile,

and the structure members are as follows:

Member Describe

Start_Speed The initial speed and stopping speed (PPS)

Drive_Speed Moving speed (PPS)

Correction_Speed It’s the leaving speed(PPS) used in automatic home search mode

1,4,6,7.

AccDec_Mode

Acc and Dec input units: ADC_MODE_RATE (acceleration and

deceleration rate : PPS / Sec)

or ADC_MODE_TIME (acceleration and deceleration time : Sec)

Acc Acceleration rate (PPS / S) or acceleration time (Sec)

Dec Deceleration rate (PPS / S) or deceleration time (Sec)

SCurve_Enable ENABLE_FEATURE (S curve speed profile) or

DISABLE_FEATURE (trapezoidal curve speed profile)

SCurveAcc_Sect

Under the area occupied by the S-curve acceleration range: 0 is

no S-curve linear velocity. ~ (Drive_Speed-Start_Speed) / 2 is

complete without the linear segment S curve.

Page 63: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

63

PISO-MN200 Function Reference V1.0

DevPos[ ]:The pointer to the long-array stores the output pulses of each device, and the negative

value indicates the direction is reverse.The array size should be equal bNumDev

parameter.

bNumDev:Set the number of devices involved in the multi-axis linear interpolation.

Return code:

SUCCESS:The function returns successfully.

ERROR_INVALID_POSITION:The parameter value which is set to one of the members of

bDevPos[] is not between -134217728 ~ 134217727.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

ERROR_MOVE_HOLD:Indicates the device had been hold, please call mn_group_start_move () to

release the hold-axis first.

ERROR_WAIT_ERC:Indicates the device is waiting for a completion of ERC timer.

ERROR_WAIT_BACKLASH_CORRECT:Indicates the device is waiting for a completion of backlash

compensation.

ERROR_WAIT_INP:Indicates the device is waiting INP signal input.

ERROR_EMG_SIGNAL_ON:The specified device EMG signal is triggered.

ERROR_ALM_SIGNAL_ON:The specified device ALARM signal is triggered.

ERROR_MEL_SIGNAL_ON:The specified device minus limit signal is triggered.

ERROR_PEL_SIGNAL_ON:The specified device positive limit signal is triggered.

ERROR_REGISTER_FULL:The specified device continuous motion registers have been used.

ERROR_START_SPEED_EXCEED_DRIVING_SPEED:Start_Speed set in structure SpeedPar is

bigger than Drive_Speed speed value.

ERROR_INVALID_MAX_SPEED_SELECTION:Max_Speed set in structure SpeedPar does not

belong with MaxSpeed enumeration.

SCurveDec_Sect

Under the area occupied by the S-curve deceleration range: 0 is

no S-curve linear velocity. ~ (Drive_Speed-Start_Speed) / 2 is

complete without the linear segment S curve.

Max_Speed Through MaxSpeed parameter enumeration, select the maximum

speed limit and allows the use of resolution

Page 64: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

64

PISO-MN200 Function Reference V1.0

ERROR_SET_START_SPEED_OUT_RANGE:Start_Speed set in structure SpeedPar exceeds the

range of MaxSpeed.

ERROR_SET_DRIVING_SPEED_OUT_RANGE:Drive_Speed set in structure SpeedPar exceeds

the range of MaxSpeed.

ERROR_INVALID_SCURVE_ENABLE:SCurve_Enable set in structure SpeedPar is neither

DISABLE_FEATURE nor ENABLE_FEATURE.

ERROR_SET_CORRECTION_SPD_OUT_RANGE:Correction_Speed set in structure SpeedPar

exceeds the range of MaxSpeed selection.

ERROR_INVALID_ACC_DATA:Acc set in structure SpeedPar is 0.

ERROR_INVALID_ADC_MODE:AccDec_Mode set in structure SpeedPar is neither

ADC_MODE_RATE nor ADC_MODE_TIME.

ERROR_SET_ACC_DOUBLE_DEC:Acceleration set in structure SpeedPar is twice bigger than

Deceleration.

ERROR_SET_ACC_OUT_RANGE:Acceleration set in structure SpeedPar exceeds the range of

MaxSpeed selection.

ERROR_SET_DEC_OUT_RANGE:Deceleration set in structure SpeedPar exceeds the range of

MaxSpeed selection.

ERROR_SET_ACC_SECT_OUT_RANGE:SCurveAcc_Sect set in structure SpeedPar isn’t

between 0 ~ (Drive_Speed-Start_Speed) / 2.

ERROR_SET_DEC_SECT_OUT_RANGE:SCurveDec_Sect set in structure SpeedPar isn’t

between 0 ~ (Drive_Speed-Start_Speed) / 2 .

Page 65: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

65

PISO-MN200 Function Reference V1.0

5.7 mn_conti_interp_next_ready

VC6 / BCB6

short mn_conti_interp_next_ready( BYTE bLineNo, BYTE bDevNo, BYTE *pReady )

C#

Int16 mn_conti_interp_next_ready( Byte bLineNo, Byte bDevNo, ref Byte pReady )

Description:

This function checks if the next interpolation segment is ready to be set.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

pReady:The pointer to the memory stores the ready-status of next interpolation segment.

Return code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

Page 66: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

66

PISO-MN200 Function Reference V1.0

CHAPTER 6

Other Motion Functions

This chapter introduces several helpful functions, including mn_group_stop_move (),

mn_group_hold_move () and mn_group_start_move ().

6.1 mn_group_stop_move

VC6 / BCB6

short mn_group_stop_move( BYTE bLineNo, BYTE bGrpNo, BYTE bStopMode )

C#

Int16 mn_group_stop_move( Byte bLineNo, Byte bGrpNo, Byte bStopMode )

Description:

This helpful function stops motion of multiple devices in the specified group number. When

bGrpNo parameter is zero, all devices in the communication line will stop.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bGrpNo:Group number can be set from 0 to 7. The setting value 0 will stop all devices in the

communication line. The group number can be set with mn_set_group () function.

bStopMode:SLOWDOWN_STOP — deceleration stop

SUDDEN_STOP — immediately stop.

Return code:

SUCCESS:The function returns successfully.

ERROR_INVALID_GROUPNO:To set the value of the parameter bGrpNo does not belong 0~7.

ERROR_INVALID_STOP_MODE:The value of the parameter bStopMove is neither

SLOWDOWN_STOP nor SUDDEN_STOP.

Page 67: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

67

PISO-MN200 Function Reference V1.0

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

Page 68: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

68

PISO-MN200 Function Reference V1.0

6.2 mn_group_hold_move

VC6 / BCB6

short mn_group_hold_move( BYTE bLineNo, BYTE bGrpNo )

C#

Int16 mn_group_hold_move( Byte bLineNo, Byte bGrpNo )

Description:

This function is used to suspend pulse output in the specified group. After using this function,

the motion function that is called will complete related settings in advance. The pulse output will be

suspended until mn_group_start_move () is called, and all devices in the group start outputting pulse

at the same time. When bGrpNo parameter is zero, all devices in the communication line will be

suspended.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bGrpNo:Group number can be set from 0 to 7. The setting value 0 will suspend all devices in the

communication line. The group number can be set with mn_set_group () function.

Return code:

SUCCESS:The function returns successfully.

ERROR_INVALID_GROUPNO:To set the value of the parameter bGrpNo does not belong 0~7.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

ERROR_GROUP_ALREADY_HOLD:The group is set by bGrpNo number has been suspended

output pulse, please use mn_group_start_move() to release the group.

ERROR_INVALID_DEV_HOLD:The group is set by bGrpNo number does not contain any motion

control module, so you can't suspend the pulse output.

Page 69: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

69

PISO-MN200 Function Reference V1.0

6.3 mn_group_start_move

VC6 / BCB6

short mn_group_start_move( BYTE bLineNo, BYTE bGrpNo )

C#

Int16 mn_group_start_move( Byte bLineNo, Byte bGrpNo )

Description:

This function starts multiple devices simultaneously that are suspended by

mn_group_hold_move(). When bGrpNo parameter is zero, all devices suspended in the

communication line will start.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bGrpNo:Group number can be set from 0 to 7. The setting value 0 will start all devices suspended in

the communication line. The group number can be set with mn_set_group () function.

Return code:

SUCCESS:The function returns successfully.

ERROR_INVALID_GROUPNO:To set the value of the parameter bGrpNo does not belong 0~7.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

ERROR_GROUP_NOT_HOLD:The group is set by bGrpNo number hasn’t been suspended output

pulse yet, please use mn_group_hold_move() to suspend the group.

Page 70: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

70

PISO-MN200 Function Reference V1.0

CHAPTER 7

Advanced Motion Configurations

This chapter introduces some advanced features, including variable-ring counter and

compare-and-trigger.

7.1 mn_set_vring

VC6 / BCB6

short mn_set_vring( BYTE bLineNo, BYTE bDevNo, BYTE bVRingEnable, BYTE

bVRingSource, DWORD dwVRingValue )

C#

Int16 mn_set_vring( Byte bLineNo, Byte bDevNo, Byte bVRINGEnable, Byte bVRingSource,

UInt32 dwVRingValue )

Description:

This function enables and configures the variable-ring feature for logic-command or

encoder-position counters.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

bVRingEnable:ENABLE_FEATURE or

DISABLE_FEATURE.

bVRingSource:PULSE_COMMAND or

ENCODER_POSITION.

Page 71: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

71

PISO-MN200 Function Reference V1.0

dwVRingValue:The total numbers that counter can count.For instance, assigning 10,000 to

dwRingValue indicates the operation of ring-counter will be:

increasing in forward direction... → 9998 → 9999 → 0 → 1 → ...

decreasing in reserve direction... → 1 → 0 → 9999 → 9998 → ...

Return code:

SUCCESS:The function returns successfully.

ERROR_SET_DATA:The value of the parameter bVRingEnable is neither ENABLE_FEATURE nor

DISABLE_FEATURE.

ERROR_INVALID_VRING_SOURCE:The value of the parameter bVRingSource is neither

PULSE_COMMAND nor ENCODER_POSITION.

ERROR_INVALID_VRING_VALUE:The value of the parameter dwVRingValue exceeds

134217727.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

ERROR_GROUP_NOT_HOLD:The group is set by bGrpNo number hasn’t been suspended output

pulse, please use mn_group_hold_move() to suspend the group.

Page 72: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

72

PISO-MN200 Function Reference V1.0

7.2 mn_cnst_cmptrig_config

VC6 / BCB6

short mn_cnst_cmptrig_config( BYTE bLineNo, BYTE bDevNo, BYTE bCmpTrigEnable, BYTE

bCmpSource, BYTE bDirection, WORD wCnstPitch )

C#

Int16 mn_cnst_cmptrig_config( Byte bLineNo, Byte bDevNo, Byte bCmpTrigEnable, Byte

bCmpSource, Byte bDirection, UInt16 wCnstPitch )

Description:

This function enables and configures the compare-and-trigger feature to achieve high-speed

position compare and trigger CMP output.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

bVCmpTrigEnable:ENABLE_FEATURE or DISABLE_FEATURE.

bCmpSource:PULSE_COMMAND or ENCODER_POSITION.

bDirection:The comparing direction can be set:

Label Value Describe

CMPTRIG_DIRECTION_BOTH 8 Regardless of count direction

CMPTRIG_DIRECTION_FORWARD 9 While counting up

CMPTRIG_DIRECTION_REVERSE 10 While counting down

wCnstPitch:The constant-pitch (1 ≦ wCnstPitch ≦ 32,767 pulse)

Return code:

SUCCESS:The function returns successfully.

ERROR_SET_DATA:The value of the parameter bVCmpTrigEnable is neither ENABLE_FEATURE

nor DISABLE_FEATURE.

ERROR_INVALID_VRING_SOURCE:The value of the parameter bCmpSource is neither

PULSE_COMMAND nor ENCODER_POSITION.

ERROR_INVALID_CMPTRIG_DIRECTION:The value of the parameter bDirection is not

CMPTRIG_DIRECTION_BOTH, CMPTRIG_DIRECTION_FORWARD and

CMPTRIG_DIRECTION_REVERSE.

Page 73: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

73

PISO-MN200 Function Reference V1.0

ERROR_INVALID_CMPTRIG_PITCH:The value of the parameter wCnstPitch exceeds 32,767.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

ERROR_GROUP_NOT_HOLD:The group is set by bGrpNo number hasn’t been suspended output

pulse, please use mn_group_hold_move() to suspend the group.

Page 74: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

74

PISO-MN200 Function Reference V1.0

CHAPTER 8

Miscellaneous Functions

This chapter introduces some functions that are difficult to be cataloged, including setting the

logic-command counter and encoder-position counter, changing driving-speed while

trapezoidal-profile moving and updating the total numbers of output pulse.

8.1 mn_change_v

VC6 / BCB6

short mn_change_v( BYTE bLineNo, BYTE bDevNo, SPEED_PAR SpeedPar, BYTE

bWaitCmpEnable )

C#

Int16 mn_change_v( Byte bLineNo, Byte bDevNo, SPEED_PAR SpeedPar, Byte

bWaitCmpEnable )

Description:

This function changes the Drive-Speed during moving.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

SpeedPar:This parameter is a SPEED_PAR structure, it’s used to define the motion speed profile,

and the structure members are as follows:

Member Describe

Start_Speed The initial speed and stopping speed (PPS)

Page 75: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

75

PISO-MN200 Function Reference V1.0

bWaitCmpEnable:This parameter is reserved for the feature of comparator trigger changing velocity,

and the default value is set as DISABLE_FEATURE.

Return code:

SUCCESS:The function returns successfully.

ERROR_SET_DATA:The value of the parameter bWaitCmpEnable is neither ENABLE_FEATURE

nor DISABLE_FEATURE.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

ERROR_MOTION_IS_COMPLETED : The specified motion was done.

ERROR_START_SPEED_EXCEED_DRIVING_SPEED:Start_Speed set in structure SpeedPar is

bigger than Drive_Speed speed value.

Drive_Speed Moving speed (PPS)

Correction_Speed It’s the leaving speed(PPS) used in automatic home search mode

1,4,6,7.

AccDec_Mode

Acc and Dec input units: ADC_MODE_RATE (acceleration and

deceleration rate : PPS / Sec)

or ADC_MODE_TIME (acceleration and deceleration time : Sec)

Acc Acceleration rate (PPS / S) or acceleration time (Sec)

Dec Deceleration rate (PPS / S) or deceleration time (Sec)

SCurve_Enable ENABLE_FEATURE (S curve speed profile) or

DISABLE_FEATURE (trapezoidal curve speed profile)

SCurveAcc_Sect

Under the area occupied by the S-curve acceleration range: 0 is

no S-curve linear velocity. ~ (Drive_Speed-Start_Speed) / 2 is

complete without the linear segment S curve.

SCurveDec_Sect

Under the area occupied by the S-curve deceleration range: 0 is

no S-curve linear velocity. ~ (Drive_Speed-Start_Speed) / 2 is

complete without the linear segment S curve.

Max_Speed Through MaxSpeed parameter enumeration, select the maximum

speed limit and allows the use of resolution

Page 76: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

76

PISO-MN200 Function Reference V1.0

ERROR_INVALID_MAX_SPEED_SELECTION:Max_Speed set in structure SpeedPar does not

belong with MaxSpeed enumeration.

ERROR_SET_START_SPEED_OUT_RANGE:Start_Speed set in structure SpeedPar exceeds the

range of MaxSpeed.

ERROR_SET_DRIVING_SPEED_OUT_RANGE:Drive_Speed set in structure SpeedPar exceeds

the range of MaxSpeed.

ERROR_INVALID_SCURVE_ENABLE:SCurve_Enable set in structure SpeedPar is neither

DISABLE_FEATURE nor ENABLE_FEATURE.

ERROR_SET_CORRECTION_SPD_OUT_RANGE:Correction_Speed set in structure SpeedPar

exceeds the range of MaxSpeed selection.

ERROR_INVALID_ACC_DATA:Acc set in structure SpeedPar is 0.

ERROR_INVALID_ADC_MODE:AccDec_Mode set in structure SpeedPar is neither

ADC_MODE_RATE nor ADC_MODE_TIME.

ERROR_SET_ACC_DOUBLE_DEC:Acceleration set in structure SpeedPar is twice bigger than

Deceleration.

ERROR_SET_ACC_OUT_RANGE:Acceleration set in structure SpeedPar exceeds the range of

MaxSpeed selection.

ERROR_SET_DEC_OUT_RANGE:Deceleration set in structure SpeedPar exceeds the range of

MaxSpeed selection.

ERROR_SET_ACC_SECT_OUT_RANGE:SCurveAcc_Sect set in structure SpeedPar isn’t

between 0 ~ (Drive_Speed-Start_Speed) / 2.

ERROR_SET_DEC_SECT_OUT_RANGE:SCurveDec_Sect set in structure SpeedPar isn’t

between 0 ~ (Drive_Speed-Start_Speed) / 2 .

Page 77: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

77

PISO-MN200 Function Reference V1.0

8.2 mn_change_p

VC6 / BCB6

short mn_change_p( BYTE bLineNo, BYTE bDevNo, long Position )

C#

Int16 mn_change_p( Byte bLineNo, Byte bDevNo, Int32 Position )

Description:

This function changes the total numbers of output pulse during moving.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

Position:The total numbers of output pulse.

Return code:

SUCCESS:The function returns successfully.

ERROR_INVALID_POSITION:The parameter Position is not between -134217728 ~ 134217727.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

ERROR_MOTION_IS_COMPLETED : The specified motion was done.

Page 78: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

78

PISO-MN200 Function Reference V1.0

8.3 mn_set_cmdcounter

VC6 / BCB6

short mn_set_cmdcounter( BYTE bLineNo, BYTE bDevNo, long Data )

C#

Int16 mn_set_cmdcounter( Byte bLineNo, Byte bDevNo, Int32 Data )

Description:

This function sets the logic-command counter.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

Data:The value is set to logic-command counter.

Return code:

SUCCESS:The function returns successfully.

ERROR_INVALID_POSITION:The parameter Position is not between -134217728 ~ 134217727.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

Page 79: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

79

PISO-MN200 Function Reference V1.0

8.4 mn_set_enccounter

VC6 / BCB6

short mn_set_enccounter( BYTE bLineNo, BYTE bDevNo, long Data )

C#

Int16 mn_set_enccounter( Byte bLineNo, Byte bDevNo, Int32 Data )

Description:

This function sets the encoder-counter.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

Data:The value is set to the encoder input counter.

Return code:

SUCCESS:The function returns successfully.

ERROR_INVALID_POSITION:The parameter Position is not between -134217728 ~ 134217727.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

Page 80: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

80

PISO-MN200 Function Reference V1.0

CHAPTER 9

Status

Firstly, this chapter describes mn_get_dev_info () function to get the serial module information, and

then following functions are used to get MN-SERVO motion control module status, including

mn_motion_done (), mn_get_cmdcounter (), mn_get_enccounter (), mn_get_speed (),

mn_get_mdio_status () and mn_get_error_status ().

9.1 mn_get_dev_info

VC6 / BCB6

short mn_get_dev_info( BYTE bLineNo, BYTE bDevNo, BYTE* pData )

C#

Int16 mn_get_dev_info( Byte bLineNo, Byte bDevNo, ref Byte pData )

Description:

This function is used to get the type of device with specified device number in communication

line.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

pData:The pointer to the memory that stores the device type information will be:

Label Value Describe

DEV_INF_NO_DEV 0x00 There is no device on the specified

device number.

Page 81: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

81

PISO-MN200 Function Reference V1.0

DEV_INF_MOTION_DEV 0x8b This device is a MN-SERVO series

Motion Control Module.

DEV_INF_IO_32OUT_DEV 0x80 This device is a MN-3257 digital output

control module.

DEV_INF_IO_16IN_16OUT_DEV 0x82 This device is a MN-3254 digital

input/output control module.

DEV_INF_IO_32IN_DEV 0x87 This device is a MN-3253 digital input

control module.

Return code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

Page 82: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

82

PISO-MN200 Function Reference V1.0

9.2 mn_motion_done

VC6 / BCB6

short mn_motion_done( BYTE bLineNo, BYTE bDevNo, BYTE pDone )

C#

Int16 mn_motion_done( Byte bLineNo, Byte bDevNo, ref Byte pDone )

Description:

This function checks the completion of motion.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

pDone:The pointer to the memory stores the motion-status. The motion-status will be

MOTION_DONE: the specific device is stop.

MOTION_NOT_DONE: the specific device is driving.

Return code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

Page 83: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

83

PISO-MN200 Function Reference V1.0

9.3 mn_get_cmdcounter

VC6 / BCB6

short mn_get_cmdcounter ( BYTE bLineNo, BYTE bDevNo, long* pData )

C#

Int16 mn_get_cmdcounter( Byte bLineNo, Byte bDevNo, ref Int32 pData )

Description:

This function gets the content of logic-command counter.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

pData:The pointer to the memory stores logic-command counter.

Return code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

Page 84: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

84

PISO-MN200 Function Reference V1.0

9.4 mn_get_enccounter

VC6 / BCB6

short mn_get_enccounter ( BYTE bLineNo, BYTE bDevNo, long* pData )

C#

Int16 mn_get_enccounter( Byte bLineNo, Byte bDevNo, ref Int32 pData )

Description:

This function gets the content of encoder-counter.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

pData:The pointer to the memory stores encoder-position counter.

Return code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

Page 85: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

85

PISO-MN200 Function Reference V1.0

9.5 mn_get_speed

VC6 / BCB6

short mn_get_speed ( BYTE bLineNo, BYTE bDevNo, double* pData )

C#

Int16 mn_get_speed( Byte bLineNo, Byte bDevNo, ref double pData )

Description:

This function gets the speed of current motion.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

pData:The pointer to the memory stores speed of current motion.

Return code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

Page 86: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

86

PISO-MN200 Function Reference V1.0

9.6 mn_get_mdio_status

VC6 / BCB6

short mn_get_mdio_status ( BYTE bLineNo, BYTE bDevNo, MOTION_IO* MotionIO )

C#

Int16 mn_get_mdio_status( Byte bLineNo, Byte bDevNo, ref MOTION_DEV_IO pMotionIO )

Description:

This function checks the status of motion-related digital inputs and outputs.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

MotionIO:The pointer to the memory is a MOTION_IO structure that stores servo driver and

machine-related digital signal inputs and outputs, and structure members are as follows:

Member Value Describe

SVON 0 / 1 Output Signal: On / Off servo driver excitation

RESET_ALM 0 / 1 Output Signal: On / Off reset servo driver ALARM

RDY 0 / 1 Output Signal: On / Off servo driver RDY

ALM 0 / 1 Output Signal: On / Off servo driver ALARM

PEL 0 / 1 Input Signal: Machine positive Limit

MEL 0 / 1 Input Signal: Machine minus Limit

ORG 0 / 1 Input Signal: Machine Orgin

SDLTC 0 / 1 Input Signal: Machine slowdown point latch

SDIN 0 / 1 Input Signal: Machine slowdown point

INP 0 / 1 Input Signal: servo driver INP

EMG 0 / 1 Input Signal: Machine EMG

EZ 0 / 1 Input Signal: servo driver EZ

ERC 0 / 1 Output Signal: On / Off servo driver ERC

Return code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

Page 87: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

87

PISO-MN200 Function Reference V1.0

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

Page 88: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

88

PISO-MN200 Function Reference V1.0

9.7 mn_get_error_status

VC6 / BCB6

short mn_get_error_status( BYTE bLineNo, BYTE bDevNo, DWORD* pData )

C#

Int16 mn_get_error_status( Byte bLineNo, Byte bDevNo, ref UInt32 pData )

Description:

This function gets the error-status of specific device.

.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on MN-SERVO series device.

Value can be set as 0 to 63. Duplicate number on the same communication line is not

permitted.

pData:The pointer to the memory stores error status. The value of its contents may be.

Label Value Describe

ERR_STATUS_SW_PEL_STOP 0x0001 Software positive limit is triggered.

ERR_STATUS_SW_MEL_STOP 0x0002 Software minus limit is triggered.

ERR_STATUS_PEL_STOP 0x0008 Hardware positive limit is triggered.

ERR_STATUS_MEL_STOP 0x0010 Hardware minus limit is triggered.

ERR_STATUS_ALM_STOP 0x0020 ALARM signal is triggered.

ERR_STATUS_EMG_STOP 0x0080 EMG signal is triggered.

ERR_STATUS_SD_STOP 0x0100 Slowdown point stop is triggered.

Return code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_COMM_NOT_START:The Motionnet communication does not start.

ERROR_COMM_DISCONNECT:The Motionnet communication is disconnected.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_IO_DEV:The given device number is not a motion device module, but it is a serial I/O

module.

Page 89: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

89

PISO-MN200 Function Reference V1.0

CHAPTER 10

I/O extension

PISO-MN200 board provides 8 digital inputs and 4 digital outputs. You can also connect extension IO

modules through Motionnet communication line. It provides time determined information update. IO

entension modules include: MN-3253 (32-point digital input), MN-3254 (16-point digital input and

output) and MN-3257 (32-point digital output).

This chapter describes IO related functions, including mn200_get_di (), mn200_set_do (),

mn200_get_do (), mn_get_di_bit (), mn_set_do_bit (), mn_get_do_bit (), mn_get_di_byte (),

mn_set_do_byte (), mn_get_do_byte (), mn_get_di_word (), mn_set_do_word (), mn_get_do_word ().

10.1 mn200_get_di

VC6 / BCB6

short mn200_get_di( BYTE bCardID, BYTE* pData )

C#

Int16 mn200_get_di( Byte bCardID, ref Byte pData )

Description:

This function gets the digital inputs of PISO-MN200 board.

Parameters:

bCardID:The CardID is specified by Dip-Switch on the Motionnet board.

pData:The pointer to the memory stores 8 digital input points.Each bit represents its corresponding

digital input signal.

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DI_7 DI_6 DI_5 DI_4 DI_3 DI_2 DI_1 DI_0

Return code:

Page 90: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

90

PISO-MN200 Function Reference V1.0

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

Page 91: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

91

PISO-MN200 Function Reference V1.0

10.2 mn200_set_do

VC6 / BCB6

short mn200_set_do( BYTE bCardID, BYTE bData )

C#

Int16 mn200_set_do( Byte bCardID, Byte bData )

Description:

This function sets the digital output points of PISO-MN200 board.

Parameters:

bCardID:The CardID is specified by Dip-Switch on the Motionnet board.

bData:It’s used to set 4 digital output points.Each bit represents its corresponding digital ouput

signal.

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DO_3 DO_2 DO_1 DO_0

Return code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

ERROR_INVALID_OUTPUT_DATA:The value of parameter bData exceeds 0x0F.

Page 92: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

92

PISO-MN200 Function Reference V1.0

10.3 mn200_get_do

VC6 / BCB6

short mn200_get_do( BYTE bCardID, BYTE* pData )

C#

Int16 mn200_get_do( Byte bCardID, ref Byte pData )

Description:

This function gets digital output points of PISO-MN200 board.

Parameters:

bCardID:The CardID is specified by Dip-Switch on the Motionnet board.

pData:The pointer to the memory stores 4 digital output points.Each bit represents its corresponding

digital output signal.

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DO_3 DO_2 DO_1 DO_0

Return code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

Page 93: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

93

PISO-MN200 Function Reference V1.0

10.4 mn_get_di_bit

VC6 / BCB6

short mn_get_di_bit( BYTE bLineNo, BYTE bDevNo, BYTE bBitNo, BYTE* pData )

C#

Int16 mn_get_di_bit( Byte bLineNo, Byte bDevNo, Byte bBitNo, ref Byte pData )

Description:

This function gets one bit value of the digital input points of the IO module on Motionnet

communication line.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on I/O device. Value can be set as

0 to 63. Duplicate number on the same communication line is not permitted.

bBitNo:Choose the number of the digital input bit that you want to get.

When connect to MN-3253, you can choose number: 0~31

When connect to MN-3254, you can choose number: 0~15

pData:The pointer to the memory stores the digital input point which is specified by bBitNo.The

value is: 0 or 1.

Return code:

SUCCESS:The function returns successfully.

ERROR_INVALID_BITNO:The parameter setting bBitNo is out of range.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_CARD_ID:The parameter bCardID can’t correspond to the Motionnet board that

was found by operation system.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_SET_MOTION_DEV:The device is a motion control module rather than a serial IO module.

ERROR_SET_IO_DEV:The device was chosen by parameter bDevNo is MN-3257.

ERROR_SET_BITNO:The parameter bitNo setting is out of MN3254 acceptable range.

Page 94: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

94

PISO-MN200 Function Reference V1.0

10.5 mn_set_do_bit

VC6 / BCB6

short mn_set_do_bit( BYTE bLineNo, BYTE bDevNo, BYTE bBitNo, BYTE bData )

C#

Int16 mn_set_do_bit( Byte bLineNo, Byte bDevNo, Byte bBitNo, Byte bData )

Description:

This function sets one bit value of the digital output points of the IO module on Motionnet

communication line.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on I/O device. Value can be set as

0 to 63. Duplicate number on the same communication line is not permitted.

bBitNo:Choose the number of the digital output bit that you want to set.

When connect to MN-3254, you can choose number: 0~15

When connect to MN-3257, you can choose number: 0~31

bData:It is used to set digital output point which is specified by parameter bBitNo. The value is: 0 or

1.

Return code:

SUCCESS:The function returns successfully.

ERROR_INVALID_BITNO:The parameter setting bBitNo is out of range.

ERROR_INVALID_OUTPUT_DATA:The value of the parameter bData is neither 0 nor 1.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_CARD_ID:The parameter bCardID can’t correspond to the Motionnet board that

was found by operation system .

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_SET_MOTION_DEV:The device is a motion control module rather than a serial IO module.

ERROR_SET_IO_DEV:The device was chosen by parameter bDevNo is MN-3253.

ERROR_SET_BITNO:The parameter bitNo setting is out of MN3254 acceptable range.

Page 95: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

95

PISO-MN200 Function Reference V1.0

10.6 mn_get_do_bit

VC6 / BCB6

short mn_get_do_bit( BYTE bLineNo, BYTE bDevNo, BYTE bBitNo, BYTE* pData )

C#

Int16 mn_get_do_bit( Byte bLineNo, Byte bDevNo, Byte bBitNo, ref Byte pData )

Description:

This function gets one bit value of the digital output points of the IO module on Motionnet

communication line.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on I/O device. Value can be set as

0 to 63. Duplicate number on the same communication line is not permitted.

bBitNo:Choose the number of digital output bit that you want to get.

When connect to MN-3254, you can choose number: 0~15

When connect to MN-3257, you can choose number: 0~31

pData:The pointer to the memory stores the digital output point which is specified by bBitNo.The

value is: 0 or 1.

Return code:

SUCCESS:The function returns successfully.

ERROR_INVALID_BITNO:The parameter setting bBitNo is out of range.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_CARD_ID:The parameter bCardID can’t correspond to the Motionnet board that

was found by operation system .

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_SET_MOTION_DEV:The device is a motion control module rather than a serial IO module.

ERROR_SET_IO_DEV:The device was chosen by parameter bDevNo is MN-3253.

ERROR_SET_BITNO:The parameter bitNo setting is out of MN3254 acceptable range.

Page 96: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

96

PISO-MN200 Function Reference V1.0

10.7 mn_get_di_byte

VC6 / BCB6

short mn_get_di_byte( BYTE bLineNo, BYTE bDevNo, BYTE bByteNo, BYTE* pData )

C#

Int16 mn_get_di_byte( Byte bLineNo, Byte bDevNo, Byte bByteNo, ref Byte pData )

Description:

This function gets one byte value of the digital input points of the IO module on Motionnet

communication line.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on I/O device. Value can be set as

0 to 63. Duplicate number on the same communication line is not permitted.

bByteNo:Choose the number of digital input byte that you want to get.

When connect to MN-3253, you can choose number: 0~3

When connect to MN-3254, you can choose number: 0~1

pData:The pointer to the memory that stores the digital input 8 points is specified by bByteNo. Its

values are as follows, each bit representing the corresponding digital input signal.

bByteNo = 0

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DI_7 DI_6 DI_5 DI_4 DI_3 DI_2 DI_1 DI_0

bByteNo = 1

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DI_15 DI_14 DI_13 DI_12 DI_11 DI_10 DI_9 DI_8

bByteNo = 2

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DI_23 DI_22 DI_21 DI_20 DI_19 DI_18 DI_17 DI_16

bByteNo = 3

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DI_31 DI_30 DI_29 DI_28 DI_27 DI_26 DI_25 DI_24

Page 97: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

97

PISO-MN200 Function Reference V1.0

Return code:

SUCCESS:The function returns successfully.

ERROR_INVALID_ BYTENO:The parameter setting bByteNo is out of range.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_CARD_ID:The parameter bCardID can’t correspond to the Motionnet board that

was found by operation system.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_SET_MOTION_DEV:The device is a motion control module rather than a serial IO module.

ERROR_SET_IO_DEV:The device was chosen by parameter bDevNo is MN-3257.

ERROR_SET_ BYTENO:The parameter bByteNo setting is out of MN3254 acceptable range.

Page 98: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

98

PISO-MN200 Function Reference V1.0

10.8 mn_set_do_byte

VC6 / BCB6

short mn_set_do_byte( BYTE bLineNo, BYTE bDevNo, BYTE bByteNo, BYTE bData )

C#

Int16 mn_set_do_byte( Byte bLineNo, Byte bDevNo, Byte bByteNo, Byte bData )

Description:

This function sets one byte value of digital output points of the IO module on Motionnet

communication line.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on I/O device. Value can be set as

0 to 63. Duplicate number on the same communication line is not permitted.

bByteNo:Choose the number of digital output byte that you want to set.

When connect to MN-3254, you can choose number: 0~1

When connect to MN-3257, you can choose number: 0~3

bData:It is used to set digital output 8 points which are specified by parameter bByteNo. Its values

are as follows, each bit representing the corresponding digital output signal.

bByteNo = 0

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DO_7 DO_6 DO_5 DO_4 DO_3 DO_2 DO_1 DO_0

bByteNo = 1

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DO_15 DO_14 DO_13 DO_12 DO_11 DO_10 DO_9 DO_8

bByteNo = 2

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DO_23 DO_22 DO_21 DO_20 DO_19 DO_18 DO_17 DO_16

bByteNo = 3

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DO_31 DO_30 DO_29 DO_28 DO_27 DO_26 DO_25 DO_24

Page 99: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

99

PISO-MN200 Function Reference V1.0

Return code:

SUCCESS:The function returns successfully.

ERROR_INVALID_BYTENO:The parameter setting bByteNo is out of range.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_CARD_ID:The parameter bCardID can’t correspond to the Motionnet board that

was found by operation system.

ERROR_INVALID_DEV_NO:ERROR_INVALID_DEV_NO:The given device number is out of range

value (0-63).

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_SET_MOTION_DEV:The device is a motion control module rather than a serial IO module.

ERROR_SET_IO_DEV:The device was chosen by parameter bDevNo is MN-3253.

ERROR_SET_ BYTENO:The parameter bByteNo setting is out of MN3254 acceptable range.

Page 100: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

100

PISO-MN200 Function Reference V1.0

10.9 mn_get_do_byte

VC6 / BCB6

short mn_get_do_byte( BYTE bLineNo, BYTE bDevNo, BYTE bByteNo, BYTE* pData )

C#

Int16 mn_get_do_byte( Byte bLineNo, Byte bDevNo, Byte bByteNo, ref Byte pData )

Description:

This function gets one byte value of digital output points of the IO module on Motionnet

communication line.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on I/O device. Value can be set as

0 to 63. Duplicate number on the same communication line is not permitted.

bByteNo:Choose the number of digital output byte that you want to get.

When connect to MN-3254, you can choose number: 0~1

When connect to MN-3257, you can choose number: 0~3

pData:The pointer to the memory that stores the digital output 8 points are specified by bByteNo. Its

values are as follows, each bit representing the corresponding digital output signal.

bByteNo = 0

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DO_7 DO_6 DO_5 DO_4 DO_3 DO_2 DO_1 DO_0

bByteNo = 1

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DO_15 DO_14 DO_13 DO_12 DO_11 DO_10 DO_9 DO_8

bByteNo = 2

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DO_23 DO_22 DO_21 DO_20 DO_19 DO_18 DO_17 DO_16

bByteNo = 3

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DO_31 DO_30 DO_29 DO_28 DO_27 DO_26 DO_25 DO_24

Page 101: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

101

PISO-MN200 Function Reference V1.0

Return code:

SUCCESS:The function returns successfully.

ERROR_INVALID_ BYTENO:The parameter setting bByteNo is out of range.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_CARD_ID:The parameter bCardID can’t correspond to the Motionnet board that

was found by operation system.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_SET_MOTION_DEV:The device is a motion control module rather than a serial IO module.

ERROR_SET_IO_DEV:The device was chosen by parameter bDevNo is MN-3253.

ERROR_SET_ BYTENO:The parameter bByteNo setting is out of MN3254 acceptable range.

Page 102: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

102

PISO-MN200 Function Reference V1.0

10.10 mn_get_di_word

VC6 / BCB6

short mn_get_di_word( BYTE bLineNo, BYTE bDevNo, BYTE bWordNo, WORD* pData )

C#

Int16 mn_get_di_word( Byte bLineNo, Byte bDevNo, Byte bWordNo, ref UInt16 pData )

Description:

This function get one word value of digital input points of the IO module on Motionnet

communication line.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on I/O device. Value can be set as

0 to 63. Duplicate number on the same communication line is not permitted.

bWordNo:Choose the number of digital input word that you want to get.

When connect to MN-3253, you can choose number: 0~1

When connect to MN-3254, you can choose number: 0

pData:The pointer to the memory that stores the digital input 16 points is specified by bWordNo. Its

values are as follows, each bit representing the corresponding digital input signal.

bWordNo = 0

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DI_7 DI_6 DI_5 DI_4 DI_3 DI_2 DI_1 DI_0

Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8

DI_15 DI_14 DI_13 DI_12 DI_11 DI_10 DI_9 DI_8

bWordNo = 1

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DI_23 DI_22 DI_21 DI_20 DI_19 DI_18 DI_17 DI_16

Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8

DI_31 DI_30 DI_29 DI_28 DI_27 DI_26 DI_25 DI_24

Return code:

SUCCESS:The function returns successfully.

ERROR_INVALID_ WORDNO:The parameter setting bWordNo is out of range.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

Page 103: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

103

PISO-MN200 Function Reference V1.0

ERROR_INVALID_CARD_ID:The parameter bCardID can’t correspond to the Motionnet board that

was found by operation system.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_SET_MOTION_DEV:The device is a motion control module rather than a serial IO module.

ERROR_SET_IO_DEV:The device was chosen by parameter bDevNo is MN-3257.

ERROR_SET_ BYTENO:The parameter bWordNo setting is out of MN3254 acceptable range.

Page 104: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

104

PISO-MN200 Function Reference V1.0

10.11 mn_set_do_word

VC6 / BCB6

short mn_set_do_word( BYTE bLineNo, BYTE bDevNo, BYTE bWordNo, WORD wData )

C#

Int16 mn_set_do_word( Byte bLineNo, Byte bDevNo, Byte bWordNo, UIint16 wData )

Description:

This function get one word value of digital output points of the I / O module on Motionnet

communication line.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on I/O device. Value can be set as

0 to 63. Duplicate number on the same communication line is not permitted.

bWordNo:Choose the number of digital output word that you want to set.

When connect to MN-3254, you can choose number: 0

When connect to MN-3257, you can choose number: 0~1

wData:It is used to set digital output 16 points which are specified by parameter bWordNo. Its

values are as follows, each bit representing the corresponding digital output signal.

bWordNo = 0

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DO_7 DO_6 DO_5 DO_4 DO_3 DO_2 DO_1 DO_0

Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8

DO_15 DO_14 DO_13 DO_12 DO_11 DO_10 DO_9 DO_8

bWordNo = 1

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DO_23 DO_22 DO_21 DO_20 DO_19 DO_18 DO_17 DO_16

Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8

DO_31 DO_30 DO_29 DO_28 DO_27 DO_26 DO_25 DO_24

Return code:

SUCCESS:The function returns successfully.

ERROR_INVALID_ WORDNO:The parameter setting bWordNo is out of range.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

Page 105: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

105

PISO-MN200 Function Reference V1.0

ERROR_INVALID_CARD_ID:The parameter bCardID can’t correspond to the Motionnet board that

was found by operation system .

ERROR_INVALID_DEV_NO:ERROR_INVALID_DEV_NO:The given device number is out of range

value (0-63).

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_SET_MOTION_DEV:The device is a motion control module rather than a serial IO module.

ERROR_SET_IO_DEV:The device was chosen by parameter bDevNo is MN-3253.

ERROR_SET_ WORDNO:The parameter bWordNo setting is out of MN3254 acceptable range.

Page 106: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

106

PISO-MN200 Function Reference V1.0

10.12 mn_get_do_word

VC6 / BCB6

short mn_get_do_word( BYTE bLineNo, BYTE bDevNo, BYTE bWordNo, WORD* pData )

C#

Int16 mn_get_do_word( Byte bLineNo, Byte bDevNo, Byte bByteNo, ref UIint16 pData )

Description:

This function gets one word value of digital output points of the IO module on Motionnet

communication line.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on I/O device. Value can be set as

0 to 63. Duplicate number on the same communication line is not permitted.

bWordNo:Choose the number of digital output byte that you want to get.

When connect to MN-3254, you can choose number: 0

When connect to MN-3257, you can choose number: 0~1

pData:The pointer to the memory that stores the digital output 16 points is specified by bWordNo. Its

values are as follows, each bit representing the corresponding digital output signal.

bWordNo = 0

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DO_7 DO_6 DO_5 DO_4 DO_3 DO_2 DO_1 DO_0

Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8

DO_15 DO_14 DO_13 DO_12 DO_11 DO_10 DO_9 DO_8

bWordNo = 1

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

DO_23 DO_22 DO_21 DO_20 DO_19 DO_18 DO_17 DO_16

Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8

DO_31 DO_30 DO_29 DO_28 DO_27 DO_26 DO_25 DO_24

Return code:

SUCCESS:The function returns successfully.

ERROR_INVALID_ WORDNO:The parameter setting bWordNo is out of range.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

Page 107: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

107

PISO-MN200 Function Reference V1.0

ERROR_INVALID_CARD_ID:The parameter bCardID can’t correspond to the Motionnet board that

was found by operation system.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_NO_DEV_FOUND:There is no active device available on the communication line.

ERROR_SET_MOTION_DEV:The device is a motion control module rather than a serial IO module.

ERROR_SET_IO_DEV:The device was chosen by parameter bDevNo is MN-3253.

ERROR_SET_ WORDNO:The parameter bWordNo setting is out of MN3254 acceptable range.

Page 108: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

108

PISO-MN200 Function Reference V1.0

CHAPTER 11

Advanced I/O Functions

The Motionnet IO functions introduced in last chapter all contain the check for communication status.

When the device occur communication error, it will return an error code and clear the error flag of the

number automatically to make sure getting correct information for next communication error. However,

these checks will affect performance, for high-efficiency requirement and experienced users, we offer

the following advanced functions: mn_get_port_bit (), mn_set_port_bit (), mn_get_port_byte (),

mn_set_port_byte ().They not only provide various parameters interface,but also remove the check for

communication status and other protecting steps to shorten the function operating time, but user need

to use mn_get_line_status (), mn_get_slave_error_table () and mn_clear_slave_error_flag () to check

the status of the communication and clear flag of communication error device number manually.

11.1 mn_get_port_bit

VC6 / BCB6

short mn_get_port_bit(BYTE bLineNo, BYTE bDevNo, BYTE bPortNo, BYTE bBitNo, BYTE*

pData)

Description:

This function gets bit value of digital input / output points of the specified port of IO module on

the Motionnet communication line.

Parameters:

bCardID:The CardID is specified by Dip-Switch on the Motionnet board.

bDevNo:The specific device number is configured with Dip-Switch on I/O device. Value can be set as

0 to 63. Duplicate number on the same communication line is not permitted.

bPortNo : You can choose port number: 0 ~ 3

bBitNo:You can choose bit number: 0 ~ 7

pData:The pointer to the memory that stores the digital output point is specified by bPortNo and

bBitNo. The value is 0 or 1.

Page 109: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

109

PISO-MN200 Function Reference V1.0

Return code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_CARD_ID:The parameter bCardID can’t correspond to the Motionnet board that

was found by operation system .

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_BYTENO:The parameter bPortNo setting is out of range.

ERROR_INVALID_BITNO:The parameter bBitNo setting is out of range.

Page 110: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

110

PISO-MN200 Function Reference V1.0

11.2 mn_set_port_bit

VC6 / BCB6

short mn_set_port_bit( BYTE bLineNo, BYTE bDevNo, BYTE bPortNo, BYTE bBitNo, BYTE

bData )

Description:

This function sets bit value of the digital output points of the specified port of the IO module on

Motionnet communication line.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on I/O device. Value can be set as

0 to 63. Duplicate number on the same communication line is not permitted.

bPortNo : Choose the number of port that you want to set .

When connect to 32DO device, you can choose number: 0 ~ 3

When connect to 16DI16DO device, you can choose number: 2 ~ 3

bBitNo:You can choose bit number: 0 ~ 7

bData:It is used to set digital output point which is specified by parameter bBitNo. The value is: 0 or

1.

Return code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_CARD_ID:The parameter bCardID can’t correspond to the Motionnet board that

was found by operation system.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_BYTENO:The parameter bPortNo setting is out of range.

ERROR_INVALID_BITNO:The parameter bBitNo setting is out of range.

Page 111: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

111

PISO-MN200 Function Reference V1.0

11.3 mn_get_port_byte

VC6 / BCB6

short mn_get_port_byte( BYTE bLineNo, BYTE bDevNo, BYTE bPortNo, BYTE* pData )

Description:

This function gets byte value of the digital input/output points of the IO module on Motionnet

communication line.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on I/O device. Value can be set as

0 to 63. Duplicate number on the same communication line is not permitted.

bPortNo : Choose the number of port that you want to get. The setting value is 0 ~ 3.

pData:The pointer to the memory that stores the digital output 8 points are specified by bPortNo.

Return code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_CARD_ID:The parameter bCardID can’t correspond to the Motionnet board that

was found by operation system.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_BYTENO:The parameter bPortNo setting is out of range.

Page 112: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

112

PISO-MN200 Function Reference V1.0

11.4 mn_set_port_byte

VC6 / BCB6

short mn_set_port_byte( BYTE bLineNo, BYTE bDevNo, BYTE bportNo, BYTE bData )

Description:

This function sets byte value of digital input/output points of the IO module on Motionnet

communication line.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

bDevNo:The specific device number is configured with Dip-Switch on I/O device. Value can be set as

0 to 63. Duplicate number on the same communication line is not permitted.

bPortNo : Choose the number of port that you want to set.

When connect to 32DO device, you can choose number: 0 ~ 3

When connect to 16DI16DO device, you can choose number: 2~3

bData:It is used to set digital output 8 points which are specified by parameter bPortNo.

Return code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_CARD_ID:The parameter bCardID can’t correspond to the Motionnet board that

was found by operation system.

ERROR_INVALID_DEV_NO:The given device number is out of range value (0-63).

ERROR_SET_BYTENO:The parameter bPortNo setting is out of range.

Page 113: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

113

PISO-MN200 Function Reference V1.0

11.5 mn_get_line_status

VC6 / BCB6

short mn_get_line_status( BYTE bLineNo, WORD * pData )

Description:

This function gets the status of the specified Motionnet communication line. Bit 3(EIOE)

becomes 1 when an IO communication error occurs.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

pData:The pointer to the memory that stores the communication status is specified by bLineNo. The

16 Bits information as follows:

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

Reserved CAER ERAE EDTE EIOE IOPC BRKF CEND

Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8

Reserved DBSY RBSY SBSY Reserved RDBB TDBB REF

Symbol Value Describe

CEND 0 / 1 1: The motion control register communication is

complete and the next data can be sent

BRKF 0 / 1 1: Slave device receives a connection request

IOPC 0 / 1 1: Any input port which had enabled the “input change

interrupt setting” and that status changed

EIOE 0 / 1 1: IO device communication error occurred

EDTE 0 / 1 1: Motion control device communication error occurred

ERAE 0 / 1 1: IO device reception processing error occurred

CAER 0 / 1 1: A CPU access error occurred

REF 0 / 1 1: IO device output port date has not been sent yet

TDBB 0 / 1 1: Motion control register data is sending

RDBB 0 / 1 1: Motion control register data is receiving

SBSY 0 / 1 1: IO communication is starting

RBSY 0 / 1 1: Reset is starting

DBSY 0 / 1 1: Motion control register data is communicating

Return code:

Page 114: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

114

PISO-MN200 Function Reference V1.0

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

Page 115: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

115

PISO-MN200 Function Reference V1.0

11.6 mn_get_slave_error_table

VC6 / BCB6

short mn_get_slave_error_table ( BYTE bLineNo, DWORD* ErrorTable)

Description:

This function gets the flags of the communication error devices on the specified Motionnet

communication line.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

ErrorTable:The pointer to the DWORD-Array contains IO device number corresponded to the bit

number. ErrorTable[0] presents devices 0 ~31 and ErrorTable[1] presents devices 32 ~63.

When the IO communication error occurs, the number of the corresponding Bit will be set

to 1 until you call mn_clear_slave_error_flag () to clear it.

ErrorTable[0]

Bit31 Bit30 …… Bit15 …… Bit2 Bit1 Bit0

DevNo.31 DevNo.30 DevNo.2 DevNo.1 DevNo.0

ErrorTable[1]

Bit31 Bit30 …… Bit15 …… Bit2 Bit1 Bit0

DevNo.64 DevNo.63 DevNo.34 DevNo.33 DevNo.32

Return code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

Page 116: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

116

PISO-MN200 Function Reference V1.0

11.7 mn_clear_slave_error_flag

VC6 / BCB6

short mn_clear_slave_error_flag( BYTE bLineNo, DWORD* ErrorTable )

Description:

This function clears the flags of communication error device numbers which are stored in

register.

Parameters:

bLineNo:The specific line number is allocated by the card ID order which is configured with the

on-board Dip-Switch.

ErrorTable:When you want to clear the flags of communication error devices in the register, please

set the Bits values corresponding to devices. The pointer to the DWORD-Array contains

IO device number corresponded to the bit number. ErrorTable[0] presents devices 0 ~31

and ErrorTable[1] presents devices 32 ~63. The simplest way to clear flags is to set

ErrorTable that was read from mn_get_slave_error_table().

ErrorTable[0]

Bit31 Bit30 …… Bit15 …… Bit2 Bit1 Bit0

DevNo.31 DevNo.30 DevNo.2 DevNo.1 DevNo.0

ErrorTable[1]

Bit31 Bit30 …… Bit15 …… Bit2 Bit1 Bit0

DevNo.64 DevNo.63 DevNo.34 DevNo.33 DevNo.32

Return code:

SUCCESS:The function returns successfully.

ERROR_NO_CARD_FOUND:There is no active card available in your system.

ERROR_INVALID_LINE_NO:The given line number is invalid.

Page 117: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

117

PISO-MN200 Function Reference V1.0

APPENDIX A

Error Code

Label Value

SUCCESS 0

ERROR_NO_CARD_FOUND -100

ERROR_IOCTL_FAILED -101

ERROR_INVALID_LINE_NO -102

ERROR_COMM_NOT_START -103

ERROR_INVALID_DEV_NO -104

ERROR_NO_DEV_FOUND -105

ERROR_SET_IO_DEV -106

ERROR_SET_MOTION_DEV -107

ERROR_START_SPEED_EXCEED_DRIVING_SPEED -108

ERROR_INVALID_MAX_SPEED_SELECTION -109

ERROR_SET_START_SPEED_OUT_RANGE -110

ERROR_SET_DRIVING_SPEED_OUT_RANGE -111

ERROR_INVALID_SCURVE_ENABLE -112

ERROR_INVALID_ADC_MODE -113

ERROR_INVALID_ACC_DATA -114

ERROR_SET_ACC_DOUBLE_DEC -115

ERROR_SET_ACC_OUT_RANGE -116

ERROR_SET_DEC_OUT_RANGE -117

ERROR_SET_ACC_SECT_OUT_RANGE -118

ERROR_SET_DEC_SECT_OUT_RANGE -119

ERROR_SET_CORRECTION_SPD_OUT_RANGE -120

ERROR_SET_SCAN_INDEX_OUT_RANGE -121

ERROR_INVALID_COMM_SPEED -122

ERROR_COMM_NOT_STOP -123

ERROR_SET_DATA -124

Page 118: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

118

PISO-MN200 Function Reference V1.0

ERROR_INVALID_CONFIG_ITEM -125

ERROR_INVALID_FILTER_ITEM -126

ERROR_INVALID_SOFTWARE_LIMIT_SOURCE -127

ERROR_INVALID_STOP_MODE -128

ERROR_CONFLICT_WITH_VRING -129

ERROR_INVALID_MOVE_DIRECTION -130

ERROR_INVALID_HOME_MODE -131

ERROR_INVALID_EZ_COUNT -132

ERROR_MOVE_HOLD -133

ERROR_EMG_SIGNAL_ON -134

ERROR_ALM_SIGNAL_ON -135

ERROR_MEL_SIGNAL_ON -136

ERROR_PEL_SIGNAL_ON -137

ERROR_WAIT_INP -138

ERROR_WAIT_ERC -139

ERROR_WAIT_BACKLASH_CORRECT -140

ERROR_WAIT_PULSE_IN -141

ERROR_MOTION_NOT_COMPLETE -142

ERROR_INVALID_FIX_MOVE_MODE -143

ERROR_REGISTER_FULL -144

ERROR_INVALID_POSITION -145

ERROR_INVALID_GROUPNO -146

ERROR_INVALID_NUM_DEV -147

ERROR_GROUP_ALREADY_HOLD -148

ERROR_SET_ARC_FINISH_POS -149

ERROR_SET_BIT_DUMMY_DEV -150

ERROR_INVALID_DEV_HOLD -151

ERROR_GROUP_NOT_HOLD -152

ERROR_INVALID_VRING_SOURCE -153

ERROR_INVALID_VRING_VALUE -154

ERROR_INVALID_CMPTRIG_SOURCE -155

ERROR_INVALID_CMPTRIG_DIRECTION -156

ERROR_INVALID_CMPTRIG_PITCH -157

ERROR_MOTION_IS_COMPLETED -158

ERROR_INVALID_CARD_ID -159

ERROR_INVALID_OUTPUT_DATA -160

ERROR_INVALID_BITNO -161

ERROR_SET_BITNO -162

Page 119: PISO-MN200 Function Reference - ICP DAS · 2015-04-10 · PISO-MN200 Function Reference V1.0 ... 2.1.4 mn_close_all ... and Borland® BCB 6.0 samples to demonstrate the functions

119

PISO-MN200 Function Reference V1.0

ERROR_INVALID_BYTENO -163

ERROR_SET_BYTENO -164

ERROR_CARD_ID_DUPLICATED -165

ERROR_CONFIG_FILE_LOAD -166

ERROR_CONFIG_FILE_MATCH -167

ERROR_COMM_DISCONNECT -168

ERROR_INVALID_WORDNO -169

ERROR_SET_WORDNO -170