Вы здесь

DlnPlsCntSetMode() Function

The DlnPlsCntSetMode() function is used to set mode and limit parameters of specified Pulse Counter port.

Syntax
C/C++
DLN_RESULT DlnPlsCntSetMode(
  HDLN handle, 
  uint8_t port,
  uint8_t mode, 
  uint32_t limit
);
Parameters
handle

A handle to the DLN-series adapter.

port

A number of the port to retrieve information about.

mode

Defines the mode parameter of the Pulse Counter port.

Pulse Counter Module Modes
Mode IdMode TitleMode Description

0

Free Run Mode

Pulses are counted continuously. You can suspend, resume or reset the counter and get the number of pulses at any time.

1

Time Based Mode

Pulses are counted during the user-defined time period. When the predefined time period (limit) is exceeded, the counting starts again from 0. The pulse counter can send a match event to PC if activated. The event contains the number of pulses detected during this period.

2

Pulse Based Mode

Pulses are counted until the number of pulses reaches the user-defined value (limit). Then the counting starts again from 0. The counter can send an event to PC if activated. The event contains time elapsed from the moment you started the counter.

limit

Defines the limit parameter of the Pulse Counter port.

Return Value
DLN_RES_SUCCESS (0x00)

The function successfully configured the Pulse counter port.

DLN_RES_INVALID_PORT_NUMBER (0xA8)

The port number is not valid. Use the DlnPlsCntGetPortCount() function to find the maximum possible port number.

DLN_RES_OVERFLOW (0xB5)

DLN_RES_BUSY (0xB6)

The function cannot configure the Pulse counter port while it is busy.

DLN_RES_INVALID_MODE (0xC7)

The mode value is not valid.

Remarks

The DlnPlsCntSetMode() function is defined in the dln_pls_cnt.h file.

Языки

Вход на сайт