OpenSCADAWiki: Doc/F LibSYS ...

Home | Index | Changes | Comments | Users | Registration | Login  Password:  
 
This is an old revision of Doc/FLibSYS from 2016-04-25 05:08:46..

Ìîäóëü ïîäñèñòåìû "Ñïåöèàëüíûå" <FLibSYS>

Ìîäóëü:FLibSYS
Èìÿ:Áèáëèîòåêà ôóíêöèé ñèñòåìíîãî API.
Òèï:Ñïåöèàëüíûå
Èñòî÷íèê:spec_FLibSYS.so
Âåðñèÿ:1.2.0
Àâòîð:Ðîìàí Ñàâî÷åíêî
Îïèñàíèå:Ïðåäîñòàâëÿåò áèáëèîòåêó ñèñòåìíîãî API ñðåäû ïîëüçîâàòåëüñêîãî ïðîãðàììèðîâàíèÿ.
Ëèöåíçèÿ:GPL


Contents

Ââåäåíèå

Ñïåöèàëüíûé ìîäóëü FLibSYS ïðåäîñòàâëÿåò â ñèñòåìó OpenSCADA ñòàòè÷åñêóþ áèáëèîòåêó ôóíêöèé äëÿ ðàáîòû ñ ñèñòåìîé OpenSCADA, íà óðîâíå å¸ ñèñòåìíîãî API. Ýòè ôóíêöèè ìîãóò èñïîëüçîâàòüñÿ â ñðåäå ïîëüçîâàòåëüñêîãî ïðîãðàììèðîâàíèÿ ñèñòåìû OpenSCADA äëÿ îðãàíèçàöèè íåîðäèíàðíûõ àëãîðèòìîâ âçàèìîäåéñòâèÿ.


Äëÿ àäðåñàöèè ê ôóíêöèÿì ýòîé áèáëèîòåêè ìîæíî èñïîëüçîâàòü ñòàòè÷åñêèé àäðåñ âûçîâà "Special.FLibSYS.{Func}()" èëè äèíàìè÷åñêèé "SYS.Special.FLibSYS["{Func}"].call()", "SYS.Special.FLibSYS.{Func}()". Ãäå {Func} — èäåíòèôèêàòîð ôóíêöèè â áèáëèîòåêå.


Íèæå ïðèâåäåíî îïèñàíèå êàæäîé ôóíêöèè áèáëèîòåêè. Äëÿ êàæäîé ôóíêöèè ïðîèçâîäèëàñü îöåíêà âðåìåíè èñïîëíåíèÿ. Èçìåðåíèå ïðîèçâîäèëîñü íà ñèñòåìå ñî ñëåäóþùèìè ïàðàìåòðàìè: Athlon 64 3000+ (ALTLinux 4.0(32áèò)) ïóò¸ì çàìåðà îáùåãî âðåìåíè èñïîëíåíèÿ ôóíêöèè ïðè âûçîâå å¸ 1000 ðàç. Âûáîðêà ïðîèçâîäèëàñü èç ïÿòè âû÷èñëåíèé ñ îêðóãëåíèåì äî ìåíüøåãî öåëîãî. Âðåìÿ çàêëþ÷àåòñÿ â óãëîâûå ñêîáêè è èçìåðÿåòñÿ â ìèêðîñåêóíäàõ.

1. Îáùåñèñòåìíûå ôóíêöèè

1.1. Âûçîâ êîíñîëüíûõ êîìàíä è óòèëèò îïåðàöèîííîé ñèñòåìû (sysCall)

Îïèñàíèå: Îñóùåñòâëÿåò âûçîâû êîíñîëüíûõ êîìàíä ÎÑ. Ôóíêöèÿ îòêðûâàåò øèðîêèå âîçìîæíîñòè ïîëüçîâàòåëþ OpenSCADA ïóò¸ì âûçîâà ëþáûõ ñèñòåìíûõ ïðîãðàìì, óòèëèò è ñêðèïòîâ, à òàêæå ïîëó÷åíèÿ ïîñðåäñòâîì íèõ äîñòóïà ê îãðîìíîìó îáú¸ìó ñèñòåìíûõ äàííûõ. Íàïðèìåð êîìàíäà "ls -l" âåðí¸ò äåòàëèçèðîâàííîå ñîäåðæèìîå ðàáî÷åé äèðåêòîðèè.
Ïàðàìåòðû:

