scada-tgz

open-source .NET SCADA framework

SourceForge.net Logo

Technical docs - API documentation of servers and controls

Servers

Modbus

bool RSConfig(int baud, byte port, byte parity, byte data, byte stop)
Configure serial port

Values:
baud: 9600 or 19200 (kbps)
port: 1=COM1(/dev/ttyS0) or 2=COM2(/dev/ttyS1)
parity: 1=even or 2=odd or 3=none
data: 8 or 7 (bits)
stop: 1=1 or 2=2 or 3=1.5 or 4=none (bits)

Return:
always true

bool[] RdDigitalOuts(ushort addr, ushort num, byte slave)
This is "Read Coils" function of Modbus protocol, it reads Internal Bits or Physical Coils

ushort[] RdRegs(ushort addr, ushort num, byte slave)
This is "Read Holding Registers" function of Modbus protocol, it reads Internal Registers or Physical Output Registers

ushort[] RdAnalogIns(ushort addr, ushort num, byte slave)
This is "Read Input Registers" function of Modbus protocol, it reads Physical Input Registers

Values:
addr: data address (zero based)
num: number of data units to read (coils: 1 to 2000, registers: 1 to 125)
slave: slave device address (1 to 247)

Return:
table of read data, table size=num

bool WrDigitalOut(ushort addr, bool val, byte slave)
This is "Write Single Coil" function of Modbus protocol, it writes Internal Bits or Physical Coils

bool WrReg(ushort addr, ushort val, byte slave)
This is "Write Single Register" function of Modbus protocol, it writes Internal Registers or Physical Output Registers

bool WrDigitalOuts(ushort addr, bool[] val, ushort num, byte slave)
This is "Write Multiple Coils" function of Modbus protocol, it writes Internal Bits or Physical Coils

bool WrRegs(ushort addr, ushort[] val, ushort num, byte slave)
This is "Write Multiple Registers" function of Modbus protocol, it writes Internal Registers or Physical Output Registers

bool MaskReg(ushort addr, ushort andmask, ushort ormask, byte slave)
This is "Mask Write Register" function of Modbus protocol, it modifies Internal Registers or Physical Output Registers

Values:
addr: data address (zero based)
val: value of data to write (or table of values, table size=num)
num: number of data units to write (coils: 1 to 1968, registers: 1 to 123)
andmask, ormask: logical AND and logical OR masks
slave: slave device address (1 to 247)

Return:
true if operation is successful, otherwise false

ushort[] WrRdRegs(ushort readaddr, ushort readnum, ushort writeaddr, ushort[] writeval, ushort writenum, byte slave)
This is "Read/Write Multiple Registers" function of Modbus protocol, it first writes then reads Internal Registers or Physical Output Registers

Values:
readaddr: address of data to read (zero based)
readnum: number of registers to read (1 to 125)
writeaddr: address of data to write (zero based)
writeval: table of values to write, table size=writenum
writenum: number of registers to write (1 to 121)
slave: slave device address (1 to 247)

Return:
table of read data, table size=readnum

GeSNP

bool RSConfig(int baud, byte port, byte parity, byte data, byte stop)
Configure serial port

Values:
baud: 9600 or 19200 (kbps)
port: 1=COM1(/dev/ttyS0) or 2=COM2(/dev/ttyS1)
parity: 1=even or 2=odd or 3=none
data: 8 or 7 (bits)
stop: 1=1 or 2=2 or 3=1.5 or 4=none (bits)

Return:
always true

bool[] RdDigitalOuts(ushort addr, ushort num) - reads %Q variables
bool[] RdDigitalIns(ushort addr, ushort num) - reads %I variables
bool[] RdDigitalMem(ushort addr, ushort num) - reads %M variables
bool[] RdDigitalTemp(ushort addr, ushort num) - reads %T variables
ushort[] RdAnalogOuts(ushort addr, ushort num) - reads %AQ variables
ushort[] RdAnalogIns(ushort addr, ushort num) - reads %AI variables
ushort[] RdRegs(ushort addr, ushort num) - reads %R variables

Values:
addr: data address (zero based)
num: number of data units to read (digital: 1 to 7992, analog: 1 to 500)

Return:
table of read data, table size=num

bool WrDigitalOuts(ushort addr, bool[] val, ushort num) - writes %Q variables
bool WrDigitalIns(ushort addr, bool[] val, ushort num) - writes %I variables
bool WrDigitalMem(ushort addr, bool[] val, ushort num) - writes %M variables
bool WrDigitalTemp(ushort addr, bool[] val, ushort num) - writes %T variables
bool WrAnalogOuts(ushort addr, ushort[] val, ushort num) - writes %AQ variables
bool WrAnalogIns(ushort addr, ushort[] val, ushort num) - writes %AI variables
bool WrRegs(ushort addr, ushort[] val, ushort num) - writes %R variables

Values:
addr: data address (zero based)
val: table of values to write, table size=num
num: number of data units to write (digital: 1 to 7992, analog: 1 to 500)

Return:
true if operation is successful, otherwise false

bool RunPLC(bool val) - Start / Stop PLC

Values:
true = Run mode with I/O enabled
false = Stop mode with I/O enabled

Return:
true if operation is successful, otherwise false

Controls

Switch

Properties:
bool Val - switch state, false=off, true=on

Methods:
void Set(bool val) - sets switch state, false=off, true=on

Default value: false

Tristat

Properties:
int Val - tristat state, values are: 0, 1 and 2

Methods:
void Set(int val) - sets tristat state, valid values are: 0, 1 and 2

Default value: 0

Slider

Properties:
float Val - slider state, values are from Min to Max
float Max - maximum slider scale value
float Min - minimum slider scale value
float Step - slider step value

Methods:
void Set(float val) - sets slider state, valid values are from Min to Max, this doesn't need to be (Min + multiplication of Step)
void Reset(float max, float min) - resets slider. Max=max, Min=min, Val=min. If max<min Max is set to Min+100. Step is counted as (Max-Min)/100
void Reset(float max, float min, float step) - resets slider. Same as above, but Step=step. If step is too big Step is counted as (Max-Min)/10
void Reset(float val, float max, float min, float step) - resets slider. Same as above, but Val=val, valid values are from Min to Max

Default values: Val=0, Max=100, Min=0, Step=1

Knob

Properties:
float Val - knob state, values are from Min to Max
float Max - maximum knob scale value
float Min - minimum knob scale value
float Step - knob step value

Methods:
void Set(float val) - sets knob state, valid values are from Min to Max, this doesn't need to be (Min + multiplication of Step)
void Reset(float max, float min) - resets knob. Max=max, Min=min, Val=min. If max<min Max is set to Min+100. Step is always (Max-Min)/270
void Reset(float val, float max, float min) - resets slider. Same as above, but Val=val, valid values are from Min to Max

Default values: Val=0, Max=270, Min=0, Step=1

Lamp

Properties:
bool Val - lamp state, false=off, true=on
int Sizze (in ScadaWeb int Size) - lamp diameter in pixels

Methods:
void Set(bool val) - sets lamp state, false=off, true=on
void Reset(bool val, int size) - resets lamp. Val=val, Sizze=size (minimum 20)

Default values: Val=false, Sizze=80

Term, Tanksame as Slider

All controls have the same event: ValueChanged, which indicates change of control state. Event does not carry any arguments becouse all control properties are avaliable to read.