Cascade Driver for Hilscher Fieldbus CIF Cards: Version 4.1
Prev |  | Next

# activeLength

activeLength -- queries or sets the number of active bytes of a buffer.

## Synopsis

    (activeLength card_id buffer [nbytes])

## Parameters

`card_id`

  The target card ID (`0..3`).

`buffer`

  The ID of the buffer.

`nbytes`

  If specified, sets the number of bytes in the buffer that are active.

## Returns

`OK` if successful.

## Description

This command queries or sets the number of bytes of a buffer that are active (actually transferred to the fieldbus card buffers). The command improves performance, since it would be wasteful to copy a complete card buffer (512 bytes for 2K cards or 3.5Kbytes for 8K cards) where the system only contained a handful of devices. The default minimum for all buffers is 32 bytes, which is adequate for most small systems. If the digital or analog commands are used to create points, the active length is automatically increased based on the point address. A single point at the highest address is enough to guarantee that the necessary portion of the buffer is transferred. The activeLength command provides an explicit alternative to specify the buffer length.

Each of the input and output buffers maintains a separate active length. If using a point to set the active length, the point's address and read/write mode will dictate which buffer is effected. A point with a `W` or `RW` mode will always be associated with the output buffer (buffer `0`). A second point with an address specifying buffer `1` and an `R` mode will be required to set the active length of the input buffer.

| The number of bytes that are actually transferred through the fieldbus is determined by the card configuration, which must agree with the block sizes presented by the field devices. These lengths should be the same as the active length.

## Example

The following example sets the number of active bytes in buffer `0` of card `0` to `128`.

        (activeLength 0 0 128)

Prev | Home | Next
Command Reference | Up | add

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