National Instruments 321645c-01 用户手册

下载
页码 554
Chapter 2
Function Reference — GPCTR_Change_Parameter
©
 National Instruments Corporation
2-207
NI-DAQ FRM for PC Compatibles
Software Control
This function lets you customize the counter for your application. You can use this function 
after the 
GPCTR_Set_Application
 function, and before 
GPCTR_Control
 function with 
action = 
ND_PREPARE
 or action = 
ND_PROGRAM
. You can call this function as many times as 
you need to.
The software up or down control is available by default; if you do not use the 
GPCTR_Change_Parameter
 function with paramID set to 
ND_UP_DOWN
, the counter is 
configured for the software up or down control and starts counting up. To make the counter 
use the software up or down control and start counting down, use the 
GPCTR_Change_Parameter
 function with the paramID set to 
ND_UP_DOWN
 and the 
paramValue set to 
ND_COUNT_DOWN
. To change the counting direction during counting, use 
the 
GPCTR_Control
 function with the action set to 
ND_COUNT_UP
 or 
ND_COUNT_DOWN
.
Hardware Control
To use hardware to control the counting direction, use I/O connector lines as shown in 
Table 2-29; the counter will count down when the I/O line is in the low state and up when it 
is in the high state. Use the 
GPCTR_Change_Parameter
 function with the paramID set to 
ND_UP_DOWN
 and the paramValue set to 
ND_HARDWARE
 to take advantage of this counter 
feature.
paramID = 
ND_BUFFER_MODE
 (6602 and 455devices only)
Corresponding legal values for paramValue are shown below:
ND_SINGLE
 
for single buffer operations.
ND_DOUBLE
 for continuous buffer operation.
Table 2-29.  Default Up/Down Selection
gpctrNum
E Series Devices
6602 Devices
455X Devices
ND_COUNTER_0
Digital I/O Line 6
ND_PFI_37
ND_PFI_29
ND_COUNTER_1
Digital I/O Line 7
ND_PFI_33
ND_PFI_25
ND_COUNTER_2
N/A
ND_PFI_29
N/A
ND_COUNTER_3
N/A
ND_PFI_25
N/A
ND_COUNTER_4
N/A
ND_PFI_21
N/A
ND_COUNTER_5
N/A
ND_PFI_17
N/A
ND_COUNTER_6
N/A
ND_PFI_13
N/A
ND_COUNTER_7
N/A
ND_PFI_9
N/A