Export translations
Views
Special page
From OpenSCADAWiki
Jump to:
navigation
,
search
Settings
Group
About
Documents
Documents/API
Documents/DAQ
Documents/FAQ
Documents/How to
Documents/How to/Build from source
Documents/How to/Crash report
Documents/How to/Create module
Documents/How to/Create multi language project
Documents/How to/Cyclic programming
Documents/How to/Debug
Documents/How to/Install
Documents/How to/Live disk
Documents/How to/Release
Documents/How to/Transferring project configuration
Documents/How to/Violations, alarms and notifications
Documents/Program manual
Documents/Quick start
Documents/Release 0.8.0
Documents/Release 0.8.0/Update10
Documents/Release 0.8.0/Update11
Documents/Release 0.8.0/Update12
Documents/Release 0.8.0/Update13
Documents/Release 0.8.0/Update14
Documents/Release 0.8.0/Update15
Documents/Release 0.8.0/Update16
Documents/Release 0.8.0/Update17
Documents/Release 0.8.0/Update18
Documents/Release 0.8.0/Update19
Documents/Release 0.8.0/Update20
Documents/Release 0.8.0/Update3
Documents/Release 0.8.0/Update4
Documents/Release 0.8.0/Update5
Documents/Release 0.8.0/Update6
Documents/Release 0.8.0/Update7
Documents/Release 0.8.0/Update8
Documents/Release 0.8.0/Update9
Documents/Release 0.9
Documents/Release 0.9/Update 7
Documents/Release 0.9/Update1
Documents/Release 0.9/Update2
Documents/Release 0.9/Update3
Documents/Release 0.9/Update4
Documents/Release 0.9/Update5
Documents/Release 0.9/Update6
Documents/Release 0.9/Updating 0.8.0 LTS
Documents/Terms
Documents/User API
Functions and demands
Home
Libs
Libs/Devices
Libs/Documents
Libs/Electrical elements
Libs/Generic list
Libs/LowLevelDevices
Libs/Main
Libs/Main graphical elements
Libs/Mnemo elements
Libs/Prescriptions
Libs/Regulation elements
Libs/Service procedures
Libs/Technological apparatuses
Modules
Modules/BFN
Modules/BlockCalc
Modules/Comedi
Modules/DAQGate
Modules/DBArch
Modules/DBF
Modules/DBGate
Modules/DCON
Modules/DiamondBoards
Modules/FireBird
Modules/FLibComplex1
Modules/FLibMath
Modules/FLibSYS
Modules/FSArch
Modules/GPIO
Modules/HTTP
Modules/ICP DAS
Modules/JavaLikeCalc
Modules/LDAP
Modules/LogicLev
Modules/ModBus
Modules/MySQL
Modules/OPC UA
Modules/PostgreSQL
Modules/QTCfg
Modules/QTStarter
Modules/SelfSystem
Modules/Serial
Modules/Siemens
Modules/SMH2Gi
Modules/SNMP
Modules/Sockets
Modules/SoundCard
Modules/SQLite
Modules/SSL
Modules/System
Modules/SystemTests
Modules/UserProtocol
Modules/VCAEngine
Modules/Vision
Modules/WebCfg
Modules/WebCfgD
Modules/WebUser
Modules/WebVision
Sub-projects
Sub-projects/Automatic Builder of OpenSCADA
Sub-projects/Automation Linux distributive
Sub-projects/Embedding and PLC
Sub-projects/Server
Sub-projects/VCA
User:RomanSavochenko
Using
Using/HouseSpirit
Using/Kramatorsk Ball Mills
Using/Kramatorsk Water
Using/Model AGLKS
Using/Model Boiler
Using/OpenWrt TELEOFIS RTU968
Using/Yaroslavskij broiler
Works
Works/Road map
Works/Technical Support
Works/Technical Support/Agreement
Works/To do
Language
aa - Afar
ab - Abkhazian
ace - Achinese
ady - Adyghe
ady-cyrl - адыгабзэ
aeb - Tunisian Arabic
aeb-arab - تونسي
aeb-latn - Tûnsî
af - Afrikaans
ak - Akan
aln - Gheg Albanian
am - Amharic
an - Aragonese
ang - Old English
anp - Angika
ar - Arabic
arc - Aramaic
arn - Mapuche
arq - Algerian Arabic
ary - Moroccan Arabic
arz - Egyptian Arabic
as - Assamese
ase - American Sign Language
ast - Asturian
av - Avaric
avk - Kotava
awa - Awadhi
ay - Aymara
az - Azerbaijani
azb - تۆرکجه
ba - Bashkir
bar - Bavarian
bbc - Batak Toba
bbc-latn - Batak Toba
bcc - Southern Balochi
bcl - Bikol Central
be - Belarusian
be-tarask - Belarusian (Taraškievica orthography)
bg - Bulgarian
bgn - Western Balochi
bho - Bhojpuri
bi - Bislama
bjn - Banjar
bm - Bambara
bn - Bengali
bo - Tibetan
bpy - Bishnupriya
bqi - Bakhtiari
br - Breton
brh - Brahui
bs - Bosnian
bto - Iriga Bicolano
bug - Buginese
bxr - буряад
ca - Catalan
cbk-zam - Chavacano de Zamboanga
cdo - Min Dong Chinese
ce - Chechen
ceb - Cebuano
ch - Chamorro
cho - Choctaw
chr - Cherokee
chy - Cheyenne
ckb - Central Kurdish
co - Corsican
cps - Capiznon
cr - Cree
crh - Crimean Turkish
crh-cyrl - Crimean Turkish (Cyrillic script)
crh-latn - Crimean Turkish (Latin script)
cs - Czech
csb - Kashubian
cu - Church Slavic
cv - Chuvash
cy - Welsh
da - Danish
de - German
de-at - Austrian German
de-ch - Swiss High German
de-formal - German (formal address)
diq - Zazaki
dsb - Lower Sorbian
dtp - Central Dusun
dty - डोटेली
dv - Divehi
dz - Dzongkha
ee - Ewe
egl - Emilian
el - Greek
eml - Emiliano-Romagnolo
en - English
en-ca - Canadian English
en-gb - British English
eo - Esperanto
es - Spanish
et - Estonian
eu - Basque
ext - Extremaduran
fa - Persian
ff - Fulah
fi - Finnish
fit - Tornedalen Finnish
fj - Fijian
fo - Faroese
fr - French
frc - Cajun French
frp - Arpitan
frr - Northern Frisian
fur - Friulian
fy - Western Frisian
ga - Irish
gag - Gagauz
gan - Gan Chinese
gan-hans - Simplified Gan script
gan-hant - Traditional Gan script
gd - Scottish Gaelic
gl - Galician
glk - Gilaki
gn - Guarani
gom - Goan Konkani
gom-deva - Goan Konkani (Devanagari script)
gom-latn - Goan Konkani (Latin script)
got - Gothic
grc - Ancient Greek
gsw - Swiss German
gu - Gujarati
gv - Manx
ha - Hausa
hak - Hakka Chinese
haw - Hawaiian
he - Hebrew
hi - Hindi
hif - Fiji Hindi
hif-latn - Fiji Hindi (Latin script)
hil - Hiligaynon
ho - Hiri Motu
hr - Croatian
hrx - Hunsrik
hsb - Upper Sorbian
ht - Haitian Creole
hu - Hungarian
hy - Armenian
hz - Herero
ia - Interlingua
id - Indonesian
ie - Interlingue
ig - Igbo
ii - Sichuan Yi
ik - Inupiaq
ike-cans - Eastern Canadian (Aboriginal syllabics)
ike-latn - Eastern Canadian (Latin script)
ilo - Iloko
inh - Ingush
io - Ido
is - Icelandic
it - Italian
iu - Inuktitut
ja - Japanese
jam - Jamaican Creole English
jbo - Lojban
jut - Jutish
jv - Javanese
ka - Georgian
kaa - Kara-Kalpak
kab - Kabyle
kbd - Kabardian
kbd-cyrl - Адыгэбзэ
kg - Kongo
khw - Khowar
ki - Kikuyu
kiu - Kirmanjki
kj - Kuanyama
kk - Kazakh
kk-arab - Kazakh (Arabic script)
kk-cn - Kazakh (China)
kk-cyrl - Kazakh (Cyrillic script)
kk-kz - Kazakh (Kazakhstan)
kk-latn - Kazakh (Latin script)
kk-tr - Kazakh (Turkey)
kl - Kalaallisut
km - Khmer
kn - Kannada
ko - Korean
ko-kp - 한국어 (조선)
koi - Komi-Permyak
kr - Kanuri
krc - Karachay-Balkar
kri - Krio
krj - Kinaray-a
ks - Kashmiri
ks-arab - Kashmiri (Arabic script)
ks-deva - Kashmiri (Devanagari script)
ksh - Colognian
ku - Kurdish
ku-arab - كوردي (عەرەبی)
ku-latn - Kurdish (Latin script)
kv - Komi
kw - Cornish
ky - Kyrgyz
la - Latin
lad - Ladino
lb - Luxembourgish
lbe - лакку
lez - Lezghian
lfn - Lingua Franca Nova
lg - Ganda
li - Limburgish
lij - Ligurian
liv - Livonian
lmo - Lombard
ln - Lingala
lo - Lao
loz - Lozi
lrc - Northern Luri
lt - Lithuanian
ltg - Latgalian
lus - Mizo
luz - Southern Luri
lv - Latvian
lzh - Literary Chinese
lzz - Laz
mai - Maithili
map-bms - Basa Banyumasan
mdf - Moksha
mg - Malagasy
mh - Marshallese
mhr - Eastern Mari
mi - Maori
min - Minangkabau
mk - Macedonian
ml - Malayalam
mn - Mongolian
mo - молдовеняскэ
mr - Marathi
mrj - Western Mari
ms - Malay
mt - Maltese
mus - Creek
mwl - Mirandese
my - Burmese
myv - Erzya
mzn - Mazanderani
na - Nauru
nah - Nāhuatl
nan - Min Nan Chinese
nap - Neapolitan
nb - Norwegian Bokmål
nds - Low German
nds-nl - Low Saxon
ne - Nepali
new - Newari
ng - Ndonga
niu - Niuean
nl - Dutch
nl-informal - Nederlands (informeel)
nn - Norwegian Nynorsk
nov - Novial
nrm - Nouormand
nso - Northern Sotho
nv - Navajo
ny - Nyanja
oc - Occitan
olo - Livvi-Karelian
om - Oromo
or - Oriya
os - Ossetic
pa - Punjabi
pag - Pangasinan
pam - Pampanga
pap - Papiamento
pcd - Picard
pdc - Pennsylvania German
pdt - Plautdietsch
pfl - Palatine German
pi - Pali
pih - Norfuk / Pitkern
pl - Polish
pms - Piedmontese
pnb - Western Punjabi
pnt - Pontic
prg - Prussian
ps - Pashto
pt - Portuguese
pt-br - Brazilian Portuguese
qu - Quechua
qug - Chimborazo Highland Quichua
rgn - Romagnol
rif - Riffian
rm - Romansh
rmy - Romani
rn - Rundi
ro - Romanian
roa-tara - tarandíne
ru - Russian
rue - Rusyn
rup - Aromanian
ruq - Megleno-Romanian
ruq-cyrl - Megleno-Romanian (Cyrillic script)
ruq-latn - Megleno-Romanian (Latin script)
rw - Kinyarwanda
sa - Sanskrit
sah - Sakha
sat - Santali
sc - Sardinian
scn - Sicilian
sco - Scots
sd - Sindhi
sdc - Sassarese Sardinian
sdh - Southern Kurdish
se - Northern Sami
sei - Seri
ses - Koyraboro Senni
sg - Sango
sgs - Samogitian
sh - Serbo-Croatian
shi - Tachelhit
shi-latn - Tašlḥiyt
shi-tfng - ⵜⴰⵛⵍⵃⵉⵜ
si - Sinhala
sk - Slovak
sl - Slovenian
sli - Lower Silesian
sm - Samoan
sma - Southern Sami
sn - Shona
so - Somali
sq - Albanian
sr - Serbian
sr-ec - Serbian (Cyrillic script)
sr-el - Serbian (Latin script)
srn - Sranan Tongo
ss - Swati
st - Southern Sotho
stq - Saterland Frisian
su - Sundanese
sv - Swedish
sw - Swahili
szl - Silesian
ta - Tamil
tcy - Tulu
te - Telugu
tet - Tetum
tg - Tajik
tg-cyrl - Tajik (Cyrillic script)
tg-latn - Tajik (Latin script)
th - Thai
ti - Tigrinya
tk - Turkmen
tl - Tagalog
tly - Talysh
tn - Tswana
to - Tongan
tokipona - Toki Pona
tpi - Tok Pisin
tr - Turkish
tru - Turoyo
ts - Tsonga
tt - Tatar
tt-cyrl - Tatar (Cyrillic script)
tt-latn - Tatar (Latin script)
tum - Tumbuka
tw - Twi
ty - Tahitian
tyv - Tuvinian
tzm - Central Atlas Tamazight
udm - Udmurt
ug - Uyghur
ug-arab - Uyghur (Arabic script)
ug-latn - Uyghur (Latin script)
uk - Ukrainian
ur - Urdu
uz - Uzbek
uz-cyrl - ўзбекча
uz-latn - oʻzbekcha
ve - Venda
vec - Venetian
vep - Veps
vi - Vietnamese
vls - West Flemish
vmf - Main-Franconian
vo - Volapük
vot - Votic
vro - Võro
wa - Walloon
war - Waray
wo - Wolof
wuu - Wu Chinese
xal - Kalmyk
xh - Xhosa
xmf - Mingrelian
yi - Yiddish
yo - Yoruba
yue - Cantonese
za - Zhuang
zea - Zeelandic
zh - Chinese
zh-cn - Chinese (China)
zh-hans - Simplified Chinese
zh-hant - Traditional Chinese
zh-hk - Chinese (Hong Kong)
zh-mo - 中文(澳門)
zh-my - 中文(马来西亚)
zh-sg - Chinese (Singapore)
zh-tw - Chinese (Taiwan)
zu - Zulu
qqq - Message documentation
Format
Export for off-line translation
Export in native format
{{DISPLAYTITLE:Modules/FLibSYS}}<languages/> {| class="wikitable" |- ! Module !! Name !! Version !! License !! Source !! Languages !! Platforms !! Type !! Author !! Description |- <section begin=info /> | [[Special:MyLanguage/Modules/FLibSYS|FLibSYS]] || System functions | 1.8 || GPL2 || spec_FLibSYS.so || en,uk,ru,de || x86,x86_64,ARM <section end=info /> | Special || {{Author|Roman Savochenko|Maxim Lysenko (2009) — the page initial translation}} || Provides a library of the system functions of the user programming area of OpenSCADA. |} __TOC__ The module provides OpenSCADA for static library of functions for use in the user programming environment and the organization of extraordinary interaction algorithms. To address the functions of the library you can use the static call address '''Special.FLibSYS.{Func}()''' or dynamic '''SYS.Special.FLibSYS["{Func}"].call()''', '''SYS.Special.FLibSYS.{Func}()'''. Where ''{Func}'' — function identifier in the library. == System-wide functions == === {{Anch|sysCall|SYS: Call (sysCall)}} === ''Description:'' Calling the console commands of the OS. The function offers great opportunities to the OpenSCADA user by calling any system software, utilities and scripts, as well as getting the access to the huge volume of system data by means of them. For example the command "ls-l" returns the detailed contents of the working directory.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Name !! Type !! Mode !! By defaults |- | rez || Result || String || Return || |- | com || Command || String || Input || |} ''Example:'' <syntaxhighlight lang="JS"> using Special.FLibSYS; test=sysCall("ls -l"); messPut("Example",0,"Example: "+test); </syntaxhighlight> === {{Anch|IO|SYS: Input/Output (IO)}} === ''Description:'' Input/Output to: file, string stream.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | rez || Result || Object(IO) || Return || |- | name || File name or data (for string stream) || String || In|| |- | accs || File access (""-string stream;"r[+]"-read;"w[+]"-write from zero;"a[+]"-append;...) || String || In || |- | mFormat || Machine data format ('n'-sys order;'b'-BigEndian;'l'-LittleEndian) || Integer || In || "n" |- | enc || String encoding in the file/stream || Boolean || In || |} ==== IO object ==== Values: * ''valType'' — value types: ** "uchar", "unsigned char", "char", "schar", "signed char"; ** "uint8"; ** "uint16", "ushort"; ** "uint32", "uint", "ulong"; ** "uint64"; ** "int8", "integer*1"; ** "int16", "short", "integer*2"; ** "int32", "int", "long", "integer*4", "integer"; ** "int64", "integer*8"; ** "float", "float32", "single", "real*4"; ** "double", "float64", "real*8", "real"; * ''accs'' — access mode and type: ** '' — string stream; ** 'r[+]' — read; ** 'w[+]' — write from zero; ** 'a[+]' — append. * ''mFmt'' — machine format: ** 'n' — native; ** 'l' — LittleEndian; ** 'b' — BigEndian. Properties: * ''length'' — stream length; * ''pos'' (w) — stream read/write position; * ''string'' (w) — string stream full value; * ''mFormat'' (w) — machine data format; * ''stringEncode'' (w) — file/stream substring encoding. Functions: * ''bool open(string name = "", string accs = "", string mFormat = "n", string enc = "");'' — opens a new stream for string or the file ''name''. * ''bool close();'' — closes the stream. * ''{string|int|real|Array[int|real]} read(string valType = "char", int cnt = -1, string mFormatEnc = "n|NoEnc");'' — reads a value of the ''valType'' in the ''cnt'' for the machine format or the input string encoding ''mFormatEnc''. * ''{int|IO} {write|wr}({string|int|real|Array} vals, string valType = "char", string mFormatEnc = "n|NoEnc", int cnt = 1);'' — writes the value(s) ''vals'' for the type ''valType'' for the machine format or the input string encoding ''mFormatEnc'', and a repeat of scalar values in the amount ''cnt''. === {{Anch|dbReqSQL|DB: SQL request (dbReqSQL)}} === ''Description:'' Formation of the SQL-request ''req'' to the DB ''addr'', inside (''trans''=true), outside (''trans''=false) or no matter (''trans''=EVAL) to a transaction. At an error the result's property "err" sets to the error value.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Name !! Type !! Mode !! By defaults |- | rez || Result || Object(Array) || Return || |- | addr || DB address, "{TypeDB}.{DB}" || String || Input || |- | req || SQL request || String || Input || |- | trans || Transaction || Boolean || Input || EVAL |} === {{Anch|xmlNode|XML: Node (xmlNode)}} === ''Description:'' Creating a XML node object.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Name !! Type !! Mode !! By defaults |- | rez || Result || Object(XMLNodeObj) || Return || |- | name || Name || String || Input || |} ''Example:'' <syntaxhighlight lang="JS"> using Special.FLibSYS; //Creating the "get" object of the XML node. req = xmlNode("get"); //Creating the "get" object of the XML node with attributes creating. //sub_DAQ/mod_ModBus/cntr_1/prm_1 — path according to the project structure. req = xmlNode("get").setAttr("path","/sub_DAQ/mod_ModBus/cntr_1/prm_1/%2fprm%2fst%2fen"); </syntaxhighlight> === {{Anch|xmlCntrReq|XML: Control request (xmlCntrReq)}} === ''Description:'' Requesting for control the program, by XML. The usual request is written in the form "'''<get path="/OPat/%2felem"/>'''". When we indicate the station the request to the specified external station is made.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Name !! Type !! Mode !! By defaults |- | rez || Result || String || Return || |- | req || Request || Object(XMLNodeObj) || Output || |- | stat || Station || String || Input || |} ''Example (more examples see for [[Special:MyLanguage/Documents/User_API#SYS|the equal internal function SYS.cntrReq()]]):'' <syntaxhighlight lang="JS"> using Special.FLibSYS; //Getting status "Off/On" of the parameter "1" of the controller "1" of the module "ModBus". //sub_DAQ/mod_ModBus/cntr_1/prm_1 — the path according to the project structure. req = xmlNode("get").setAttr("path","/sub_DAQ/mod_ModBus/cntr_1/prm_1/%2fprm%2fst%2fen"); rez = xmlCntrReq(req); messPut("test",0,"Example: "+req.text()); //Setting the status "On" of the parameter "1" of the controller "1" of the module "ModBus". req = xmlNode("set").setAttr("path","/sub_DAQ/mod_ModBus/cntr_1/prm_1/%2fprm%2fst%2fen").setText(1); rez = xmlCntrReq(req); //Setting the status "Off of the parameter "1" of the controller "1" of the module "ModBus". req = xmlNode("set").setAttr("path","/sub_DAQ/mod_ModBus/cntr_1/prm_1/%2fprm%2fst%2fen").setText(0); rez = xmlCntrReq(req); </syntaxhighlight> == Functions of working with time == === {{Anch|tmTime|Time: Time (tmTime)}} === ''Description:'' Returns the absolute time in seconds from the epoch of 1/1/1970 and the microseconds part into ''usec'', if such a variable is indicated and its value is negative.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifiers !! Parameter !! Type !! Mode !! By defaults |- | sec || Seconds || Integer || Return || 0 |- | usec || Microseconds || Integer || Output || -1 |} === {{Anch|tmDate|Time: Date and time (tmDate)}} === ''Description:'' Full date and time in seconds, minutes, hours, etc., based on the absolute time in seconds from the epoch of 1.1.1970.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | fullsec || Full seconds || Integer || Input || 0 |- | sec || Seconds [0...59] || Integer || Output || 0 |- | min || Minutes [0...59] || Integer || Output || 0 |- | hour || Hours [0...23] || Integer || Output || 0 |- | mday || Day of the month [1...31] || Integer || Output || 0 |- | month || Month [0...11] || Integer || Output || 0 |- | year || Year, from 1900 || Integer || Output || 0 |- | wday || Day of the week [0...6] || Integer || Output || 0 |- | yday || Day of the year [0...365] || Integer || Output || 0 |- | isdst || Daylight saving time || Integer || Output || 0 |} ''Example:'' <syntaxhighlight lang="JS"> using Special.FLibSYS; curMin=curHour=curDay=curMonth=curYear=0; tmDate(tmTime(),0,curMin,curHour,curDay,curMonth,curYear); messPut("test",0,"Current minute: "+curMin); messPut("test",0,"Current hour: "+curHour); messPut("test",0,"Current day: "+curDay); messPut("test",0,"Current month: "+curMonth); messPut("test",0,"Current Year: "+curYear); </syntaxhighlight> === {{Anch|tmFStr|Time: String time (tmFStr)}} === ''Description:'' Getting the time in the formatted string. Recording of the format corresponds to the POSIX-function "strftime()".<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | val || Date and time string || String || Return || |- | sec || Seconds || Integer || Input || 0 |- | form || Date and time format || String || Input || %Y-%m-%d %H:%M:%S |} ''Example:'' <syntaxhighlight lang="JS"> using Special.FLibSYS; test = tmFStr(SYS.time(),"%d %m %Y"); messPut("Example",0,"tmFStr(): "+test); </syntaxhighlight> === {{Anch|tmStrPTime|Time: String to time (tmStrPTime)}} === ''Description:'' Converting the string data and time, for the ''form'', to the time in seconds since 01.01.1970. For example, template "%Y-%m-%d %H:%M:%S" corresponds the time "2006-08-08 11:21:55". Description of the format of the template can be obtained from the documentation on the POSIX-function "strptime()".<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | sec || Seconds || Integer || Return || 0 |- | str || Date and time string || String || Input || |- | form || Date and time format || String || Input || %Y-%m-%d %H:%M:%S |} ''Example:'' <syntaxhighlight lang="JS"> using Special.FLibSYS; curMin=curHour=curDay=curMonth=curYear=0; tmDate(tmTime(),0,curMin,curHour,curDay,curMonth,curYear); test = tmStrPTime(""+curYear+"-"+(curMonth+1)+"-"+curDay+" 9:0:0","%Y-%m-%d %H:%M:%S"); messPut("Example",0,"tmStrPTime(): "+test); </syntaxhighlight> === {{Anch|tmCron|Time: Schedule time at CRON (tmCron)}} === ''Description:'' Scheduling the time at the CRON standard, returning the planned time from the ''base'' time or from the current time, if the base is not specified.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | res || Result, seconds || Integer || Return || 0 |- | str || CRON || String || Input || * * * * * |- | base || Base time, seconds || Integer || Input || 0 |} === {{Anch|tmSleep|Time: sleep (tmSleep)}} === ''Description:'' Short sleeping from nanoseconds and up to STD_INTERF_TM (5 seconds).<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | res || Result || Integer || Return || 0 |- | tm || Time, seconds || Real || Input || |} == Functions of the strings processing == === {{Anch|strSize|String: Get size (strSize)}} === ''Description:'' Getting size of the string.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | rez || Result || Integer || Return || |- | str || String || String || Input || |} ''Example:'' <syntaxhighlight lang="JS"> using Special.FLibSYS; messPut("Example",1,"ReturnString: "+strSize("Example")); </syntaxhighlight> === {{Anch|strSubstr|String: Get substring (strSubstr)}} === ''Description:'' Getting of the substring.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | rez || Result || String || Return || |- | str || String || String || Input || |- | pos || Position || Integer || Input || 0 |- | n || Number || Integer || Input || -1 |} ''Example:'' <syntaxhighlight lang="JS"> using Special.FLibSYS; test = strSubstr("Example", 0, strSize("Example")-1); messPut("Example", 1, "ReturnString: "+test); </syntaxhighlight> === {{Anch|strInsert|String: Insert a string to other string (strInsert)}} === ''Description:'' Inserting a string to another string.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | str || String || String || Output || |- | pos || Position || Integer || Input || 0 |- | ins || String to insert || String || Input || |} === {{Anch|strReplace|String: Replace a part of the string by another string (strReplace)}} === ''Description:'' Replacing a part of the string by another string.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | str || String || String || Output || |- | pos || Position || Integer || Input || 0 |- | n || Number || Integer || Input || -1 |- | repl || String to replace || String || Input || |} === {{Anch|strParse|String: Parse with a separator (strParse)}} === ''Description:'' Parsing the string with a separator.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | rez || Result || String || Return || |- | str || String || String || Input || |- | lev || Level || Integer || Input || |- | sep || Separator || String || Input || "." |- | off || Offset || Integer || Output || |} ''Example:'' <syntaxhighlight lang="JS"> using Special.FLibSYS; ExapleString = "Example:123"; test = strParse(ExapleString, 1, ":"); messPut("Example", 0, "strParse(): "+test); </syntaxhighlight> === {{Anch|strParsePath|String: Parse of the path (strParsePath)}} === ''Description:'' Parsing of the path for items.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | rez || Result || String || Return || |- | path || Path || String || Input || |- | lev || Level || Integer || Input || |- | off || Offset || Integer || Output || |} ''Example:'' <syntaxhighlight lang="JS"> using Special.FLibSYS; test = strParsePath(path, 0, "/"); messPut("Example", 1, "strParsePath(): "+test); </syntaxhighlight> === {{Anch|strPath2Sep|String: Path to separated string (strPath2Sep)}} === ''Description:'' Converting the path to the separated string.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | rez || Result || String || Return || |- | src || Source || String || Input || |- | sep || Separator || String || Input || "." |} ''Example:'' <syntaxhighlight lang="JS"> //Converting the value "/ses_AGLKS/pg_so" of the attribute "path" to the value "ses_AGLKS.pg_so" using Special.FLibSYS; test = strPath2Sep(path); messPut("Example", 0, "path: "+path); messPut("Example", 0, "strPath2Sep(): "+test); </syntaxhighlight> === {{Anch|strEnc2HTML|String: Encode string to HTML (strEnc2HTML)}} === ''Description:'' Encoding the string to use into the HTML source.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | rez || Result || String || Return || |- | src || Source || String || Input || |} === {{Anch|strEnc2Bin|String: Encode text to binary (strEnc2Bin)}} === ''Description:'' Encoding the text to the binary, for the text format <00 A0 FA DE>.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | rez || Result || String || Return || |- | src || Source || String || Input || |} === {{Anch|strDec4Bin|String: Decode text from binary (strDec4Bin)}} === ''Description:'' Decoding the text from the binary, for the text format <00 A0 FA DE>.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | rez || Result || String || Return || |- | src || Source || String || Input || |} === {{Anch|real2str|String: Real to string (real2str)}} === ''Description:'' Converting the real value to the string format.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | rez || Result || String || Return || |- | val || Value || Real || Input || |- | prc || Precision || Integer || Input || 4 |- | tp || Type || String || Input || "f" |} === {{Anch|int2str|String: Integer to string (int2str)}} === ''Description:'' Converting the integer value to the string format.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | rez || Result || String || Return || |- | val || Value || Integer || Input || |- | base || Base (8, 10, 16) || Integer || Input || 10 |} === {{Anch|str2real|String: String to real (str2real)}} === ''Description:'' Converting the string value to the real format.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | rez || Result || Real || Return || |- | val || Value || String || Input || |} === {{Anch|str2int|String: String to integer (str2int)}} === ''Description:'' Converting the string value to the integer format.<br/> ''Parameters:'' {| class="wikitable" |- ! ID !! Parameter !! Type !! Mode !! By defaults |- | rez || Result || Integer || Return || |- | val || Value || String || Input || |- | base || Base (2...36) || Integer || Input || 0 |} === {{Anch|CRC|Cyclic Redundancy Code (CRC)}} === ''Description:'' Unified and completed implementing of the Cyclic Redundancy Code for the width in 1-64 bits with normal polynomial, the initial CRC, the input and output reference, and the XOR for output.<br/> The previous notation of the function is supported also, where the reversed polynomial is placed in the ''width'' place!<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | rez || Result || Integer || Return || |- | data || Data || String || Input || |- | width || Width || Integer || Input || 16 |- | poly || Polynomial || Integer || Input || 32773 (0x8005) |- | init || Initial || Integer || Input || -1 (0xFFFFFFFFFFFFFFFF) |- | RefIn || Reference input || Bool || Input || 1 |- | RefOut || Reference output || Bool || Input || 1 |- | XorOut || XOR for output || Integer || Input || 0 |} === {{Anch|MD5|Message Digest 5 (MD5)}} === ''Description:'' Calculating for the message Digest 5 of the ''data''.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | rez || Result || String || Return || |- | data || Data || String || Input || |} == Functions for the real processing == === {{Anch|floatSplitWord|Float: Split to the words (floatSplitWord)}} === ''Description:'' Splitting the float value (4 bytes) to the two words (2 bytes).<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | val || Value || Real || Input || |- | w1 || Word 1 || Integer || Output || |- | w2 || Word 2 || Integer || Output || |} === {{Anch|floatMergeWord|Float: Merge from the words (floatMergeWord)}} === ''Description:'' Forming the float value (4 bytes) from the two words (2 bytes).<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | rez || Result || Real || Return || |- | w1 || Word 1 || Integer || Input || |- | w2 || Word 2 || Integer || Input || |} === {{Anch|floatExtract|Float: Extract (floatExtract)}} === ''Description:'' Extracting for mantissa and exponent from the float value.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | magn || Magnitude || Real || Return || |- | val || Value || Real || Input || |- | exp || Exponent || Integer || Output || |} == Functions of archives == === {{Anch|messGet|Mess: Get (messGet)}} === ''Description:'' Get messages of the program.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | rez || Result || Object(Array) || Return || |- | btm || Begin time, seconds || Integer || Input || |- | etm || End time, seconds || Integer || Input || |- | cat || Category || String || Input || |- | lev || Level || Integer || Input || |- | arch || Archiver || String || Input || |} === {{Anch|messPut|Mess: Put (messPut)}} === ''Description:'' Put a message to the program.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | cat || Category || String || Input || |- | lev || Level || Integer || Input || |- | mess || Message || String || Input || |} ''Example:'' <syntaxhighlight lang="JS"> rnd_sq_gr11_lineClr="red"; Special.FLibSYS.messPut("Example",1,"Event: "+rnd_sq_gr12_leniClr); </syntaxhighlight> === {{Anch|vArh|Val: Archive (vArh)}} === ''Description:'' Getting the value archive object (VArchObj) through connecting to the archive at its address.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Name !! Type !! Mode !! By defaults |- | rez || Result || Object(VArchObj) || Return || |- | name || Name — address to the attribute of the parameter ('''DAQ.{Module}.{Cntr}.{Prm}.{Attr}''') with the archive or directly to the value archive ('''Archive.va_{ValArchive}'''). || String || Input || |} ==== VArchObj object ==== Functions: * ''bool isNull()'' — object is not initiated. * ''int begin( int usec = 0, string archiver = "" )'' — start time of the archive, through the return of seconds and microseconds ''usec'' for the ''archiver''. * ''int end( int usec = 0, string archiver = "" )'' — end time of the archive, through the return of seconds and microseconds ''usec'' for the ''archiver''. * ''int period( int usec = 0, string archiver = "" )'' — period of the archive, through the return of seconds and microseconds ''usec'' for the ''archiver''. * ''ValObj get( int sec, int usec, bool upOrd = false, string archiver = "" )'' — value from the archive at the time ''sec'':''usec'' linked to the top ''upOrd'' for the ''archiver''. Real time of the obtained value is set in ''sec'':''usec''. * ''bool set( ValObj val, int sec, int usec, string archiver = "" )'' [<span style='color:red'>access to the Archive-History subsystem for archive operations</span>] — writes of the value ''val'' to the archive for the time ''sec'':''usec'' for the ''archiver''. * ''bool copy( VArchObj src, int begSec, int begUSec, int endSec, int endUSec, string archiver = "" )'' [<span style='color:red'>access to the Archive-History subsystem for archive operations</span>] — copies of the part of the source archive ''src'', or its buffer, in the current one beginning from ''begSec'':''begUSec'' and ending with ''endSec'':''endUSec'' for the ''archiver''. * ''ArrayObj FFT( int tm, real size, string archiver = "", int tm_usec = 0 )'' — performs the Fast Fourier Transformation using the FFT algorithm. Returns an array of amplitudes of the frequencies for archive's values window for begin time ''tm:tm_usec'' (seconds:microseconds), depth to history ''size'' (seconds) and for ''archiver''.<br/> ''Example:'' <syntaxhighlight lang="JS"> using Special.FLibSYS; val = vArh(strPath2Sep(addr)).get(time,uTime,0,archtor); return val.isEval() ? "Empty" : real2str(val,prec); </syntaxhighlight> === {{Anch|vArhBuf|Val: Archive buffer (vArhBuf)}} === ''Description:'' Getting a value buffer object (VArchObj) for temporary values storing and performing the intermediate operations on frames of data.<br/> ''Parameters:'' {| class="wikitable" |- ! Identifier !! Parameter !! Type !! Mode !! By defaults |- | rez || Result || Object(VArchObj) || Return || |- | tp || Type of the archive values (0-Boolean, 1-Integer, 4-Real, 5-String) || Integer || Input || 1 |- | sz || Maximum buffer size || Integer || Input || 100 |- | per || Period of the buffer values, microseconds || Integer || Input || 1000000 |- | hgrd || Hard time grid || Boolean || Input || 0 |- | hres || High time resolution (microseconds) || Boolean || Input || 0 |} == User programming API == The module, as an object, provides user programming functions. <section begin=API /> '''The object "Functions library" (SYS.Special.FLibSYS)''' * ''ElTp {funcID}(ElTp prm1, ...)'' — call the library function ''{funcID}''. Return result of the called function. '''The object "User function" (SYS.Special.FLibSYS["funcID"])''' * ''ElTp call(ElTp prm1, ...)'' — call the function with parameters ''prm{N}''. Return result of the called function. <section end=API />
Navigation menu
OpenSCADA
Site
Download
Old Wiki
OpenSCADA Wiki
Home
About OpenSCADA
Functions and demands
Tasks
Using
Fund
Recent changes
Random page
Search
Tools
Special pages
Printable version
MediaWiki
Help
Personal tools
English
Log in