API Documentation

System Design File

The System Design File (SDF) API provides an interface to read and write data to the PolySync SDF. The SDF defines the runtimes, hosts, and nodes that define a PolySync system. The SDF maintains a hierarchy where the parent can have one or more child at each level.

Todo: diagram: Runtime -> Host -> Node -> Node Config -> Sensor Config -> I/O Config

Usage #include <polysync_sdf.h>

Functions

psync_sdf_create_host_configuration ( … )

This will create a Host Configuration entry in the SDF.

psync_sdf_create_host_configuration expects the input to be pre-populated with data.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In/Out ps_sdf_host_configuration * const host_config A pointer to ps_sdf_host_configuration with the data to create in the SDF entry.
In const unsigned int autofill If PSYNC_SDF_AUTOFILL_ON (1), then this operation is applied to any child entities.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_create_io_configuration ( … )

This will create an IO Configuration entry in the SDF.

psync_sdf_create_io_configuration expects the input to be pre-populated with data.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In/Out ps_sdf_io_configuration * const io_config A pointer to ps_sdf_io_configuration with the data to create in the SDF entry.
In const unsigned int autofill If PSYNC_SDF_AUTOFILL_ON, then this operation is applied to any child entities.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_create_node_configuration ( … )

This will create a Node Configuration entry in the SDF.

psync_sdf_create_node_configuration expects the input to be pre-populated with data.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In/Out ps_sdf_node_configuration * const node_config A pointer to ps_sdf_node_configuration with the data to create in the SDF entry.
In const unsigned int autofill If PSYNC_SDF_AUTOFILL_ON (1), then this operation is applied to any child entities.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_create_parameter_value ( … )

This will create a Parameter Value entry in the SDF.

The function expects the input to be pre-populated with data.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In/Out ps_sdf_parameter_value * const param_value A pointer to ps_sdf_parameter_value with the data to create in the SDF entry.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_create_runtime_configuration ( … )

This will create a Runtime Configuration entry in the SDF.

The function expects the input to be pre-populated with data.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In ps_sdf_runtime_configuration * const runtime_config A pointer to ps_sdf_runtime_configuration with the data to create in the SDF entry.
In const unsigned int autofill If PSYNC_SDF_AUTOFILL_ON (1), then this operation is applied to any child entities.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_create_sensor_configuration ( … )

This will create a Sensor Configuration entry in the SDF.

psync_sdf_create_sensor_configuration expects the input to be pre-populated with data.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get SDF path; if NULL, uses system environment.
In ps_sdf_runtime_configuration * const sensor_config A pointer to ps_sdf_sensor_configuration with the data to create in the SDF entry.
In const unsigned int autofill If PSYNC_SDF_AUTOFILL_ON (1), then this operation is applied to any child entities.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_delete_host_configuration( … )

This will delete the Host Configuration entry in SDF.

psync_sdf_delete_host_configuration deletes a Host Configuration entry in SDF, and recursively deletes child entities.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get SDF path; if NULL, uses system environment.
In ps_sdf_sensor_configuration * const host_config A pointer to ps_sdf_sensor_configuration with the ID of the entry to delete.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_delete_io_configuration ( … )

psync_sdf_delete_io_configuration recursively deletes child entities.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In/Out ps_sdf_io_configuration * const io_config A pointer to ps_sdf_io_configuration with the ID of the entry to delete.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_delete_node_configuration ( … )

This will delete a Node Configuration entry in SDF.

psync_sdf_delete_node_configuration recursively deletes child entities.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In ps_sdf_node_configuration * const node_config A pointer to ps_sdf_node_configuration with the ID of the entry to delete.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_delete_parameter_value ( … )

This will delete a Parameter Value entry in SDF.

psync_sdf_delete_parameter_value recursively deletes child entities.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In ps_sdf_parameter_value * const param_value A pointer to ps_sdf_parameter_value with the ID of the entry to delete.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_delete_runtime_configuration ( … )

This will delete a Runtime Configuration entry in SDF.

psync_sdf_delete_runtime_configuration recursively deletes child entities.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In ps_sdf_runtime_configuration * const runtime_config A pointer to ps_sdf_runtime_configuration with the ID of the entry to delete.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_delete_sensor_configuration ( … )

This will delete a Sensor Configuration entry in SDF.

