libiec61850  1.6.0
Functions
Values Application Service Data Unit (ASDU)

Functions

LIB61850_API void SVPublisher_ASDU_resetBuffer (SVPublisher_ASDU self)
 Reset the internal data buffer of an ASDU. More...
 
LIB61850_API int SVPublisher_ASDU_addINT8 (SVPublisher_ASDU self)
 Reserve memory for a signed 8-bit integer in the ASDU. More...
 
LIB61850_API void SVPublisher_ASDU_setINT8 (SVPublisher_ASDU self, int index, int8_t value)
 Set the value of a 8-bit integer in the ASDU. More...
 
LIB61850_API int SVPublisher_ASDU_addINT32 (SVPublisher_ASDU self)
 Reserve memory for a signed 32-bit integer in the ASDU. More...
 
LIB61850_API void SVPublisher_ASDU_setINT32 (SVPublisher_ASDU self, int index, int32_t value)
 Set the value of a 32-bit integer in the ASDU. More...
 
LIB61850_API int SVPublisher_ASDU_addINT64 (SVPublisher_ASDU self)
 Reserve memory for a signed 64-bit integer in the ASDU. More...
 
LIB61850_API void SVPublisher_ASDU_setINT64 (SVPublisher_ASDU self, int index, int64_t value)
 Set the value of a 64-bit integer in the ASDU. More...
 
LIB61850_API int SVPublisher_ASDU_addFLOAT (SVPublisher_ASDU self)
 Reserve memory for a single precision floating point number in the ASDU. More...
 
LIB61850_API void SVPublisher_ASDU_setFLOAT (SVPublisher_ASDU self, int index, float value)
 Set the value of a single precision floating point number in the ASDU. More...
 
LIB61850_API int SVPublisher_ASDU_addFLOAT64 (SVPublisher_ASDU self)
 Reserve memory for a double precision floating point number in the ASDU. More...
 
LIB61850_API void SVPublisher_ASDU_setFLOAT64 (SVPublisher_ASDU self, int index, double value)
 Set the value of a double precision floating pointer number in the ASDU. More...
 
LIB61850_API int SVPublisher_ASDU_addTimestamp (SVPublisher_ASDU self)
 Reserve memory for a 64 bit time stamp in the ASDU. More...
 
LIB61850_API void SVPublisher_ASDU_setTimestamp (SVPublisher_ASDU self, int index, Timestamp value)
 Set the value of a 64 bit time stamp in the ASDU. More...
 
LIB61850_API int SVPublisher_ASDU_addQuality (SVPublisher_ASDU self)
 Reserve memory for a quality value in the ASDU. More...
 
LIB61850_API void SVPublisher_ASDU_setQuality (SVPublisher_ASDU self, int index, Quality value)
 Set the value of a quality attribute in the ASDU. More...
 
LIB61850_API void SVPublisher_ASDU_setSmpCnt (SVPublisher_ASDU self, uint16_t value)
 Set the sample count attribute of the ASDU. More...
 
LIB61850_API uint16_t SVPublisher_ASDU_getSmpCnt (SVPublisher_ASDU self)
 Get the sample count attribute of the ASDU. More...
 
LIB61850_API void SVPublisher_ASDU_increaseSmpCnt (SVPublisher_ASDU self)
 Increment the sample count attribute of the ASDU. More...
 
LIB61850_API void SVPublisher_ASDU_setSmpCntWrap (SVPublisher_ASDU self, uint16_t value)
 Set the roll-over (wrap) limit for the sample counter. When reaching the limit the sample counter will be reset to 0 (default is no limit) More...
 
LIB61850_API void SVPublisher_ASDU_enableRefrTm (SVPublisher_ASDU self)
 Enables the transmission of refresh time attribute of the ASDU. More...
 
LIB61850_API void SVPublisher_ASDU_setRefrTmNs (SVPublisher_ASDU self, nsSinceEpoch refrTmNs)
 Set the refresh time attribute of the ASDU with nanosecond resolution. More...
 