ID Èìÿ Òèï Ðåæèì Ïî óìîë÷àíèþ
rez Ðåçóëüòàò Ñòðîêà Âîçâðàò
com Êîìàíäà Ñòðîêà Âõîä

Ïðèìåð:

using Special.FLibSYS;
test=sysCall("ls -l");
messPut("Example",0,"Example: "+test);

1.2. SQL çàïðîñ (dbReqSQL)

Îïèñàíèå: Ôîðìèðîâàíèå SQL-çàïðîñà ê ÁÄ.
Ïàðàìåòðû:

ID Èìÿ Òèï Ðåæèì Ïî óìîë÷àíèþ
rez Ðåçóëüòàò Îáúåêò(Ìàññèâ) Âîçâðàò
addr Àäðåñ ÁÄ Ñòðîêà Âõîä
req SQL-çàïðîñ Ñòðîêà Âõîä

1.3. Óçåë XML (xmlNode)

Îïèñàíèå: Ñîçäàíèå îáúåêòà óçëà XML.
Ïàðàìåòðû:

ID Èìÿ Òèï Ðåæèì Ïî óìîë÷àíèþ
rez Ðåçóëüòàò Îáúåêò(XMLNodeObj) Âîçâðàò
name Èìÿ Ñòðîêà Âõîä

Ïðèìåð:

using Special.FLibSYS;
//Ñîçäàíèå îáüåêòà "get" óçëà XML.
req = xmlNode("get");
//Ñîçäàíèå îáüåêòà "get" óçëà XML ñ ñîçäàíèåì àòðèáóòîâ.
//sub_DAQ/mod_ModBus/cntr_1/prm_1 — ïóòü ñîãëàñíî ñòðóêòóðå ïðîåêòà
req = xmlNode("get").setAttr("path",);

1.4. Çàïðîñ èíòåðôåéñà óïðàâëåíèÿ (xmlCntrReq)

Îïèñàíèå: Çàïðîñ èíòåðôåéñà óïðàâëåíèÿ ê ñèñòåìå ïîñðåäñòâîì XML. Îáû÷íûé çàïðîñ çàïèñûâàåòñÿ â âèäå "<get path="/OPath/%2felem"/>". Ïðè óêàçàíèè ñòàíöèè îñóùåñòâëÿåòñÿ çàïðîñ ê âíåøíåé ñòàíöèè.
Ïàðàìåòðû:

ID Èìÿ Òèï Ðåæèì Ïî óìîë÷àíèþ
rez Ðåçóëüòàò Ñòðîêà Âîçâðàò
req Çàïðîñ Îáúåêò(XMLNodeObj) Âûõîä
stat Ñòàíöèÿ Ñòðîêà Âõîä

Ïðèìåð:

using Special.FLibSYS;
//Ïîëó÷åíèå ïðèçíàêà "Âêëþ÷åí/Âûêëþ÷åí" ïàðàìåòðà "1" êîíòðîëëåðà "1" ìîäóëÿ "ModBus".
//sub_DAQ/mod_ModBus/cntr_1/prm_1 — ïóòü ñîãëàñíî ñòðóêòóðå ïðîåêòà
req = xmlNode("get").setAttr("path",);
rez = xmlCntrReq(req);
messPut("test",0,"Çíà÷åíèå: "+req.text());

//Óñòàíîâêà ïðèçíàêà "Âêëþ÷åí" ïàðàìåòðà "1" êîíòðîëëåðà "1" ìîäóëÿ "ModBus".
req = xmlNode("set").setAttr("path",).setText(1);
rez = xmlCntrReq(req);