psync_sdf_delete_sensor_configuration recursively deletes child entities.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In ps_sdf_sensor_configuration * const sensor_config A pointer to ps_sdf_sensor_configuration with the ID of the entry to delete.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_get_all_runtime_configuration_ids ( … )

This will get the IDs of all of the runtime configurations.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
Out unsigned long * const runtime_ids A pointer to an array which receives runtime IDs.
In const unsigned int id_count The max number of IDs to return. Should be the size of the array pointed to by runtime_ids.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_get_dtc_description ( … )

This will get a DTC description from SDF.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In const unsigned long dtc The unique DTC of the requested description.
Out char * const buffer A char array within which to store a DTC description.
In const unsigned long buffer_len The maximum length to write into buffer.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_get_host_configuration ( … )

This will get the Host Configuration from the SDF.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In const unsigned long id The unique ID of the ps_sdf_host_configuration to be retrieved from SDF.
In ps_sdf_host_configuration * const autofill If PSYNC_SDF_AUTOFILL_ON (1), then this operation is applied to any child entities.
Out const unsigned int param_value A ps_sdf_host_configuration to be populated with SDF data.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_get_host_configuration_by_interface ( … )

This will get the SDF host configuration by interface address.

psync_sdf_get_host_configuration_by_interface reads all fields, and optionally all valid child fields, from an SDF.

It will select the last matching result with a matching interface address.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In const char * const address Interface address to lookup.
In ps_sdf_host_configuration * const autofill If PSYNC_SDF_AUTOFILL_ON (1), then this operation is applied to any child entities.
Out const unsigned int host_config A pointer to ps_sdf_host_configuration that receives the field values.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_get_host_configuration_count ( … )

This will get the count of Host Configurations from the SDF.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In const unsigned long runtime_configuration_id An unsigned long ID of the parent to the counted children.
Out unsigned int * const count A pointer to an unsigned integer to be set to the resulting count.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_get_host_configuration_ids ( … )

This will get the IDs of Host Configurations that belong to the specified Runtime Configuration.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In const unsigned long runtime_configuration_id The parent Runtime Configuration.
Out unsigned long * const id_array An array of unsigned longs within which to store the resulting IDs.
In const unsigned int host_config_count The maximum number of Host Configuration IDs to return. Should generally be size of the id_array.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_get_io_configuration ( … )

This will get the IO configuration from the SDF.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In ps_sdf_io_configuration * const id The unique ID of the ps_sdf_io_configuration to be retrieved from SDF.
In const unsigned autofill If PSYNC_SDF_AUTOFILL_ON (1), then this operation is applied to any child entities.
Out const unsigned int io_config A ps_sdf_io_configuration to be populated with SDF data.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_get_io_configuration_count ( … )

This will get a count of IO Configurations from the SDF.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In const unsigned long sensor_configuration_id An unsigned long ID of the parent to the counted children.
Out unsigned int * const count A pointer to an unsigned integer to be set to the resulting count.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_get_io_configuration_ids ( … )

This will get the IDs of IO Configurations that belong to the specified Sensor Configuration.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In const unsigned long sensor_configuration_id The parent Sensor Configuration.
Out unsigned long * const id_array An array of unsigned longs within which to store the resulting IDs.
In const unsigned int io_config_count The maximum number of IO Configuration IDs to return. Should generally be size of the id_array.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_get_node_configuration ( … )

This will get the Node configuration from the SDF.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In const unsigned long id The unique ID of the ps_sdf_node_configuration to be retrieved from SDF.
In ps_sdf_node_configuration * const autofill If PSYNC_SDF_AUTOFILL_ON (1), then this operation is applied to any child entities.
Out const unsigned int param_value A ps_sdf_node_configuration to be populated with SDF data.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_get_node_configuration_count ( … )

This will get the count of the Node Configurations from the SDF.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In const unsigned long host_configuration_id An unsigned long ID of the parent to the counted children.
Out unsigned int * const count A pointer to an unsigned integer to be set to the resulting count.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_get_node_configuration_ids ( … )

This will get the IDs of Node Configurations that belong to the specified Host Configuration.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In const unsigned long host_configuration_id The parent Host Configuration.
Out unsigned long * const id_array An array of unsigned longs within which to store the resulting IDs.
In const unsigned int node_config_count The maximum number of Node Configuration IDs to return. Should generally be size of the id_array.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_get_parameter_description ( … )

This will get the parameter description from the SDF.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In ps_parameter_id id The unique ID of the target parameter.
Out char * const buffer A char array within which to store parameter description.
In const unsigned long buffer_len The maximum length to write into buffer.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_get_parameter_value ( … )

This will get the parameter value from the SDF.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In const unsigned long id The unique ID of the ps_sdf_parameter_value to be retrieved from SDF.
Out ps_sdf_parameter_value * const param_value A ps_sdf_parameter_value to be populated with SDF data.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_get_parameter_value_count (…)

This will get the parameter value count from the SDF.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In const unsigned long parameter_list_id An unsigned long ID of the parameter list to be counted.
Out unsigned int * const count A pointer to an unsigned integer to be set to the resulting count.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_get_parameter_value_ids ( … )

This will get the parameter value IDs with the common parameter list ID.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In const unsigned long parameter_list_id The common parent ID shared among resulting set.
Out unsigned long * const id_array An array of unsigned longs within which to store the resulting IDs.
in const unsigned int param_value_count The maximum number of parameter value ids to return. Should generally be size of the id_array.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) entry successfully created
    • DTC_CONFIG - Creation failed due to a SQL error

psync_sdf_get_runtime_configuration ( … )

This will get the SDF Runtime Configuration by ID.

psync_sdf_get_runtime_configuration reads all fields, and optionally all valid child fields, from a SDF.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In const unsigned long id SDF ID to lookup.
In ps_sdf_runtime_configuration * const autofill If PSYNC_SDF_AUTOFILL_ON (1), then this operation is applied to any child entities.
Out const unsigned int runtime_config A pointer to ps_sdf_runtime_configuration that receives the field values.
Returns

psync_sdf_get_runtime_configuration_count ( … )

This will get the count of Runtime Configurations from the SDF.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
Out unsigned int * const count A pointer to an unsigned integer to be set to the resulting count.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) count successfully retrieved
    • DTC_CONFIG - Count was not retrieved due to a SQL error

psync_sdf_get_sensor_configuration ( … )

This will get the Sensor Configuration from the SDF.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In const unsigned long id The unique ID of the ps_sdf_sensor_configuration to be retrieved from SDF.
In ps_sdf_sensor_configuration * const* autofill If PSYNC_SDF_AUTOFILL_ON (1), then this operation is applied to any child entities.
Out const unsigned int sensor_config A ps_sdf_sensor_configuration to be populated with SDF data.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) count successfully retrieved
    • DTC_CONFIG - Count was not retrieved due to a SQL error

psync_sdf_get_sensor_configuration_count ( … )

This will get the count of Sensor Configurations from the SDF.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In const unsigned long node_configuration_id An unsigned long ID of the parent to the counted children.
Out unsigned int * const count A pointer to an unsigned integer to be set to the resulting count.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) count successfully retrieved
    • DTC_CONFIG - Count was not retrieved due to a SQL error

psync_sdf_get_sensor_configuration_ids ( … )

This will get the IDs of Sensor Configurations that belong to the specified Node Configuration.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, uses system environment.
In const unsigned long node_configuration_id The parent Node Configuration.
Out unsigned long * const id_array An array of unsigned longs within which to store the resulting IDs.
In const unsigned int sensor_config_count The maximum number of Sensor Configuration IDs to return. This should generally be the size of the id_array.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) count successfully retrieved
    • DTC_CONFIG - Count was not retrieved due to a SQL error

psync_sdf_get_sensor_descriptor ( … )

This will get the Sensor Descriptor from SDF.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL, it uses the system environment.
In const ps_sensor_kind sensor_type The unique ps_sensor_kind of the ps_sdf_sensor_descriptor to be retrieved from SDF.
Out ps_sdf_sensor_descriptor * const sensor_descriptor A ps_sdf_sensor_descriptor to be populated with SDF data.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) count successfully retrieved
    • DTC_CONFIG - Count was not retrieved due to a SQL error

psync_sdf_release_host_configuration ( … )

This will release a SDF Host Configuration and its resources.

psync_sdf_release_host_configuration releases any child owned resources if needed.

