DR_ApWriteControl

Cogent API and Utilities: Version 4.1
Prev |  | Next

# `DR_ApWriteControl`

`DR_ApWriteControl` -- sends card control information to the driver.

## Syntax

``int DR_ApWriteControl`(int card_id, int buffer, unsigned short offset, unsigned short size, void * control, char ** error);`

## Arguments

`card_id`

  The ID of the card to be written with status.

`buffer`

  The ID of the target status buffer (if applicable).

`offset`

  The starting (byte) address of the status data within the specified card buffer (if applicable).

`size`

  The maximum number of bytes to be written.

`control`

  A pointer to a card-dependent structure (at least `size` bytes long) that contains the status information for the card.

`error`

  The address of a string pointer. In case of error (non-zero return), the string pointer is set to the corresponding error description string. The error string is contained in a static buffer and remains valid only until the next API call. The parameter may be `NULL` if no error string is required.

## Returns

The integer value `0` if the function was successful, otherwise one of the following error codes:

        DR_API_IPC_ERRORS
        DR_ERR_DEV_INVALID
        DR_ERR_BLK_INVALID
        DR_ERR_BLK_OFS_INVALID
        DR_ERR_BLK_SIZE_INVALID
        DR_ERR_CMD_INVALID

## Description

This function sends card control information to the driver. The control data is dependent on the card.

## Example

        cif_ApParms_t	control;

        control.Mode = mode;
        control.CycleTime = ms;
        control.Format = fmt;
        DR_ApWriteControl (0, 2, 0, sizeof (cif_ApParms_t),
                           &control_parms, NULL );

## See Also

Hilscher Fieldbus Card Control API

Prev | Home | Next
`DR_ApWriteBlock` | Up | `DR_ApWritePoint`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.