//Óñòàíîâêà ïðèçíàêà "Âûêëþ÷åí" ïàðàìåòðà "1" êîíòðîëëåðà "1" ìîäóëÿ "ModBus".
req = xmlNode("set").setAttr("path",).setText(0);
rez = xmlCntrReq(req);

1.5. Àðõèâ çíà÷åíèé (vArh)

Îïèñàíèå: Ïîëó÷åíèå îáúåêòà àðõèâà çíà÷åíèé (VArchObj) ïóò¸ì ïîäêëþ÷åíèÿ ê àðõèâó ïî åãî àäðåñó.
Ïàðàìåòðû:

ID Èìÿ Òèï Ðåæèì Ïî óìîë÷àíèþ
rez Ðåçóëüòàò Îáúåêò(VArchObj) Âîçâðàò
name Èìÿ, àäðåñ ê àòðèáóòó ïàðàìåòðà ñ àðõèâîì (DAQ.{Module}.{Cntr}.{Prm}.{Attr}) èëè íåïîñðåäñòâåííî ê àðõèâó çíà÷åíèé (Archive.va_{ValArchive}). Ñòðîêà Âõîä

Îáúåêò VArchObj

Ôóíêöèè:

Ïðèìåð:

using Special.FLibSYS;
val = vArh(strPath2Sep(addr)).get(time,uTime,0,archivator);
return val.isEval() ? "Ïóñòî" : real2str(val,prec);

1.6. Áóôåð àðõèâà çíà÷åíèé (vArhBuf)

Îïèñàíèå: Ïîëó÷åíèå îáúåêòà áóôåðà àðõèâà çíà÷åíèé (VArchObj) äëÿ âûïîëíåíèÿ ïðîìåæóòî÷íûõ îïåðàöèé íàä êàäðàìè äàííûõ.
Ïàðàìåòðû:

ID Ïàðàìåòð Òèï Ðåæèì Ïî óìîë÷àíèþ
rez Ðåçóëüòàò Îáúåêò(VArchObj) Âîçâðàò
tp Òèï çíà÷åíèé àðõèâà (0-Boolean, 1-Integer, 4-Real, 5-String) Öåëûé Âõîä 1
sz Ìàêñèìàëüíûé ðàçìåð áóôåðà Öåëûé Âõîä 100
per Ïåðèîäè÷íîñòü áóôåðà (â ìèêðîñåêóíäàõ) Öåëûé Âõîä 1000000
hgrd Ðåæèì "Æåñòêàÿ ñåòêà âðåìåíè" Ëîãè÷åñêèé Âõîä 0
hres Ðåæèì "Âûñîêîãî ðàçðåøåíèÿ âðåìåíè (ìèêðîñåêóíäû)" Ëîãè÷åñêèé Âõîä 0

1.7. Ââîä/Âûâîä (IO)

Îïèñàíèå: Ââîä/Âûâîä â: ôàéë, ñòðîêîâûé ïîòîê.
Ïàðàìåòðû:

ID Ïàðàìåòð Òèï Ðåæèì Ïî óìîë÷àíèþ
rez Ðåçóëüòàò Îáúåêò(IO) Âîçâðàò
name Èìÿ ôàéëà èëè äàííûå (äëÿ ñòðîêîâîãî ïîòîêà) Ñòðîêà Âõîä
accs Äîñòóï ê ôàéëó (''-ñòðîêîâûé ïîòîê;'r[+]'-÷òåíèå;'w[+]'-çàïèñü ñ íóëÿ;'a[+]'-äîáàâëåíèå;...) Ñòðîêà Âõîä
mFormat Ôîðìàò äàííûõ ìàøèíû ('n'-ñèñò. ïîðÿäîê;'b'-BigEndian;'l'-LittleEndian) Öåëîå Âõîä "n"
enc Êîäèðîâêà ñòðîêè â ôàéëå Ëîãè÷åñêèé Âõîä

IO îáúåêò

Çíà÷åíèÿ:


Ñâîéñòâà:


Ôóíêöèè:


