defineSegment

defineSegment -- defines the attributes of a buffer segment.

Synopsis

       
(defineSegment card_id buffer type read_write_mode offset length )
	

Parameters

card_id

The ID of the card.

buffer

The ID of the buffer.

type

The type of data in the segment, either a point type code, or one of the following: analog, digital, integer, real, string.

read_write_mode

R, W, or RW (case-insensitive) to specify the group as read-only, write-only, or read-write respectively.

offset

The starting address of a segment within the specified card_id:buffer.

length

The length of the segment in bytes.

Returns

OK if successful, otherwise, if missing, invalid or out of range parameters are found, then

    (error error_string)

Description

This command defines the attributes of a segment block within a buffer. Each segment defined has a specific type, location and size. Segment attributes are described in more detail in the Overview section of this document. This command is normally used during configuration so that the driver can publish configuration information to clients via the describeBuffer command.

Example

The following two commands define a segment containing analog input data in the first 4 bytes of card 0, buffer 0, and an 8-byte segment containing digital output data started at byte 32 of card 0, buffer 1.

    (defineSegment 0 1 analog r 0 4)
    (defineSegment 0 0 digital w 32 8)
      

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