Parameters
In/Out Type Name Description
In ps_sdf_host_configuration * const host_config A pointer to ps_sdf_host_configuration that gets released.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) count successfully retrieved
    • DTC_CONFIG - Count was not retrieved due to a SQL error

psync_sdf_release_io_configuration ( … )

This will release a SDF IO Configuration and its resources.

psync_sdf_release_io_configuration releases any child owned resources if needed.

Parameters
In/Out Type Name Description
In ps_sdf_io_configuration * const io_config A pointer to ps_sdf_io_configuration that gets released.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) count successfully retrieved
    • DTC_CONFIG - Count was not retrieved due to a SQL error

psync_sdf_release_node_configuration ( … )

This will release a SDF Node Configuration and its resources.

psync_sdf_release_node_configuration releases any child owned resources if needed.

Parameters
In/Out Type Name Description
In ps_sdf_node_configuration * const node_config A pointer to ps_sdf_node_configuration that gets released.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) count successfully retrieved
    • DTC_CONFIG - Count was not retrieved due to a SQL error

psync_sdf_release_parameter_value ( … )

This will release a SDF parameter value and its resources.

psync_sdf_release_parameter_value releases any child owned resources if needed.

Parameters
In/Out Type Name Description
In ps_sdf_parameter_value * const parameter_value A pointer to ps_sdf_parameter_value that gets released.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) count successfully retrieved
    • DTC_CONFIG - Count was not retrieved due to a SQL error

psync_sdf_release_runtime_configuration ( … )

This will release a SDF Runtime Configuration and its resources.

psync_sdf_release_runtime_configuration releases any child owned resources if needed.

Parameters
In/Out Type Name Description
In ps_sdf_runtime_configuration * const runtime_config A pointer to ps_sdf_runtime_configuration that gets released.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) count successfully retrieved
    • DTC_CONFIG - Count was not retrieved due to a SQL error

psync_sdf_release_sensor_configuration ( … )

This will release a SDF Sensor Configuration and its resources.

psync_sdf_release_sensor_configuration releases any child owned resources if needed.

Parameters
In/Out Type Name Description
In ps_sdf_sensor_configuration * const sensor_config A pointer to ps_sdf_sensor_configuration that gets released.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) count successfully retrieved
    • DTC_CONFIG - Count was not retrieved due to a SQL error

psync_sdf_release_sensor_descriptor ( … )

This will release a SDF sensor descriptor and its resources.

psync_sdf_release_sensor_descriptor releases any child owned resources if needed.

Parameters
In/Out Type Name Description
In ps_sdf_sensor_descriptor * const sensor_descriptor A pointer to ps_sdf_sensor_descriptor that gets released.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) count successfully retrieved
    • DTC_CONFIG - Count was not retrieved due to a SQL error

psync_sdf_reset_schema ( … )

This will reset a SDF schema.

psync_sdf_reset_schema can be used to restore or create a new SDF. It does not modify existing data.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get the SDF path. If NULL, it uses the system environment.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) count successfully retrieved
    • DTC_CONFIG - Count was not retrieved due to a SQL error
    • DTC_IOERR - Reset failed because could not create/access SDF file

psync_sdf_set_parameter_description ( … )

This will set the parameter description in a SDF.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get a SDF path. If NULL it uses the system environment.
In ps_parameter_id id The ps_parameter_id of the parameter to be set.
In ps_parameter_value_kind type The ps_parameter_value_kind of the parameter to be set.
In char * const description A char array from with which to set the parameter description text.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) count successfully retrieved
    • DTC_CONFIG - Count was not retrieved due to a SQL error

psync_sdf_set_sensor_descriptor ( … )

This will set the Sensor Descriptor entry in a SDF.

psync_sdf_set_sensor_descriptor expects the input to be pre-populated with data.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get the SDF path. If NULL it uses the system environment.
In/Out ps_sdf_sensor_descriptor * const sensor_descriptor A point to ps_sdf_sensor_descriptor with the data to create in the SDF entry.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) count successfully retrieved
    • DTC_CONFIG - Count was not retrieved due to a SQL error

psync_sdf_update_host_configuration ( … )

This will update the Host Configuration entry in a SDF.