2. Ôóíêöèè äëÿ ðàáîòû ñ àñòðîíîìè÷åñêèì âðåìåíåì

2.1. Ñòðîêà âðåìåíè (tmFStr) <3047>

Îïèñàíèå: Ïðåîáðàçóåò àáñîëþòíîå âðåìÿ â ñòðîêó íóæíîãî ôîðìàòà. Çàïèñü ôîðìàòà ñîîòâåòñòâóåò POSIX-ôóíêöèè strftime.
Ïàðàìåòðû:

IDÏàðàìåòðÒèïÐåæèìÏî óìîë÷àíèþ
valÑòðîêà ïîëíîé äàòûÑòðîêàÂîçâðàò
secÑåêóíäûÖåëûéÂõîä0
formÔîðìàòÑòðîêàÂõîä%Y-%m-%d %H:%M:%S

Ïðèìåð:

using Special.FLibSYS;
test=tmFStr(SYS.time(),);
messPut("Example",0,"tmFStr(): "+test);

2.2. Ïîëíàÿ äàòà (tmDate) <973>

Îïèñàíèå: Âîçâðàùàåò ïîëíóþ äàòó â ñåêóíäàõ, ìèíóòàõ, ÷àñàõ è ò.ä, èñõîäÿ èç àáñîëþòíîãî âðåìåíè â ñåêóíäàõ îò ýïîõè 1.1.1970.
Ïàðàìåòðû:

IDÏàðàìåòðÒèïÐåæèìÏî óìîë÷àíèþ
fullsecÏîëíûå ñåêóíäûÖåëûéÂõîä0
secÑåêóíäû [0...59]ÖåëûéÂûõîä0
minÌèíóòû [0...59]ÖåëûéÂûõîä0
hour×àñû [0...23]ÖåëûéÂûõîä0
mdayÄåíü ìåñÿöà [1...31]ÖåëûéÂûõîä0
monthÌåñÿö [0...11]ÖåëûéÂûõîä0
yearÃîä, îò 1900ÖåëûéÂûõîä0
wdayÄåíü íåäåëè [0...6]ÖåëûéÂûõîä0
ydayÄåíü â ãîäó [0...365]ÖåëûéÂûõîä0
isdstËåòíåå âðåìÿÖåëûéÂûõîä0

Ïðèìåð:

using Special.FLibSYS;
curMin=curHour=curDay=curMonth=curYear=0;
tmDate(tmTime(),0,curMin,curHour,curDay,curMonth,curYear);
messPut("test",0,"Òåêóùàÿ ìèíóòà: "+curMin);
messPut("test",0,"Òåêóùèé ÷àñ : "+curHour);
messPut("test",0,"Òåêóùèé äåíü: "+curDay);
messPut("test",0,"Òåêóùèé ìåñÿö: "+curMonth);
messPut("test",0,"Òåêóùèé ãîä: "+curYear);

2.3. Àáñîëþòíîå âðåìÿ (tmTime) <220>

Îïèñàíèå: Âîçâðàùàåò àáñîëþòíîå âðåìÿ â ñåêóíäàõ îò ýïîõè 1.1.1970 è ìèêðîñåêóíäàõ, åñëè usec óñòàíîâëåí â íåîòðèöàòåëüíîå çíà÷åíèå.
Ïàðàìåòðû:

IDÏàðàìåòðÒèïÐåæèìÏî óìîë÷àíèþ
secÑåêóíäûÖåëûéÂîçâðàò0
usecÌèêðîñåêóíäûÖåëûéÂûõîä-1

2.4. Êîíâåðòàöèÿ âðåìåíè èç ñèìâîëüíîãî ïðåäñòàâëåíèè âî âðåìÿ â ñåêóíäàõ, îò ýïîõè 1.1.1970 (tmStrPTime) <2600>

