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

CS 101 slave implementation (implements Slave interface) More...

Inheritance diagram for lib60870.CS101.CS101Slave:
Collaboration diagram for lib60870.CS101.CS101Slave:

Public Member Functions

void Stop ()
 Stops the receive message loop More...
 
void SetUserDataQueueSizes (int class1QueueSize, int class2QueueSize)
 Sets the user data queue sizes. When the maximum size is reached the oldest value will be deleted when a new ASDU is added More...
 
bool IsUserDataClass1QueueFull ()
 Determines whether the user data class 1 queue is full. More...
 
void EnqueueUserDataClass1 (ASDU asdu)
 Enqueues an ASDU into the class 1 queue (for events, command responses, and other high-priority messages). More...
 
bool IsUserDataClass2QueueFull ()
 Determines whether the user data class 2 queue is full. More...
 
void EnqueueUserDataClass2 (ASDU asdu)
 Enqueues an ASDU into the class 2 queue (for periodic measurments, background scan, and other low-priority data). More...
 
 CS101Slave (SerialPort port, LinkLayerParameters parameters=null)
 Initializes a new instance of the lib60870.CS101.CS101Slave class. More...
 
 CS101Slave (Stream serialStream, LinkLayerParameters parameters=null)
 Initializes a new instance of the lib60870.CS101.CS101Slave class. More...
 
void SendLinkLayerTestFunction ()
 Sends a link layer test function. More...
 
void Run ()
 Run a the message receiver and state machines once. Can be used if no threads should be used. More...
 
void ReceiveMessageLoop ()
 Starts a loop that handles incoming messages. More...
 
- Public Member Functions inherited from lib60870.CS101.Slave
void SetInterrogationHandler (InterrogationHandler handler, object parameter)
 Sets a callback for interrogaton requests. More...
 
void SetCounterInterrogationHandler (CounterInterrogationHandler handler, object parameter)
 Sets a callback for counter interrogaton requests. More...
 
void SetReadHandler (ReadHandler handler, object parameter)
 Sets a callback for read requests. More...
 
void SetClockSynchronizationHandler (ClockSynchronizationHandler handler, object parameter)
 Sets a callback for the clock synchronization request. More...
 
void SetResetProcessHandler (ResetProcessHandler handler, object parameter)
 
void SetDelayAcquisitionHandler (DelayAcquisitionHandler handler, object parameter)
 
void SetASDUHandler (ASDUHandler handler, object parameter)
 Sets a callback to handle ASDUs (commands, requests) form clients. This callback can be used when no other callback handles the message from the client/master. More...
 
void SetFileReadyHandler (FileReadyHandler handler, object parameter)
 
FilesAvailable GetAvailableFiles ()
 

Properties

ApplicationLayerParameters Parameters [get, set]
 Gets or sets the application layer parameters- More...
 
bool DIR [get, set]
 Gets or sets the direction bit value used for balanced mode (default is false) More...
 
LinkLayerMode LinkLayerMode [get, set]
 Gets or sets the link layer mode (balanced or unbalanced). More...
 
int LinkLayerAddress [get, set]
 Gets or sets the own link layer address. More...
 
int LinkLayerAddressOtherStation [get, set]
 Gets or sets the link layer address of the other station (for balanced mode). More...
 
- Properties inherited from lib60870.CS101.Slave
bool DebugOutput [get, set]
 

Additional Inherited Members

- Public Attributes inherited from lib60870.CS101.Slave
InterrogationHandler interrogationHandler = null
 
object InterrogationHandlerParameter = null
 
CounterInterrogationHandler counterInterrogationHandler = null
 
object counterInterrogationHandlerParameter = null
 
ReadHandler readHandler = null
 
object readHandlerParameter = null
 
ClockSynchronizationHandler clockSynchronizationHandler = null
 
object clockSynchronizationHandlerParameter = null
 
ResetProcessHandler resetProcessHandler = null
 
object resetProcessHandlerParameter = null
 
DelayAcquisitionHandler delayAcquisitionHandler = null
 
object delayAcquisitionHandlerParameter = null
 
