esi-phdbridge
Dependencies
library | version | inmation core library |
---|---|---|
dkjson |
2.5.0 |
yes |
socket |
3.0.0 |
yes |
esi-variables |
1.0.0 |
yes |
Available functions
All functions have to be called according to the ESI standard, using colons, e.g. lib:FUNCTIONNAME(params)
Documentation
SETCONNECTION
SETCONNECTION configures TCP connection settings.
It should be called before any other PHD Bridge function.
GETSTATUS
GETSTATUS returns information about PHD Bridge service.
Returns
-
status["Version"] - version of the PHD Bridge Service.
-
status[".NET Version"] - .NET version of the PHD Bridge Service.
-
status["PhdServerHost"] - configuration of PHD Server host.
-
status["PhdServerPort"] - configuration of PHD Server port.
-
status["BufferSize"] - buffer size used to send data to the client.
-
status["TCPPortClient"] - TCP port used by clients.
-
status["MaxTCPConnectionQueues"] - the maximum length of the pending TCP connections queue.
-
status["TCPEndOfTransmissionSignal"] - client and server are sending this string at the end of the command.
-
status["ServiceName"] - name of the PHD Bridge service.
-
status["ServiceDisplayName"] - display name of the PHD Bridge service.
FETCHCURRENTDATA
FETCHCURRENTDATA returns the current data point.
For detailed explanation of all historian parameters see Uniformance PHD .NET wrapper documentation.
FETCHDATA
FETCHDATA returns a list of data points.
For detailed explanation of all historian parameters see Uniformance PHD .NET wrapper documentation.
FETCHROWDATA
FETCHROWDATA returns a list of data points.
For detailed explanation of all historian parameters see Uniformance PHD .NET wrapper documentation.
Usage
local lib = require("esi-phdbridge")
local PHDHistorian = {}
PHDHistorian.StartTime = "NOW-1H"
PHDHistorian.EndTime = "NOW"
local tagNames = {}
tagNames[1] = "FC101.PV"
tagNames[2] = "FC102.PV"
lib:SETCONNECTION({})
local result, exception = lib:FETCHROWDATA(tagNames, PHDHistorian)
return (require "esi-string"):STRING({res=result,ex=exception})
BROWSINGTAGLIST
BROWSINGTAGLIST returns filtered list of tag data.
For detailed explanation see Uniformance PHD .NET wrapper documentation (BrowsingTagsList() method).
Usage
local lib = require("esi-phdbridge")
local filter = {}
filter.DataType = "F"
filter.ScanRate = -1
filter.Collector = nil
filter.ParentTagname = nil
filter.SourceTagname = nil
filter.SourceUnits = nil
filter.Tagname = nil
filter.TagUnits = nil
lib:SETCONNECTION({})
local result, exception = lib:BROWSINGTAGLIST(100, filter)
return (require "esi-string"):STRING({res=result,ex=exception})