DataSource for C SDK  7.0.2.308582
Configuration: Fields

A set of fields makes up a data object or an update to an object. Standard record objects are made up of fields, whereas other types of data may store data in a different way.

Note:While fields can be represented by either a field number or a field name, DataSource uses field numbers to send data updates. However, if field names are configured it is possible to use the names by utilising the ds_add_record set of functions instead of the ds_add_data functions (see Publishing Record Data and Creating Data Objects).

add-field

Type: Function
Default: None

Defines a field number/name mapping.

Format:

add-field FieldName FieldNumber FieldFlags [FieldFlagsData]
Name Type Default Field Format
FieldName string [no default] The name of the field
FieldNumber integer [no default] The number of the field. This must be in the range -65535 to 65535.
FieldFlags integer 0 The flags passed by the field.
FieldFlagsData integer -1 Additional data (specifies the number of decimal places the field uses when FieldFlags is set to 256 or the type of field when FieldFlags is set to 512).
FieldFormat integer [none] Defines the formatting of values added to this field.
Note
There is no need to add fields unless the application is using text-based field names.

The table below shows the acceptable values of FieldFlags and the corresponding meanings of FieldFlagsData and FieldFormat. FieldFlags can be represent by either a text string or an integer.

These strings may be ORed together using the "|" operator to represent multiple flags: for example "type3|dp" means a field is type3 and uses the decimal point precision mode.

FieldFlags (text) FieldFlags (integer) Description FieldFlagsData FieldFormat
type2
index
1 Identifies the field as a Type 2 index Not Used Not Used
type2 2 Identifies the field as a Type 2 field Not Used Not Used
type3 4 Identifies the field as a Type 3 field Not Used Not Used
dp
decimal_precision
256 Decimal point precision mode Number of decimal places Not Used
fmt
format
512 Format mode Field type Format string (eg "%%.12g")
fmt_id
format_id/td>
1024 Format set mode Not Used Name of format set as specified using add-field-format

The table below lists the field types that can be used in FieldsFlagsData when in Format mode (FieldFlags = 512)

Type Description
1 32 bit float
2 64 bit float
3 8 bit integer
4 16 bit integer
5 32 bit integer
6 64 bit integer

fields-float32-fmt

Type: String
Default: %.8g

Format for float32 types

fields-float64-fmt

Type: String
Default: %.12g

Format for float64 types

fields-int8-fmt

Type: String
Default: %hhd

Format for int8 types

fields-int16-fmt

Type: String
Default: %hd

Format for int16 types

fields-int32-fmt

Type: String
Default: %ld

Format for int32 types

fields-int64-fmt

Type: String
Default: %lld

Format for int64 types

Configuration group add-field-format

This option defines sets of format strings which can be used by the add-field option. The formats defined will only work with the functions details in Publishing Record Data.

Format:

add-format
name [value]
    float32-fmt [value]
    float64-fmt [value]
    int8-fmt    [value]
    int16-fmt   [value]
    int32-fmt   [value]
    int64-fmt   [value]
end format

name

Type: String
Default: None

Name of this format set

float32-fmt

Type: String
Default: None

Format string for 32 bit floats

float64-fmt

Type: String
Default: None

Format string for 64 bit floats

int8-fmt

Type: String
Default: None

Format string for 8 bit integers

int16-fmt

Type: String
Default: None

Format string for 16 bit integers

int32-fmt

Type: String
Default: None

Format string for 32 bit integers

int64-fmt

Type: String
Default: None

Format string for 64 bit integers

numeric-locale

Type: String
Default: None

Locale for numeric field formatting


Generated on Wed Feb 22 2017 11:09:13 for DataSource for C SDK