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

# write

write -- writes a new value to a point.

## Synopsis

    (write point_name value [update])

## Parameters

`point_name`

  The name of an existing point.

`value`

  The ASCII representation of the value to be written, dependent on point type.

`update`

  (optional) If `t`, an attempt is made to update the output card after changing the point value. Otherwise, the the data is simply written to the point, and will be updated at the next card I/O cycle. See the Description (below) for details.

## Returns

`OK` if there are no errors. If an error occurs, due to invalid point name, point disabled, or point not writeable, then an error is returned formatted as follows:

        (error "write DR_ERR_PNT_NOT_FOUND (time) point not found: point_name")

        (error "write DR_ERR_PNT_NOT_ENABLED (time) point not enabled: point_name")

        (error "write DR_ERR_PNT_NOT_WRITEABLE (time) point not writeable: point_name")

If the optional `update` parameter is set to `t`, and an error is detected, the following is returned:

        (error "write DR_ERR_DEV_IO_FAILURE (time) I/O failure (-22) on device: point_addr_card_id")

This error usually signifies that the fieldbus is not active. This may be due to a connection or configuration problem.

## Description

This command writes a new value to the specified point. Output of point values to the field output cards depends on the specific card type. This command is typically sent as a command and not used in configuration file.

The transfer of data from the points to the driver buffers is dependent on the cardGroup command and the association of points with groups. Then the transfer of data from these buffers to the CIF card buffers (which is then sent to the field output device via the fieldbus) is dependent on the mode of the card, which can be either polled or interrupt-drcfiven (see the cardPoll and cardInit commands).

If the optional `update` parameter is `t`, and the card mode is polled, then:

- The new point value is written to the driver buffer.

- The card buffers are updated from these buffers (those specified by the point address).

## Example

        (write Light1 1)
        (write Speed 22.1)

Prev | Home | Next
version | Up | writable

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