lib60870.NET  2.2.0
IEC 60870-5-101/104 Protocol Source Code Library for C#/.NET
lib60870.CS101.ASDU Class Reference

This class represents an application layer message. It contains some generic message information and one or more InformationObject instances of the same type. It is used to send and receive messages. More...

Public Member Functions

 ASDU (ApplicationLayerParameters parameters, CauseOfTransmission cot, bool isTest, bool isNegative, byte oa, int ca, bool isSequence)
 Initializes a new instance of the lib60870.CS101.ASDU class. More...
 
bool AddInformationObject (InformationObject io)
 Adds an information object to the ASDU. More...
 
 ASDU (ApplicationLayerParameters parameters, byte[] msg, int bufPos, int msgLength)
 
byte [] AsByteArray ()
 
InformationObject GetElement (int index, PrivateInformationObjectTypes privateObjectTypes)
 Gets the element (information object) with the specified index. This function supports private information object types. More...
 
InformationObject GetElement (int index)
 Gets the element (information object) with the specified index More...
 
override string ToString ()
 

Properties

TypeID TypeId [get]
 Gets the type identifier (TI). More...
 
CauseOfTransmission Cot [get, set]
 Gets or sets the cause of transmission (COT) More...
 
byte Oa [get]
 Gets the originator address (OA) More...
 
bool IsTest [get]
 Gets a value indicating whether this instance is a test message. More...
 
bool IsNegative [get, set]
 Gets or sets a value indicating whether this instance is a negative confirmation. More...
 
int Ca [get]
 Gets the common address of the ASDU (CA) More...
 
bool IsSequence [get]
 Gets a value indicating whether this instance is a sequence of information objects More...
 
int NumberOfElements [get]
 Gets the number of elements (information objects) of the ASDU More...
 

Detailed Description

This class represents an application layer message. It contains some generic message information and one or more InformationObject instances of the same type. It is used to send and receive messages.

Constructor & Destructor Documentation

◆ ASDU()

lib60870.CS101.ASDU.ASDU ( ApplicationLayerParameters  parameters,
CauseOfTransmission  cot,
bool  isTest,
bool  isNegative,
byte  oa,
int  ca,
bool  isSequence 
)

Initializes a new instance of the lib60870.CS101.ASDU class.

Parameters
parametersapplication layer parameters to be used for encoding/decoding
cotCause of transmission (COT)
isTestIf set to true ASDU is a test ASDU.
isNegativeIf set to true is negative confirmation.
oaoriginator address (OA)
cacommon address of the ASDU (CA)
isSequenceIf set to true is a sequence of information objects.

Member Function Documentation

◆ AddInformationObject()

bool lib60870.CS101.ASDU.AddInformationObject ( InformationObject  io)

Adds an information object to the ASDU.

This function add an information object (InformationObject) to the ASDU. NOTE: that all information objects have to be of the same type. Otherwise an ArgumentException will be thrown. The function returns true when the information object has been added to the ASDU. The function returns false if there is no space left in the ASDU to add the information object, or when object cannot be added to a sequence because the IOA does not match.

Returns
true, if information object was added, false otherwise.
Parameters
ioThe information object to add

◆ GetElement() [1/2]

InformationObject lib60870.CS101.ASDU.GetElement ( int  index,
PrivateInformationObjectTypes  privateObjectTypes 
)

Gets the element (information object) with the specified index. This function supports private information object types.

Returns
the information object at index
Parameters
indexindex of the element (starting with 0)
privateObjectTypesknown private information object types
Exceptions
lib60870.ASDUParsingExceptionThrown when there is a problem parsing the ASDU

◆ GetElement() [2/2]

InformationObject lib60870.CS101.ASDU.GetElement ( int  index)

Gets the element (information object) with the specified index

Returns
the information object at index
Parameters
indexindex of the element (starting with 0)
Exceptions
lib60870.ASDUParsingExceptionThrown when there is a problem parsing the ASDU

Property Documentation

◆ Ca

int lib60870.CS101.ASDU.Ca
get

Gets the common address of the ASDU (CA)

The CA value

◆ Cot

CauseOfTransmission lib60870.CS101.ASDU.Cot
getset

Gets or sets the cause of transmission (COT)

The COT value

◆ IsNegative

bool lib60870.CS101.ASDU.IsNegative
getset

Gets or sets a value indicating whether this instance is a negative confirmation.

true if this instance is a negative confirmation; otherwise, false.

◆ IsSequence

bool lib60870.CS101.ASDU.IsSequence
get

Gets a value indicating whether this instance is a sequence of information objects

A sequence of information objects contains multiple information objects with successive information object addresses (IOA).

true if this instance is a sequence; otherwise, false.

◆ IsTest

bool lib60870.CS101.ASDU.IsTest
get

Gets a value indicating whether this instance is a test message.

true if this instance is a test message; otherwise, false.

◆ NumberOfElements

int lib60870.CS101.ASDU.NumberOfElements
get

Gets the number of elements (information objects) of the ASDU

The number of information objects.

◆ Oa

byte lib60870.CS101.ASDU.Oa
get

Gets the originator address (OA)

The OA

◆ TypeId

TypeID lib60870.CS101.ASDU.TypeId
get

Gets the type identifier (TI).

The type identifier.


The documentation for this class was generated from the following file: