lib60870.NET
2.2.0
IEC 60870-5-101/104 Protocol Source Code Library for C#/.NET
|
CS 101 slave implementation (implements Slave interface) More...
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() |
CS 101 slave implementation (implements Slave interface)
lib60870.CS101.CS101Slave.CS101Slave | ( | SerialPort | port, |
LinkLayerParameters | parameters = null |
||
) |
Initializes a new instance of the lib60870.CS101.CS101Slave class.
port | serial port instance |
parameters | link layer parameters |
lib60870.CS101.CS101Slave.CS101Slave | ( | Stream | serialStream, |
LinkLayerParameters | parameters = null |
||
) |
Initializes a new instance of the lib60870.CS101.CS101Slave class.
serialStream | A stream instance (e.g. TcpClientVirtualSerialPort or TcpServerVirtualSerialPort. |
parameters | link layer parameters |
void lib60870.CS101.CS101Slave.EnqueueUserDataClass1 | ( | ASDU | asdu | ) |
void lib60870.CS101.CS101Slave.EnqueueUserDataClass2 | ( | ASDU | asdu | ) |
bool lib60870.CS101.CS101Slave.IsUserDataClass1QueueFull | ( | ) |
Determines whether the user data class 1 queue is full.
true
if the queue is full; otherwise, false
.bool lib60870.CS101.CS101Slave.IsUserDataClass2QueueFull | ( | ) |
Determines whether the user data class 2 queue is full.
true
if the queue is full; otherwise, false
.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.
void lib60870.CS101.CS101Slave.Run | ( | ) |
Run a the message receiver and state machines once. Can be used if no threads should be used.
void lib60870.CS101.CS101Slave.SendLinkLayerTestFunction | ( | ) |
Sends a link layer test function.
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
class1QueueSize | Class 1 queue size. |
class2QueueSize | Class 2 queue size. |
void lib60870.CS101.CS101Slave.Stop | ( | ) |
Stops the receive message loop
|
getset |
Gets or sets the direction bit value used for balanced mode (default is false)
true
if DIR is set otherwise, false
.
|
getset |
Gets or sets the own link layer address.
own link layer address.
|
getset |
Gets or sets the link layer address of the other station (for balanced mode).
link layer address of other station.
|
getset |
Gets or sets the link layer mode (balanced or unbalanced).
The link layer mode.
|
getset |
Gets or sets the application layer parameters-
Should be set before starting the communication
application layer parameters.