Îïèñàíèå: Âîçâðàùàåò âðåìÿ â ñåêóíäàõ îò ýïîõè 1.1.1970, èñõîäÿ èç ñòðîêîâîé çàïèñè âðåìåíè, â ñîîòâåòñòâèè ñ óêàçàííûì øàáëîíîì. Íàïðèìåð, øàáëîíó "%Y-%m-%d %H:%M:%S" ñîîòâåòñòâóåò âðåìÿ "2006-08-08 11:21:55". Îïèñàíèå ôîðìàòà øàáëîíà ìîæíî ïîëó÷èòü èç äîêóìåíòàöèè íà POSIX-ôóíêöèþ "strptime".
Ïàðàìåòðû:

IDÏàðàìåòðÒèïÐåæèìÏî óìîë÷àíèþ
secÑåêóíäûÖåëûéÂîçâðàò0
strÑòðîêà äàòûÑòðîêàÂõîä
formÔîðìàò çàïèñè äàòûÑòðîêàÂõîä%Y-%m-%d %H:%M:%S

Ïðèìåð:

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",);
messPut("Example",0,"tmStrPTime(): "+test);

2.5. Ïëàíèðîâàíèå âðåìåíè â ôîðìàòå Cron (tmCron)

Îïèñàíèå: Âîçâðàùàåò âðåìÿ ñïëàíèðîâàííîå â ôîðìàòå ñòàíäàðòà Cron íà÷èíàÿ îò áàçîâîãî âðåìåíè èëè îò òåêóùåãî åñëè áàçîâîå íå óêàçàíî.
Ïàðàìåòðû:

ID Ïàðàìåòð Òèï Ðåæèì Ïî óìîë÷àíèþ
res Ðåçóëüòàò Öåëûé Âîçâðàò 0
str Çàïèñü â ñòàíäàðòå Cron Ñòðîêà Âõîä * * * * *
base Áàçîâîå âðåìÿ Öåëûé Âõîä 0

2.6. Ñîí (tmSleep)

Îïèñàíèå: Êîðîòêèé ñîí îò íàíîñåêóíä è äî STD_INTERF_TM (5 ñåêóíä).
Ïàðàìåòðû:

ID Ïàðàìåòð Òèï Ðåæèì Ïî óìîë÷àíèþ
res Ðåçóëüòàò Öåëûé Âîçâðàò 0
tm Âðåìÿ Âåùåñòâåííûé Âõîä 0

3. Ôóíêöèè ðàáîòû ñ ñîîáùåíèÿìè

3.1. Çàïðîñ ñîîáùåíèé (messGet)

Îïèñàíèå: Çàïðîñ ñèñòåìíûõ ñîîáùåíèé.
Ïàðàìåòðû:

IDÏàðàìåòðÒèïÐåæèìÏî óìîë÷àíèþ
rezÐåçóëüòàòÎáúåêò(Ìàññèâ)Âîçâðàò
btmÂðåìÿ íà÷àëàÖåëîåÂõîä
etmÂðåìÿ êîíöàÖåëîåÂõîä
catÊàòåãîðèÿ ñîîáùåíèÿÑòðîêàÂõîä
levÓðîâåíü ñîîáùåíèÿÖåëûéÂõîä
archÀðõèâàòîðÑòðîêàÂõîä

3.2. Ãåíåðàöèÿ ñîîáùåíèÿ (messPut)

Îïèñàíèå: Ôîðìèðîâàíèå ñèñòåìíîãî ñîîáùåíèÿ.
Ïàðàìåòðû:

IDÏàðàìåòðÒèïÐåæèìÏî óìîë÷àíèþ
catÊàòåãîðèÿ ñîîáùåíèÿÑòðîêàÂõîä
levÓðîâåíü ñîîáùåíèÿÖåëûéÂõîä
messÒåêñò ñîîáùåíèÿÑòðîêàÂõîä

Ïðèìåð:

rnd_sq_gr11_lineClr="red";
Special.FLibSYS.messPut("Example",1,"Event: "+rnd_sq_gr12_leniClr);

4. Ôóíêöèè ðàáîòû ñ ñòðîêàìè

4.1. Ïîëó÷åíèå ðàçìåðà ñòðîêè (strSize) <114>