LIB61850_API void SVPublisher_ASDU_setRefrTm (SVPublisher_ASDU self, msSinceEpoch refrTm)
 Set the refresh time attribute of the ASDU with millisecond resolution. More...
 
LIB61850_API void SVPublisher_ASDU_setRefrTmByTimestamp (SVPublisher_ASDU self, Timestamp *refrTm)
 Set the refresh time attribute of the ASDU. More...
 
LIB61850_API void SVPublisher_ASDU_setSmpMod (SVPublisher_ASDU self, uint8_t smpMod)
 Set the sample mode attribute of the ASDU. More...
 
LIB61850_API void SVPublisher_ASDU_setSmpRate (SVPublisher_ASDU self, uint16_t smpRate)
 Set the sample rate attribute of the ASDU. More...
 
LIB61850_API void SVPublisher_ASDU_setSmpSynch (SVPublisher_ASDU self, uint16_t smpSynch)
 Set the clock synchronization information. More...
 

Detailed Description

Function Documentation

◆ SVPublisher_ASDU_addFLOAT()

LIB61850_API int SVPublisher_ASDU_addFLOAT ( SVPublisher_ASDU  self)

Reserve memory for a single precision floating point number in the ASDU.

Parameters
[in]selfthe Sampled Values ASDU instance.
Returns
the offset in bytes of the new element within the ASDU data block.

◆ SVPublisher_ASDU_addFLOAT64()

LIB61850_API int SVPublisher_ASDU_addFLOAT64 ( SVPublisher_ASDU  self)

Reserve memory for a double precision floating point number in the ASDU.

Parameters
[in]selfthe Sampled Values ASDU instance.
Returns
the offset in bytes of the new element within the ASDU data block.

◆ SVPublisher_ASDU_addINT32()

LIB61850_API int SVPublisher_ASDU_addINT32 ( SVPublisher_ASDU  self)

Reserve memory for a signed 32-bit integer in the ASDU.

Parameters
[in]selfthe Sampled Values ASDU instance.
Returns
the offset in bytes within the ASDU data block.

◆ SVPublisher_ASDU_addINT64()

LIB61850_API int SVPublisher_ASDU_addINT64 ( SVPublisher_ASDU  self)

Reserve memory for a signed 64-bit integer in the ASDU.

Parameters
[in]selfthe Sampled Values ASDU instance.
Returns
the offset in bytes of the new element within the ASDU data block.

◆ SVPublisher_ASDU_addINT8()

LIB61850_API int SVPublisher_ASDU_addINT8 ( SVPublisher_ASDU  self)

Reserve memory for a signed 8-bit integer in the ASDU.

Parameters
[in]selfthe Sampled Values ASDU instance.
Returns
the offset in bytes within the ASDU data block.

◆ SVPublisher_ASDU_addQuality()

LIB61850_API int SVPublisher_ASDU_addQuality ( SVPublisher_ASDU  self)

Reserve memory for a quality value in the ASDU.

NOTE: Quality is encoded as BITSTRING (4 byte)

Parameters
[in]selfthe Sampled Values ASDU instance.
Returns
the offset in bytes of the new element within the ASDU data block.

◆ SVPublisher_ASDU_addTimestamp()

LIB61850_API int SVPublisher_ASDU_addTimestamp ( SVPublisher_ASDU  self)

Reserve memory for a 64 bit time stamp in the ASDU.

Parameters
[in]selfthe Sampled Values ASDU instance.
Returns
the offset in bytes of the new element within the ASDU data block.

◆ SVPublisher_ASDU_enableRefrTm()

LIB61850_API void SVPublisher_ASDU_enableRefrTm ( SVPublisher_ASDU  self)

Enables the transmission of refresh time attribute of the ASDU.

The refresh time is the time when the data in put into the sampled values buffer

Parameters
[in]selfthe Sampled Values ASDU instance.

◆ SVPublisher_ASDU_getSmpCnt()

LIB61850_API uint16_t SVPublisher_ASDU_getSmpCnt ( SVPublisher_ASDU  self)

Get the sample count attribute of the ASDU.

