@WSAR1-V1@@COMMENT@Enable stepping motor output@DPS@ 2)b[:Us_~d@~=Y *kyDͽpٍ!bUB:-KR{E:-K\smPy& yRdUͽpٍ!|YqBM=Y *krS`YM=U~Us_~@NOTE@STP_en Enable stepping output function for parallel output boards Each axis contains 4 output channels. Please wire Axis 1: A --> Ch.1 , B --> Ch.2 , A_ --> Ch.3 , B_ --> Ch.4 Axis 2: A --> Ch.5 , B --> Ch.6 , A_ --> Ch.7 , B_ --> Ch.8 Example: Demo_58 *** Up to 2 axes at the same slot can be used in one controller. *** The STP_en & STP_en2 output is not controlled by the ISaGRAF cycle engine, it is controlled by the interrupt rountine of the driver. *** Target : 8417/8817/8437/8837 (Rev.2.37 or above) *** *** Boards : 8041, 8042, 8054, 8055, 8056, 8057 *** call: SLOT_ : Integer Which slot ? 0 - 7 for I-8417/8817/8437/8837 AXIS_ : Integer Which axis ? 1 - 2 , AXIS 1: (Ch.1 - Ch.4), AXIS 2: (Ch.5 - Ch.8) MODE_ : Integer Which mode ? ( 1 - 3 ) Mode 1: (A, B, A_, B_) = (1, 0, 0, 0) --> (0, 1, 0, 0) --> (0, 0, 1, 0) --> (0, 0, 0, 1) Mode 2: (A, B, A_, B_) = (1, 1, 0, 0) --> (0, 1, 1, 0) --> (0, 0, 1, 1) --> (1, 0, 0, 1) Mode 3: (A, B, A_, B_) = (1, 0, 0, 0) --> (1, 1, 0, 0) --> (0, 1, 0, 0) --> (0, 1, 1, 0) --> (0, 0, 1, 0) --> (0, 0, 1, 1) --> (0, 0, 0, 1) --> (1, 0, 0, 1) MS_ : Integer Step interval time, 1 - 1000, unit is ms. For ex. set as 5 means running 200 steps/sec. DIR_ : Boolean True: positive direction, False: opposite direction return: Q_ : Boolean TRUE: Ok , FALSE: wrong input parameters, or the associate output channel is not found. Note: 1. Up to 2 axes at the same slot can be used in one controller. 2. Do not enable the same axis to different slot. ICP DAS , Taiwan Nov.04,2003 @PARAM@6#AQ_ @SRC@/* user procedure name: array_r */ #include #include void USP_array_r (str_arg *arg) { } UFP uspdef_array_r (char *name) { sys_strcpy (name, "ARRAY_R"); return (USP_array_r); } @DEFS@l/* user procedure interface name: stp_en */ typedef long T_BOO; typedef long T_ANA; typedef float T_REAL; typedef long T_TMR; typedef char *T_MSG; typedef struct { /* CALL */ T_ANA _slot_; /* CALL */ T_ANA _axis_; /* CALL */ T_ANA _mode_; /* CALL */ T_ANA _ms_; /* CALL */ T_BOO _dir_; /* RETURN */ T_BOO _q_; } str_arg; #define SLOT_ (arg->_slot_) #define AXIS_ (arg->_axis_) #define MODE_ (arg->_mode_) #define MS_ (arg->_ms_) #define DIR_ (arg->_dir_) #define Q_ (arg->_q_) @END@