V4 DB Record Instance Syntax
From EPICSWIKI
Revision as of 23:52, 16 May 2005 by AndrewJohnson (talk | contribs)
The syntax used for record instances has to change in EPICS V4, since we now have to support structured data. While it would have been possible to modify the V3 syntax to allow for this, a complete redesign of the syntax has been done to help improve parsing, and to provide commonality between the syntax of a DB file and the string representation of structured data values passed through Channel Access.
Record Instances
A record instance loaded from a DB file has the following syntax:
# comment recordType recordName = { fieldName = fieldValue; structFieldName = { fieldName = fieldValue; .. } structFieldName = { fieldValue, fieldValue, .. } structFieldName = { structFieldName = { .. } } arrayFieldName = { arrayValue, arrayValue, .. } arrayFieldName = type { arrayValue, arrayValue, .. } arrayFieldName = [size, ..] { { arrayValue, arrayValue, .. }, { .. } .. } arrayFieldName = type [size, ..] { arrayValue, arrayValue, .. } linkFieldName = linkName { linkValue } deviceFieldName = deviceName { deviceValue } info infoName = "infoString"; add varFieldName = { {fieldName,interfaceName,choiceName,{dataStructValue}}, ... } ... }
where
- recordType
- The name of the record type
- recordName
- The name of the record instance.
- Q: What restrictions will we place on record instance name? Can this contain non-ascii characters? That is will UTF-8 instance names be supported?
- info name
- provide info for field
- fieldName
- The field name.
- type
- One of the types bool,...,string. This is only specified if the record definition did not specify a type.
- capacities
- The capacities for an array. This can only be specified if the record definition did not define the number of dimensions or the capacities. It has the format:
- capacity,...
- The number of dimensions must agree with what record defined. For example if the record defined that array as array(<type>[]) then only one capacity can be specified. If a record defined array(<type>) than the record instance determines the number of dimensions and the capacities.
- choiceName
- This is for struct, link, and device fields. choiceName is a choice defined in a struct, link, or device definition.
- fieldValue
- The syntax depends on the field type. The details are described next..