Îïèñàíèå: Èñïîëüçóåòñÿ äëÿ ïîëó÷åíèÿ ðàçìåðà.
Ïàðàìåòðû:

IDÏàðàìåòðÒèïÐåæèìÏî óìîë÷àíèþ
rezÐåçóëüòàòÖåëûéÂîçâðàò
strÑòðîêàÑòðîêàÂõîä

Ïðèìåð:

Special.FLibSYS.messPut("Example",1,"ReturnString: "+strSize("Example"));

4.2. Ïîëó÷åíèå ÷àñòè ñòðîêè (strSubstr) <413>

Îïèñàíèå: Èñïîëüçóåòñÿ äëÿ ïîëó÷åíèÿ ÷àñòè ñòðîêè.
Ïàðàìåòðû:

IDÏàðàìåòðÒèïÐåæèìÏî óìîë÷àíèþ
rezÐåçóëüòàòÑòðîêàÂîçâðàò
strÑòðîêàÑòðîêàÂõîä
posÏîçèöèÿÖåëûéÂõîä0
nÊîëè÷åñòâîÖåëûéÂõîä-1

Ïðèìåð:

using Special.FLibSYS;
test=strSubstr("Example", 0, strSize("Example")-1);
messPut("Example",1,"ReturnString: "+test);

4.3. Âñòàâêà îäíîé ñòðîêè â äðóãóþ (strInsert) <1200>

Îïèñàíèå: Èñïîëüçóåòñÿ äëÿ âñòàâêè îäíîé ñòðîêè â äðóãóþ.
Ïàðàìåòðû:

IDÏàðàìåòðÒèïÐåæèìÏî óìîë÷àíèþ
strÑòðîêàÑòðîêàÂûõîä
posÏîçèöèÿÖåëûéÂõîä0
insÂñòàâëÿåìàÿ ñòðîêàÑòðîêàÂõîä

4.4. Çàìåíà ÷àñòè ñòðîêè äðóãîé (strReplace) <531>

Îïèñàíèå: Èñïîëüçóåòñÿ äëÿ çàìåíû ÷àñòè ñðîêè äðóãîé ñòðîêîé.
Ïàðàìåòðû:

IDÏàðàìåòðÒèïÐåæèìÏî óìîë÷àíèþ
strÑòðîêàÑòðîêàÂûõîä
posÏîçèöèÿÖåëûéÂõîä0
nÊîëè÷åñòâîÖåëûéÂõîä-1
replÇàìåíÿþùàÿ ñòðîêàÑòðîêàÂõîä

4.5. Ðàçáîð ñòðîêè ïî ðàçäåëèòåëþ (strParse) <537>

Îïèñàíèå: Èñïîëüçóåòñÿ â ðàçáîðå ñòðîêè ïî ðàçäåëèòåëþ.
Ïàðàìåòðû:

IDÏàðàìåòðÒèïÐåæèìÏî óìîë÷àíèþ
rezÐåçóëüòàòÑòðîêàÂîçâðàò
strÑòðîêàÑòðîêàÂõîä
levÓðîâåíüÖåëûéÂõîä
sepÐàçäåëèòåëüÑòðîêàÂõîä"."
offÑìåùåíèåÖåëûéÂûõîä

Ïðèìåð:

using Special.FLibSYS;
ExapleString="Example:123";
test=strParse(ExapleString,1,":");
messPut("Example",0,"strParse(): "+test);

4.6. Ðàçáîð ïóòè (strParsePath) <300>

Îïèñàíèå: Èñïîëüçóåòñÿ â ðàçáîðå ïóòè íà ýëåìåíòû.
Ïàðàìåòðû:

IDÏàðàìåòðÒèïÐåæèìÏî óìîë÷àíèþ
rezÐåçóëüòàòÑòðîêàÂîçâðàò
pathÏóòüÑòðîêàÂõîä
levÓðîâåíüÖåëûéÂõîä
offÑìåùåíèåÖåëûéÂûõîä

Ïðèìåð:

using Special.FLibSYS;
test=strParsePath(path,0,"/");
messPut("Example",1,"strParsePath(): "+test);