Parameters
[in]selfthe Sampled Values ASDU instance.

◆ SVPublisher_ASDU_increaseSmpCnt()

LIB61850_API void SVPublisher_ASDU_increaseSmpCnt ( SVPublisher_ASDU  self)

Increment the sample count attribute of the ASDU.

The parameter SmpCnt shall contain the values of a counter, which is incremented each time a new sample of the analogue value is taken. The sample values shall be kept in the right order. If the counter is used to indicate time consistency of various sampled values, the counter shall be reset by an external synchronization event.

Parameters
[in]selfthe Sampled Values ASDU instance.

◆ SVPublisher_ASDU_resetBuffer()

LIB61850_API void SVPublisher_ASDU_resetBuffer ( SVPublisher_ASDU  self)

Reset the internal data buffer of an ASDU.

All data elements added by SVPublisher_ASDU_add*() functions are removed. SVPublisher_setupComplete() must be called afterwards.

Parameters
[in]selfthe Sampled Values ASDU instance.

◆ SVPublisher_ASDU_setFLOAT()

LIB61850_API void SVPublisher_ASDU_setFLOAT ( SVPublisher_ASDU  self,
int  index,
float  value 
)

Set the value of a single precision floating point number in the ASDU.

Parameters
[in]selfthe Sampled Values ASDU instance.
[in]indexThe offset within the data block of the ASDU in bytes.
[in]valueThe value which should be set.

◆ SVPublisher_ASDU_setFLOAT64()

LIB61850_API void SVPublisher_ASDU_setFLOAT64 ( SVPublisher_ASDU  self,
int  index,
double  value 
)

Set the value of a double precision floating pointer number in the ASDU.

Parameters
[in]selfthe Sampled Values ASDU instance.
[in]indexThe offset within the data block of the ASDU in bytes.
[in]valueThe value which should be set.

◆ SVPublisher_ASDU_setINT32()

LIB61850_API void SVPublisher_ASDU_setINT32 ( SVPublisher_ASDU  self,
int  index,
int32_t  value 
)

Set the value of a 32-bit integer in the ASDU.

Parameters
[in]selfthe Sampled Values ASDU instance.
[in]indexThe offset within the data block of the ASDU in bytes.
[in]valueThe value which should be set.

◆ SVPublisher_ASDU_setINT64()

LIB61850_API void SVPublisher_ASDU_setINT64 ( SVPublisher_ASDU  self,
int  index,
int64_t  value 
)

Set the value of a 64-bit integer in the ASDU.

Parameters
[in]selfthe Sampled Values ASDU instance.
[in]indexThe offset within the data block of the ASDU in bytes.
[in]valueThe value which should be set.

◆ SVPublisher_ASDU_setINT8()

LIB61850_API void SVPublisher_ASDU_setINT8 ( SVPublisher_ASDU  self,
int  index,
int8_t  value 
)

Set the value of a 8-bit integer in the ASDU.

Parameters
[in]selfthe Sampled Values ASDU instance.
[in]indexThe offset within the data block of the ASDU in bytes.
[in]valueThe value which should be set.

◆ SVPublisher_ASDU_setQuality()

LIB61850_API void SVPublisher_ASDU_setQuality ( SVPublisher_ASDU  self,
int  index,
Quality  value 
)

Set the value of a quality attribute in the ASDU.

Parameters
[in]selfthe Sampled Values ASDU instance.
[in]indexThe offset within the data block of the ASDU in bytes.
[in]valueThe value which should be set.

◆ SVPublisher_ASDU_setRefrTm()

LIB61850_API void SVPublisher_ASDU_setRefrTm ( SVPublisher_ASDU  self,
msSinceEpoch  refrTm 
)

Set the refresh time attribute of the ASDU with millisecond resolution.

Parameters
[in]selfthe Sampled Values ASDU instance.
[in]refrTmNsthe refresh time value with with milliseconds resolution.

◆ SVPublisher_ASDU_setRefrTmByTimestamp()

LIB61850_API void SVPublisher_ASDU_setRefrTmByTimestamp ( SVPublisher_ASDU  self,
Timestamp refrTm 
)