ASDUHandler asduHandler = null
 
object asduHandlerParameter = null
 
- Protected Attributes inherited from lib60870.CS101.Slave
bool debugOutput
 
FileReadyHandler fileReadyHandler = null
 
object fileReadyHandlerParameter = null
 
FilesAvailable filesAvailable = new FilesAvailable()
 

Detailed Description

CS 101 slave implementation (implements Slave interface)

Constructor & Destructor Documentation

◆ CS101Slave() [1/2]

lib60870.CS101.CS101Slave.CS101Slave ( SerialPort  port,
LinkLayerParameters  parameters = null 
)

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

Parameters
portserial port instance
parameterslink layer parameters

◆ CS101Slave() [2/2]

lib60870.CS101.CS101Slave.CS101Slave ( Stream  serialStream,
LinkLayerParameters  parameters = null 
)

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

Parameters
serialStreamA stream instance (e.g. TcpClientVirtualSerialPort or TcpServerVirtualSerialPort.
parameterslink layer parameters

Member Function Documentation

◆ EnqueueUserDataClass1()

void lib60870.CS101.CS101Slave.EnqueueUserDataClass1 ( ASDU  asdu)

Enqueues an ASDU into the class 1 queue (for events, command responses, and other high-priority messages).

Parameters
asduASDU to enqueue

◆ EnqueueUserDataClass2()

void lib60870.CS101.CS101Slave.EnqueueUserDataClass2 ( ASDU  asdu)

Enqueues an ASDU into the class 2 queue (for periodic measurments, background scan, and other low-priority data).

Parameters
asduASDU to enqueue

◆ IsUserDataClass1QueueFull()

bool lib60870.CS101.CS101Slave.IsUserDataClass1QueueFull ( )

Determines whether the user data class 1 queue is full.

Returns
true if the queue is full; otherwise, false.

◆ IsUserDataClass2QueueFull()

bool lib60870.CS101.CS101Slave.IsUserDataClass2QueueFull ( )

Determines whether the user data class 2 queue is full.

Returns
true if the queue is full; otherwise, false.

◆ ReceiveMessageLoop()

void lib60870.CS101.CS101Slave.ReceiveMessageLoop ( )

Starts a loop that handles incoming messages.

It is best to be started in a separate thread. The loop can be stopped with the Stop method.

◆ Run()

void lib60870.CS101.CS101Slave.Run ( )

Run a the message receiver and state machines once. Can be used if no threads should be used.

◆ SendLinkLayerTestFunction()

void lib60870.CS101.CS101Slave.SendLinkLayerTestFunction ( )

Sends a link layer test function.

◆ SetUserDataQueueSizes()

void lib60870.CS101.CS101Slave.SetUserDataQueueSizes ( int  class1QueueSize,
int  class2QueueSize 
)

Sets the user data queue sizes. When the maximum size is reached the oldest value will be deleted when a new ASDU is added

Parameters
class1QueueSizeClass 1 queue size.
class2QueueSizeClass 2 queue size.

◆ Stop()

void lib60870.CS101.CS101Slave.Stop ( )

Stops the receive message loop

Property Documentation

◆ DIR

bool lib60870.CS101.CS101Slave.DIR
getset

Gets or sets the direction bit value used for balanced mode (default is false)

true if DIR is set otherwise, false.

◆ LinkLayerAddress

int lib60870.CS101.CS101Slave.LinkLayerAddress
getset

Gets or sets the own link layer address.

own link layer address.

◆ LinkLayerAddressOtherStation

int lib60870.CS101.CS101Slave.LinkLayerAddressOtherStation
getset

Gets or sets the link layer address of the other station (for balanced mode).

link layer address of other station.

◆ LinkLayerMode

LinkLayerMode lib60870.CS101.CS101Slave.LinkLayerMode
getset

Gets or sets the link layer mode (balanced or unbalanced).

The link layer mode.

◆ Parameters

ApplicationLayerParameters lib60870.CS101.CS101Slave.Parameters
getset

Gets or sets the application layer parameters-

Should be set before starting the communication

application layer parameters.


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