Pulse I/O. ADLINK Technology PCI-8136M

Add to My manuals
107 Pages

advertisement

Pulse I/O. ADLINK Technology PCI-8136M | Manualzz

5.8 Pulse I/O

@ Name

_8136_P_Set_Output_Type - Set pulse output mode

_8136_P_Set_Input_Type - Set pulse input mode

_8136_P_Read - Read encoder counter

_8136_P_Clear - Clear encoder counter

_8136_P_Send - Send a constant pulse train

_8136_P_Stop - Stop pulse train

_8136_P_Change_Speed - Change pulse train frequency

_8136_P_Read_Index - Read index value

_8136_P_Set_Index_Latch - Set index latch type

_8136_P_Read_Latch_Value - Read a latched encoder data

_8136_P_Set_Compare_Value - Set a encoder compare data

@ Description

_8136_P_Set_Output_Type:

There are 3 pulse output types in PCI-8136. This function is for configuring pulse output type by a value. Write a value 0 is for pulse/direction type. Write a value 1 is for CW/CCW type. Write a value 2 is for A/B phase type.

_8136_P_Set_Input_Type

There are 3 encoder counter input types in PCI-8136. This function is for configuring encoder counter input type. Write a value

0 is for A/B phase type. Write a value 1 is for CW/CCW type. Write a value 2 is for pulse/direction type. When setting A/B phase type, user must assign the multiplier value by this function.

_8136_P_Read

This function is for reading the 32-bits encoder counter value immediately. There are six encoder counters in one card. Assign the channel value 0~5 to read the encoder counter individually.

There are three internal counters for receiving pulse output command. When pulse output channel 0~2 is working, their output value will send to both CN1 and internal feedback counter. These three command feedback counters are at channel 6~8. If the channel parameter of this function is assigned as the above three channels, it will read the command value at the same time.

Motion Libra

• 77

_8136_P_Clear

This function is for clearing the encoder counter value to zero immediately.

_8136_P_Send

This function is for sending a fixed frequency pulse train of each channel. It will output a pre-configured pulse format which is set by

P_Set_Output_Type().

_8136_P_Stop

This function is for stopping the output pulse for each channel.

_8136_P_Change_Speed

This function is for changing the output pulse frequency on line.

_8136_P_Read_Index

There are 6 index signal input in one PCI-8136. This function is for checking the index status on or off. Each bit of this status value represents a index status.

_8136_P_Set_Index_Latch

The index signal is also a trigger source for latching the respective encoder counter value. There are two modes for this latch. Set 0 to be first trigger latch and set 1 to be last trigger latch. First trigger latch means only trigger once and last trigger latch means latch every time if index signal comes.

_8136_P_Read_Latch_Value:

Once the encoder counter is latched. Use this function can get the counter value at latched moment. It will not be clear until next index latched signal is coming.

_8136_P_Set_Compare_Value

There are 6 encoder counters in PCI-8136. Each encoder can set a compare value individually. This compare value is also a 32-bits value.

@ Syntax

C/C++ (DOS, Windows 95/98/NT/2000)

I16 _8136_P_Set_Output_Type(I16 CardNo, I16 ChannelNo, I16

PulseFmt);

I16 _8136_P_Set_Input_Type(I16 CardNo, I16 EncNo, I16

EncFmt, I16 Mul);

I16 _8136_P_Read(I16 CardNo, I16 EncNo, I32 *EncData );

I16 _8136_P_Send(I16 CardNo,I16 ChannelNo,F64 FrqL);

I16 _8136_P_Stop(I16 CardNo,I16 ChannelNo);

I16 _8136_P_Clear(I16 CardNo, I16 EncNo);

I16 _8136_P_Set_Compare_Value(I16 CardNo,I16 EncNo, I32

CompValue);

78

• Motion Library

I16 _8136_P_Read_Latch_Value(I16 CardNo, I16 EncNo, I32

*Value)

I16 _8136_P_Set_Index_Latch(I16 CardNo, I16 WhichIndex, I16

Type);

I16 _8136_P_Read_Index(I16 CardNo, I16 AxisNo, I16 *Index);

I16 _8136_P_Change_Speed(I16 CardNo,I16 AxisNo,F32 Frq);

Visual Basic 5.0 or higher

B_8136_P_Initial (ByVal CardNo As Integer) As Integer

B_8136_P_Set_Output_Type (ByVal CardNo As Integer, ByVal

AxisNo As Integer, ByVal PulseFmt As Integer) As Integer

B_8136_P_Set_Input_Type (ByVal CardNo As Integer, ByVal

EncNo As Integer, ByVal EncFmt As Integer, ByVal Mul As

Integer) As Integer

B_8136_P_Read (ByVal CardNo As Integer, ByVal EncNo As

Integer, EncData As Long) As Integer

B_8136_P_Send (ByVal CardNo As Integer, ByVal AxisNo As

Integer, ByVal FrqL As Double) As Integer

B_8136_P_Stop (ByVal CardNo As Integer, ByVal AxisNo As

Integer) As Integer

B_8136_P_Clear (ByVal CardNo As Integer, ByVal EncNo As

Integer) As Integer

B_8136_P_Set_Compare_Value (ByVal CardNo As Integer,

ByVal EncNo As Integer, ByVal CompValue As Long) As

Integer

B_8136_P_Read_Latch_Value(ByVal CardNo As Integer, ByVal

EncNo As Integer, Value As Long) As Integer

B_8136_P_Set_Index_Latch (ByVal CardNo As Integer, ByVal

WhichIndex As Integer, ByVal LatchType As Integer) As

Integer

B_8136_P_Read_Index (ByVal CardNo As Integer, ByVal AxisNo

As Integer, Index As Integer) As Integer

B_8136_P_Change_Speed (ByVal CardNo As Integer, ByVal

AxisNo As Integer, ByVal Frq As Single) As Integer

@ Argument

CardNo: card number designated to set (Range 0 ~ 3)

ChannelNo: channel number designated to set (Range 0 ~ 6)

EncNo: encoder channel number designated to set (Range 0 ~ 6)

PulseFmt: Output pulse format

0 = Pulse/Direction

1 = CW/CCW

2 = A/B Phase

EncFmt: Input pulse format:

0 = A/B Phase

1 = CW/CCW

2 = Pulse/Direction

Motion Libra

• 79

Mul: for A_B type's mutiplier

0 = 0X A_B Phase

1 = 1X A_B Phase

2 = 2X A_B Phase

3 = 4X A_B Phase

EncData: read back encoder data

FrqL: Pulse output frequency (Range 0~500k Hz)

CompValue: Encoder Compare Value

*Index: Index Status (0 or 1)

Type: two trigger latch mode: 0 for first trigger, 1 for last trigger

WhichIndex: select index no. (0~5)

Frq: Pulse output frequency for change (Range 0~500k Hz)

@ Return Code

ERR_RangeError

ERR_PCIBiosNotExist

ERR_NoError

80

• Motion Library

advertisement

Related manuals

advertisement

Table of contents