4.7. Ïóòü â ñòðîêó ñ ðàçäåëèòåëåì (strPath2Sep)

Îïèñàíèå: Èñïîëüçóåòñÿ äëÿ ïðåîáðàçîâàíèÿ ïóòè â ñòðîêó ñ ðàçäåëèòåëåì.
Ïàðàìåòðû:

IDÏàðàìåòðÒèïÐåæèìÏî óìîë÷àíèþ
rezÐåçóëüòàòÑòðîêàÂîçâðàò
srcÈñòî÷íèêÑòðîêàÂõîä
sepÐàçäåëèòåëüÑòðîêàÂõîä"."

Ïðèìåð:

//Ïðåîáðàçóåì çíà÷åíèå "/ses_AGLKS/pg_so" àòðèáóòà "path" â çíà÷åíèå "ses_AGLKS.pg_so"
using Special.FLibSYS;
test = strPath2Sep(path);
messPut("Example",0,"path: "+path);
messPut("Example",0,"strPath2Sep(): "+test);


4.8. Êîäèðîâàíèå ñòðîêè â HTML (strEnc2HTML)

Îïèñàíèå: Èñïîëüçóåòñÿ äëÿ êîäèðîâàíèÿ ñòðîêè äëÿ èñïîëüçîâàíèÿ â èñõîäíèêå HTML.
Ïàðàìåòðû:

IDÏàðàìåòðÒèïÐåæèìÏî óìîë÷àíèþ
rezÐåçóëüòàòÑòðîêàÂîçâðàò
srcÈñòî÷íèêÑòðîêàÂõîä

4.9. Êîäèðîâàíèå òåêñòà â áèíàðíûé âèä (strEnc2Bin)

Îïèñàíèå: Èñïîëüçóåòñÿ äëÿ êîäèðîâàíèÿ òåêñòà â áèíàðíûé âèä, èç ôîðìàòà <00 A0 FA DE>.
Ïàðàìåòðû:

IDÏàðàìåòðÒèïÐåæèìÏî óìîë÷àíèþ
rezÐåçóëüòàòÑòðîêàÂîçâðàò
srcÈñòî÷íèêÑòðîêàÂõîä

4.10. Äåêîäèðîâàíèå òåêñòà èç áèíàðíîãî âèäà (strDec4Bin)

Îïèñàíèå: Èñïîëüçóåòñÿ äëÿ äåêîäèðîâàíèÿ òåêñòà èç áèíàðíîãî âèäà â ôîðìàò <00 A0 FA DE>.
Ïàðàìåòðû:

IDÏàðàìåòðÒèïÐåæèìÏî óìîë÷àíèþ
rezÐåçóëüòàòÑòðîêàÂîçâðàò
srcÈñòî÷íèêÑòðîêàÂõîä

4.11. Ïðåîáðàçîâàíèå âåùåñòâåííîãî â ñòðîêó (real2str)

Îïèñàíèå: Èñïîëüçóåòñÿ äëÿ ïðåîáðàçîâàíèÿ âåùåñòâåííîãî â ñòðîêó.
Ïàðàìåòðû:

IDÈìÿÒèïÐåæèìÏî óìîë÷àíèþ
rezÐåçóëüòàòÑòðîêàÂîçâðàò
valÇíà÷åíèåÂåùåñòâåííîåÂõîä
prcÒî÷íîñòüÖåëîåÂõîä4
tpÒèïÑòðîêàÂõîä"f"

4.12. Ïðåîáðàçîâàíèå öåëîãî â ñòðîêó (int2str)

Îïèñàíèå: Èñïîëüçóåòñÿ äëÿ ïðåîáðàçîâàíèÿ öåëîãî â ñòðîêó.
Ïàðàìåòðû:

IDÈìÿÒèïÐåæèìÏî óìîë÷àíèþ
rezÐåçóëüòàòÑòðîêàÂîçâðàò
valÇíà÷åíèåÖåëîåÂõîä
baseÁàçà, ïîääåðæèâàþòñÿ: 8, 10, 16ÖåëîåÂõîä10