It expects the input to be pre-populated with data.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get the SDF path. If NULL, it uses the system environment.
In/Out ps_sdf_host_configuration * const sensor_descriptor A pointer to ps_sdf_host_configuration with the data to update in the SDF entry.
In const unsigned int autofill If PSYNC_SDF_AUTOFILL_ON (1), then this operation is applied to any child entities.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) count successfully retrieved
    • DTC_CONFIG - Count was not retrieved due to a SQL error

psync_sdf_update_io_configuration ( … )

This will update an IO Configuration entry in the SDF.

psync_sdf_update_io_configuration updates an IO Configuration entry in a SDF.

It expects the input to be pre-populated with data.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get the SDF path. If NULL, it uses the system environment.
In/Out ps_sdf_io_configuration * const io_config A pointer to ps_sdf_io_configuration with the data to update in the SDF entry.
In const unsigned int autofill In PSYNC_SDF_AUTOFILL_ON (1), then this operation is applied to any child entities.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) count successfully retrieved
    • DTC_CONFIG - Count was not retrieved due to a SQL error

psync_sdf_update_node_configuration ( … )

This will update a Node Configuration entry in a SDF.

It expects the input to be pre-populated with data.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get the SDF path. If NULL, it uses the system environment.
In/Out ps_sdf_node_configuration * const node_config A pointer to ps_sdf_node_configuration with the data to update in the SDF entry.
In const unsigned int autofill If PSYNC_SDF_AUTOFILL_ON (1), then this operation is applied to any child entities.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) count successfully retrieved
    • DTC_CONFIG - Count was not retrieved due to a SQL error

psync_sdf_update_parameter_value ( … )

This will update a parameter value entry in a SDF.

psync_sdf_update_parameter_value updates a parameter value entry in a SDF.

It expects the input to be pre-populated with data.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get the SDF path. If NULL, it uses the system environment.
In/Out ps_sdf_parameter_value * const param_value A pointer to the ps_sdf_parameter_value with the data to update in the SDF entry.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) count successfully retrieved
    • DTC_CONFIG - Count was not retrieved due to a SQL error

psync_sdf_update_runtime_configuration ( … )

This will update a Runtime Configuration entry in the SDF.

psync_sdf_update_runtime_configuration updates a Runtime Configuration entry in SDF.

It expects the input to be pre-populated with data.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get the SDF path. If NULL, it uses the system environment.
In/Out ps_sdf_runtime_configuration * const runtime_config A pointer to the ps_sdf_runtime_configuration with the data to update in the SDF entry.
In const unsigned int autofill If PSYNC_SDF_AUTOFILL_ON (1), then this operation is applied to any child entities.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) count successfully retrieved
    • DTC_CONFIG - Count was not retrieved due to a SQL error

psync_sdf_update_sensor_configuration ( … )

This will update a Sensor Configuration entry in a SDF.

psync_sdf_update_sensor_configuration updates a Sensor Configuration entry in a SDF.

It expects the input to be pre-populated with data.

Parameters
In/Out Type Name Description
In const ps_node_ref node_ref A ps_node_ref used to get the SDF path. If NULL, it uses the system environment.
In/Out ps_sdf_sensor_configuration * const sensor_config A pointer to the ps_sdf_sensor_configuration with the data to update in the SDF entry.
In const unsigned int autofill In PSYNC_SDF_AUTOFILL_ON (1), then this operation is applied to any child entities.
Returns
  • DTC Code:
    • DTC_NONE - (Zero) Count successfully retrieved
    • DTC_CONFIG - Count was not retrieved due to a SQL error

Macros

PSYNC_SDF_ID_INVALID

Value Type Description
0 int Invalid SDF Primary Key value.

PSYNC_SDF_DEFAULT_RUNTIME_ID

Value Type Description
1 int PolySync default runtime ID value.

PSYNC_SDF_AUTOFILL_OFF

Value Type Description
0 int SDF auto-fill disabled.

PSYNC_SDF_AUTOFILL_ON

Value Type Description
1 int SDF auto-fill enabled.

SDF_STRING_LEN

Value Type Description
2048 int Maximum supported string length. [bytes]

Typedefs

psync_sdf_custom_callback

This is a custom SDF query callback function. In Linux, this is a wrapper to a sqlite3 callback.

The function expects a return value of zero on success.

Parameters
In/Out Type Name Description
In void * user_data -
In int argc -
In char ** argv -
In char ** column_names -