User`s manual
56 Application Hints
PCIS-DASK
Digital Input Programming Hints
One-Shot Digital Input
This section describes the function flow typical of non-buffered sin-
gle-point digital input readings. While performing one-shot DI
operation, devices whose I/O port can be set as input or output
port (PCI-7248, PCI-7296, and PCI-7442) need to include port
configuration function at the beginning of the application.
Example code fragments:
NO
DI_ReadLineDI_ReadPort
Input data from line?
DIO_PortConfig
[only on PCI-7248, PCI-7249, PCI-7296 and PCI-7442 (TTL)]
DIO_LineConfig (only on PCI-7442 [TTL])
DIO_LinesConfig (only needed by PCI-7442 [TTL])
NO YES
YES
Another reading?
Line/Port configured
as input port
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);