Set the refresh time attribute of the ASDU.

NOTE: Using this function you can control the time quality flags and the sub second precision (number of valid bits) of the RefrTm value.

Parameters
[in]selfthe Sampled Values ASDU instance.
[in]refrTmthe refresh time value

◆ SVPublisher_ASDU_setRefrTmNs()

LIB61850_API void SVPublisher_ASDU_setRefrTmNs ( SVPublisher_ASDU  self,
nsSinceEpoch  refrTmNs 
)

Set the refresh time attribute of the ASDU with nanosecond resolution.

Parameters
[in]selfthe Sampled Values ASDU instance.
[in]refrTmNsthe refresh time value with nanoseconds resolution.

◆ SVPublisher_ASDU_setSmpCnt()

LIB61850_API void SVPublisher_ASDU_setSmpCnt ( SVPublisher_ASDU  self,
uint16_t  value 
)

Set the sample count attribute of the ASDU.

Parameters
[in]selfthe Sampled Values ASDU instance.
[in]valuethe new value of the attribute.

◆ SVPublisher_ASDU_setSmpCntWrap()

LIB61850_API void SVPublisher_ASDU_setSmpCntWrap ( SVPublisher_ASDU  self,
uint16_t  value 
)

Set the roll-over (wrap) limit for the sample counter. When reaching the limit the sample counter will be reset to 0 (default is no limit)

Parameters
[in]selfthe Sampled Values ASDU instance.
[in]valuethe new sample counter limit

◆ SVPublisher_ASDU_setSmpMod()

LIB61850_API void SVPublisher_ASDU_setSmpMod ( SVPublisher_ASDU  self,
uint8_t  smpMod 
)

Set the sample mode attribute of the ASDU.

The attribute SmpMod shall specify if the sample rate is defined in units of samples per nominal period, samples per second or seconds per sample. If it is missing, the default value is samples per period.

NOTE: Function has to be called before calling SVPublisher_setupComplete

Parameters
[in]selfthe Sampled Values ASDU instance.
[in]smpModone of IEC61850_SV_SMPMOD_PER_NOMINAL_PERIOD, IEC61850_SV_SMPMOD_SAMPLES_PER_SECOND or IEC61850_SV_SMPMOD_SECONDS_PER_SAMPLE

◆ SVPublisher_ASDU_setSmpRate()

LIB61850_API void SVPublisher_ASDU_setSmpRate ( SVPublisher_ASDU  self,
uint16_t  smpRate 
)

Set the sample rate attribute of the ASDU.

The attribute SmpRate shall specify the sample rate. The value shall be interpreted depending on the value of the SmpMod attribute.

NOTE: Function has to be called before calling SVPublisher_setupComplete

Parameters
[in]selfthe Sampled Values ASDU instance.
[in]smpRateAmount of samples (default per nominal period, see SmpMod).

◆ SVPublisher_ASDU_setSmpSynch()

LIB61850_API void SVPublisher_ASDU_setSmpSynch ( SVPublisher_ASDU  self,
uint16_t  smpSynch 
)

Set the clock synchronization information.

Default value is not synchronized (0). Possible values are: 0 = SV are not synchronized by an external clock signal. 1 = SV are synchronized by a clock signal from an unspecified local area clock. 2 = SV are synchronized by a global area clock signal (time traceable). 5 to 254 = SV are synchronized by a clock signal from a local area clock identified by this value. 3;4;255 = Reserved values – Do not use.

Parameters
[in]selfthe Sampled Values ASDU instance.
[in]smpSynchthe clock synchronization state

◆ SVPublisher_ASDU_setTimestamp()

LIB61850_API void SVPublisher_ASDU_setTimestamp ( SVPublisher_ASDU  self,
int  index,
Timestamp  value 
)

Set the value of a 64 bit time stamp in the ASDU.

Parameters
[in]selfthe Sampled Values ASDU instance.
[in]indexThe offset within the data block of the ASDU in bytes.
[in]valueThe value which should be set.