
Detailed code as below:
'====='Step 1 Driver init
If
Not
Driver_Open
Then
i8094MF.i8094MF_REGISTRATION(cardNo, 1)
Driver_Open =
True
End
If
'====='Step 2 CONFIG IO
i8094MF.i8094MF_RESET_CARD(cardNo)
i8094MF.i8094MF_SET_PULSE_MODE(cardNo, AXIS_XYZU, 2)
'set the pulse output mode
i8094MF.i8094MF_SET_ALARM(cardNo, AXIS_XYZU, 0, 0)
'disable the SERVO ALARM Input
i8094MF.i8094MF_SET_ENCODER(cardNo, AXIS_XYZU, 0, 0, 0)
'set the encoder input type
i8094MF.i8094MF_SET_MAX_V(cardNo, AXIS_XYZU, Convert.ToUInt32(16000))
'set the max speed for XYZU
i8094MF.i8094MF_EXD_DISABLE(cardNo, AXIS_XYZU)
'set the external input Off
i8094MF.i8094MF_SET_LP(cardNo, AXIS_XYZU, 0)
'set the Logic position =0
i8094MF.i8094MF_SET_EP(cardNo, AXIS_XYZU, 0)
'set the Encoger position =0
i8094MF.i8094MF_SET_A(cardNo, AXIS_XYZU, Convert.ToUInt32(1000))
'set the Acc =1000
i8094MF.i8094MF_SERVO_ON(cardNo, AXIS_XYZU)
'set the Servo_ON to servo motors
'======'Step 3 Check ERROR
Dim
KK
As
Long
= 0
KK = i8094MF.i8094MF_GET_ERROR(cardNo)
Dim
MSGG
As
String
If
(KK <> YES)
Then
'No ERROR: Step 4 Move X axis
Dim
axis
As
UInt16 = AXIS_X
'for AXIS_X it can be to AXIS_XYZU
i8094MF.i8094MF_SET_MAX_V(cardNo, axis, Convert.ToUInt32(20000))
i8094MF.i8094MF_NORMAL_SPEED(cardNo, axis, Convert.ToUInt16(0))
'set axis as Symmetrical T curve
mode
i8094MF.i8094MF_SET_V(cardNo, axis, Convert.ToUInt32(20000))
'set v=10000 PPS
i8094MF.i8094MF_SET_A(cardNo, axis, Convert.ToUInt32(100000))
'set acc=100000 PPS/S
i8094MF.i8094MF_SET_SV(cardNo, axis, Convert.ToUInt32(10))
'set start speed=1000 PPS
i8094MF.i8094MF_SET_AO(cardNo, axis, 0)
'set offset pulse (at SV speed)= 0 PS
i8094MF.i8094MF_FIXED_MOVE(cardNo, axis, 10000)
'run the fixed 10000 Pulse move.
Do
While
(i8094MF.i8094MF_STOP_WAIT(cardNo, axis) = NO)
i8094MF.system.DoEvents()
System.Threading.Thread.Sleep(1)
'wait for axis to stop
Loop
Dim
AA
As
Long
= i8094MF.i8094MF_GET_LP(cardNo, axis)
'Get X Now position
Else
http:/www.icpdas.com I8094Getting Started ManualVer.2.3 2008/4/28
55