segmentDefine
segmentDefine — defines the attributes of a buffer
segment.
Synopsis
(segmentDefine 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 Segment Attributes part of 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 segmentDescribe
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.
(segmentDefine 0 1 analog r 0 4)
(segmentDefine 0 0 digital w 32 8)