4.13. Ïðåîáðàçîâàíèå ñòðîêè â âåùåñòâåííîå (str2real)

Îïèñàíèå: Èñïîëüçóåòñÿ äëÿ ïðåîáðàçîâàíèÿ ñòðîêè â âåùåñòâåííîå.
Ïàðàìåòðû:

IDÈìÿÒèïÐåæèìÏî óìîë÷àíèþ
rezÐåçóëüòàòÂåùåñòâåííîåÂîçâðàò
valÇíà÷åíèåÑòðîêàÂõîä

4.14. Ïðåîáðàçîâàíèå ñòðîêè â öåëîå (str2int)

Îïèñàíèå: Èñïîëüçóåòñÿ äëÿ ïðåîáðàçîâàíèÿ ñòðîêè â öåëîå.
Ïàðàìåòðû:

IDÈìÿÒèïÐåæèìÏî óìîë÷àíèþ
rezÐåçóëüòàòÖåëîåÂîçâðàò
valÇíà÷åíèåÑòðîêàÂõîä
baseÎñíîâàÖåëûéÂõîä0

4.15. Öèêëè÷åñêèé Èçáûòî÷íûé Êîä (CRC)

Îïèñàíèå: Ðåàëèçàöèÿ Öèêëè÷åñêîãî Èçáûòî÷íîãî Êîäà äëÿ äëèí 8-64 áèò.
Ïàðàìåòðû:

ID Ïàðàìåòð Òèï Ðåæèì Ïî óìîë÷àíèþ
rez Ðåçóëüòàò Öåëîå Âîçâðàò
data Äàííûå Ñòðîêà Âõîä
poly Ïîëèíîì (ðåâåðñèâíûé) Öåëûé Âõîä 40961 (0xA001)
width Øèðèíà Öåëûé Âõîä 16
init Èíèöèàëèçàöèÿ Öåëûé Âõîä -1 (0xFFFFFFFFFFFFFFFF)

5. Ôóíêöèè ðàáîòû ñ âåùåñòâåííûì

5.1. Ðàçäåëåíèå float íà ñëîâà (floatSplitWord) <56>

Îïèñàíèå: Ðàçäåëåíèå float (4 áàéòîâ) íà ñëîâà (2 áàéòà).
Ïàðàìåòðû:

ID Ïàðàìåòð Òèï Ðåæèì Ïî óìîë÷àíèþ
val Çíà÷åíèå Âåùåñòâåííîå Âõîä
w1 Ñëîâî 1 Öåëûé Âûõîä
w2 Ñëîâî 2 Öåëûé Âûõîä

5.2. Îáúåäèíåíèå float èç ñëîâ (floatMergeWord) <70>

Îïèñàíèå: Îáúåäèíåíèå float (4 áàéòîâ) èç ñëîâ (2 áàéòà).
Ïàðàìåòðû:

ID Ïàðàìåòð Òèï Ðåæèì Ïî óìîë÷àíèþ
rez Ðåçóëüòàò Âåùåñòâåííîå Âîçâðàò
w1 Ñëîâî 1 Öåëûé Âõîä
w2 Ñëîâî 2 Öåëûé Âõîä

6. API ïîëüçîâàòåëüñêîãî ïðîãðàììèðîâàíèÿ

Íåêîòîðûå îáúåêòû ìîäóëÿ ïðåäîñòàâëÿþò ôóíêöèè ïîëüçîâàòåëüñêîãî ïðîãðàììèðîâàíèÿ.


Îáúåêò "Áèáëèîòåêà ôóíêöèé" (SYS.Special.FLibSYS)


Îáúåêò "Ïîëüçîâàòåëüñêàÿ ôóíêöèÿ" (SYS.Special.FLibSYS["funcID"])

Ññûëêè

Referring pages: Doc
Doc/DAQ
Doc/FLibSYS


 
There are no files on this page.[Display files/form]
There is no comment on this page. [Display comments/form]