User`s guide

PCIS-DASK Application Hints ? 25
4.3.1 One-Shot Digital input programming Scheme
This section described the function flow typical of non-buffered single-point digital input readings. While performing one-
shot DI operation, the devices whose I/O port can be set as input or out put port (PCI-7248 and PCI7296) need to
include port configuration function at the beginning of your application.
[Example Code Fragment]
card = Register_Card(PCI_7248, card_number);
//port configured
DIO_PortConfig(card ,Channel_P1A, INPUT_PORT);
DIO_PortConfig(card, Channel_P1B, INPUT_PORT);
DIO_PortConfig(card, Channel_P1CL, INPUT_PORT);
DIO_PortConfig(card, Channel_P1CH, INPUT_PORT);
//DI operation
DI_ReadPort(card, Channel_P1A, &inputA);
Release_Card(card);
4.3.2 Synchronous Continuous Digital input programming Scheme
This section described the function flow typical of synchronous digital input operation. While performing continuous DI
operation, the DI configuration function has to be called at the beginning of your application. In addition, for
synchronous DI, the SyncMode argument in continuous DI functions has to be set as SYNCH_OP.
DI_xxxx_Config
(
xxxx means the card type,
e.g. DI_7200_Config
)
DI_ContReadPort /
DI_ContReadPortToFile
With SyncMode=SYNCH_OP
[Example Code Fragment]
card = Register_Card(PCI_7200, card_number);
DI_7200_Config(card,TRIG_INT_PACER, DI_NOWAITING, DI_TRIG_FALLING, IREQ_FALLING);
DI_AsyncDblBufferMode (card, 0); //non-double-buffered mode
DI_ContReadPort(card, 0, pMem, data_size, (F64)sample_rate, SYNCH_OP)
DIO_PortConfig
(Only needed by PCI-
7248, PCI-7249 and PCI-
7296 cards)
Input data form Line?
Yes No
DI_ReadLine DI_ReadPort
Another reading ?
Yes
No
Port configured as
input port