Nanotic-LOGO

Nanotic NanoLib C++ Programming

Nanotic-NanoLib-C++-Programming-PRODUCT

Tlhahisoleseding ya Sehlahiswa

Litlhaloso

  • Lebitso la Sehlahiswa: NanoLib
  • Lenaneo Puo: C++
  • Tlhahiso ea sehlahisoa: 1.3.0
  • User Manual Version: 1.4.2

Laeborari ea NanoLib e etselitsoe software ea taolo ea mananeo bakeng sa balaoli ba Nanotec. E fana ka sebopeho sa mosebelisi, lits'ebetso tsa mantlha, le lilaebrari tsa puisano ho thusa nts'etsopele ea lits'ebetso tsa taolo.

Litaelo tsa Tšebeliso ea Sehlahisoa

  • Pele o qala:
    • Netefatsa hore sistimi ea hau e fihlela litlhoko tsa Hardware tse boletsoeng bukeng ea tataiso. Bamameli ba reriloeng bakeng sa sehlahisoa sena ba kenyelletsa baetsi ba batlang ho theha software ea taolo bakeng sa balaoli ba Nanotec.
  • Rea qala:
    • Ho qala ho sebelisa NanoLib, latela mehato ena:
    • Qala ka ho kenya NanoLib morerong oa hau.
    • Hlophisa litlhophiso tsa projeke ea hau ha ho hlokahala.
    • Theha projeke ea hau ho kenyelletsa mesebetsi ea NanoLib.
  • Ho theha Merero:
    • O ka etsa merero bakeng sa tikoloho ea Windows le Linux. Latela litaelo tse tobileng tse fanoeng bukeng ea litaelo bakeng sa sethala ka seng.
  • Litlelase / Referense ea Mesebetsi:
    • Sheba buka ea mosebelisi bakeng sa tataiso e qaqileng mabapi le litlelase le mesebetsi e fumanehang ho NanoLib bakeng sa software ea taolo ea mananeo.

FAQs

  • P: Morero oa NanoLib ke ofe?
    • A: NanoLib ke laeborari ea software ea taolo ea mananeo bakeng sa balaoli ba Nanotec, e fanang ka lits'ebetso tsa bohlokoa le bokhoni ba puisano.
  • P: Nka qala joang ka NanoLib?
    • A: Qala ka ho kenya NanoLib morerong oa hau, ho hlophisa litlhophiso tsa projeke, le ho aha projeke ea hau ho sebelisa likarolo tsa NanoLib.

"`

Buka ea mosebelisi NanoLib
C++

E sebetsa ka mofuta oa sehlahisoa 1.3.0

Mofuta oa buka ea mosebelisi: 1.4.2

Sepheo sa litokomane le litumellano

Tokomane ena e hlalosa tlhophiso le ts'ebeliso ea laeborari ea NanoLib mme e na le tšupiso ea lihlopha tsohle le mesebetsi bakeng sa ho hlophisa software ea hau ea taolo bakeng sa balaoli ba Nanotec. Re sebelisa li-typefaces tse latelang:
Sengoloa se sehetsoeng se tšoaea tšupiso kapa sehokelo.
ExampNtlha ea 1: Bakeng sa litaelo tse tobileng ho NanoLibAccessor, bona Setup. Example 2: Kenya mokhanni oa Ixxat ebe o hokela adaptara ea CAN-to-USB. Sengoloa se ngotsoeng ka mongolo o tšekaletseng se bolela: Ena ke ntho e reheletsoeng, tsela ea menyu / ntho, tabo / file lebitso kapa (ha ho hlokahala) polelo ya puo esele.
ExampLe 1: Khetha File > Ntjha > Tokomane e se nang letho. Bula Tool tab ebe o khetha Comment. Example 2: Tokomane ena e arola basebelisi (= Nutzer; usuario; utente; utilisateur; utente joalo-joalo) ho:
- Mosebelisi oa motho oa boraro (= Drittnutzer; tercero usuario; terceiro utente; tiers utilisateur; terzo utente joalo-joalo). - Mosebelisi oa ho qetela (= Endnutzer; usuario final; utente final; utilisateur final; utente finale joalo-joalo).
Courier e tšoaea liboloko tsa khoutu kapa litaelo tsa ho etsa mananeo. Example 1: Via Bash, letsetsa sudo make install ho kopitsa lintho tse arolelanoang; ebe u letsetsa ldconfig. ExampLe 2: Sebelisa mosebetsi o latelang oa NanoLibAccessor ho fetola boemo ba ho rema lifate ho NanoLib:
// ***** C++ mofuta *****
void setLoggingLevel(LogLevel level);
Mongolo o motenya o hatisa mantsoe ka bomong a bohlokoa ba bohlokoa. Ntle le moo, matshwao a ho makatsa a nang le masakaneng a hatisa bohlokwa ba (!).
ExampLe 1: Itšireletse, u sireletse ba bang le lisebelisoa tsa hau. Latela lintlha tsa rona tsa polokeho tse akaretsang tse sebetsang lihlahisoa tsohle tsa Nanotec.
ExampLe 2: Bakeng sa ts'ireletso ea hau, hape latela lintlha tse ikhethileng tsa polokeho tse sebetsang sehlahisoa sena se ikhethileng. Leetsi la ho penya-kopanya le bolela ho penya ka konopo ea bobeli ho bula menyu ea litaba joalo-joalo.
Example 1: Tlanya ka kopanelo ho file, khetha Reha bocha, 'me u rehe bocha file. Example 2: Ho hlahloba thepa, tobetsa konopo ea file 'me u khethe Matlotlo.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

4

Pele o qala

Pele o qala ho sebelisa NanoLib, lokisa PC ea hau 'me u itsebise ka ts'ebeliso e reriloeng le meeli ea laeborari.
2.1 Litlhoko tsa tsamaiso le hardware

Nanotic-NanoLib-C++-Programming-FIG- (1)
TSEBISO Ho se sebetse hantle ha 32-bit kapa sistimi e khaotsoeng! Sebelisa, 'me u boloke kamehla, tsamaiso ea 64-bit. Ela hloko ho khaotsoa ha OEM le ~ litaelo.

NanoLib 1.3.0 e tšehetsa lihlahisoa tsohle tsa Nanotec ka CANopen, Modbus RTU (hape le USB ho virtual com port), Modbus TCP, EtherCat, le Profinet. Bakeng sa li-NanoLibs tsa khale: Bona changelog ho mongolo. Ka kotsi ea hau feela: ts'ebeliso ea sistimi ea lefa. Tlhokomeliso: Latela litaelo tse nepahetseng tsa OEM ho beha latency tlase kamoo ho ka khonehang haeba u tobana le mathata ha u sebelisa adaptara ea USB e thehiloeng ho FTDI.

Litlhoko (64-bit sistimi e tlamang)
Windows 10 kapa 11 w/ Visual Studio 2019 version 16.8 kapa hamorao le Windows SDK 10.0.20348.0 (version 2104) kapa hamorao
C++ redistributables 2017 kapa ho feta CANopen: Ixxat VCI kapa PCAN mokhanni oa motheo (khetho) EtherCat module / Profinet DCP: Npcap kapa WinPcap RESTful module: Npcap, WinPcap, kapa tumello ea admin ho
buisana le li-bootloader tsa Ethernet
Linux w/ Ubuntu 20.04 LTS to 24 (tsohle x64 le arm64)
Lihlooho tsa kernel le pakete ea libpopt-dev Profinet DCP: CAP_NET_ADMIN le CAP_NET_RAW abili-
maqhama CANopen: Ixxat ECI driver kapa Peak PCAN-USB adaptara EtherCat: CAP_NET_ADMIN, CAP_NET_RAW le
CAP_SYS_NICE bokhoni bo RESTful: CAP_NET_ADMIN bokhoni ba ho buisana le Eth-
ernet bootloaders (hape e khothalelitsoe: CAP_NET_RAW)

Puo, li-adapter tsa fieldbus, lithapo
C++ GCC 7 kapa ho feta (Linux)
EtherCAT: Ethernet cable VCP / USB hub: hona joale junifomo USB USB boima polokelo: USB cable REST: Ethernet cable CANopen: Ixxat USB-to-CAN V2; Na-
notec ZK-USB-CAN-1, Peak PCANUSB adaptara Ha ho Ixxat tšehetso bakeng sa Ubuntu ka arm64
Modbus RTU: Nanotec ZK-USB-RS485-1 kapa adaptara e lekanang; Cable ea USB ho virtual com port (VCP)
Modbus TCP: thapo ea Ethernet ho latela database ea sehlahisoa

2.2 Tšebeliso e reriloeng le bamameli
NanoLib ke laeborari ea lenaneo le karolo ea software bakeng sa ts'ebetso ea, le puisano le, balaoli ba Nanotec mefuteng e mengata ea lits'ebetso tsa indasteri le bakeng sa baetsi ba mananeo ba nang le boiphihlelo feela.
Ka lebaka la lisebelisoa tse sa sebetseng tsa nako ea 'nete (PC) le sistimi ea ts'ebetso, NanoLib ha e sebelisoe lits'ebetsong tse hlokang motsamao oa li-multi-axis tse lumellanang kapa hangata li natefeloa ke nako.
Ha ho joalo, o ka kopanya NanoLib joalo ka karolo ea polokeho ho sehlahisoa kapa sistimi. Ha o fihla ho basebelisi ba ho qetela, o tlameha ho kenya litemoso le litaelo tse tsamaellanang bakeng sa ts'ebeliso e bolokehileng le ts'ebetso e bolokehileng sehlahisoa ka seng se nang le karolo e entsoeng ka Nanotec. U tlameha ho fetisa litemoso tsohle tsa temoso tse fanoeng ke Nanotec ho mosebelisi oa ho qetela.
2.3 Bophara ba thomello le tiisetso
NanoLib e tla e le foldara ea *.zip ho tsoa ho download ea rona websebaka sa EMEA / APAC kapa AMERICA. Boloka ka nepo 'me u notlolle download ea hau pele u seta. Sephutheloana sa NanoLib se na le:

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

5

Pele o qala

Lihlooho tsa li-interface joalo ka khoutu ea mohloli (API)

Mesebetsi ea mantlha e le lilaebrari ka sebopeho sa binary: nano-

Lilaebrari tse tsamaisang puisano: nanolibm_ lib.dll

[yourfieldbus].dll jj.

Example morero: Example.sln (Visual Studio

project) le mohlalaample.cpp (ka sehloohong file)

Bakeng sa boholo ba tiisetso, ka kopo hlokomela a) lipehelo le lipehelo tsa EMEA / APAC kapa AMERICA le b) lipehelo tsohle tsa laesense. Tlhokomeliso: Nanotec ha e ikarabelle bakeng sa boleng bo fosahetseng kapa bo sa hlokahaleng, ho sebetsana, ho kenya, ho sebetsa, ho sebelisa le ho boloka thepa ea motho oa boraro! Bakeng sa polokeho e loketseng, kamehla latela litaelo tse nepahetseng tsa OEM.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

6

Mohaho oa NanoLib

Sebopeho sa software sa NanoLib se u lumella ho hlophisa lisebelisoa tsa motlakase / li-fieldbus tse ka sebelisoang ka bolokolohi ho potoloha motheo o hahiloeng pele. NanoLib e na le li-module tse latelang:

Sehokelo sa mosebelisi (API)

NanoLib core

Interface le litlelase tsa bathusi tseo li-Libraries tse

Lilaebrari tsa puisano lilaebrari tse khethehileng tsa Fieldbus tseo

fihlella ho uena ho sesebelisoa sa molaoli oa hau ho sebelisa API do interface lipakeng tsa NanoLib

OD (dikishinari ea ntho)

sebelisana le lilaebrari tsa libese.

lisebelisoa tsa mantlha le libese.

motheong oa NanoLib core func-

lichaba.

3.1 Sehokelo sa mosebelisi

Sehokelo sa mosebelisi se na le sebopeho sa lihlooho files o ka sebelisa ho fihlella liparamente tsa molaoli. Litlelase tsa li-interface tsa mosebelisi joalo ka ha li hlalositsoe ho Class / function reference li u lumella ho:
Hokela ho hardware ka bobeli (adapter ea fieldbus) le sesebelisoa sa molaoli. Fumana OD ea sesebelisoa, ho bala / ho ngola liparamente tsa molaoli.

3.2 NanoLib mantlha

NanoLib ea mantlha e tla le laeborari ea kantle ho naha nanolib.lib. E sebelisa ts'ebetso ea mosebelisi mme e ikarabella ho:
Ho kenya le ho laola lilaebrari tsa puisano. Ho fana ka ts'ebetso ea sebopeho sa mosebelisi ho NanoLibAccessor. Sebaka sena sa puisano ke-
e lefisa lits'ebetso tseo u ka li etsang motheong oa NanoLib le lilaebraring tsa puisano.

3.3 Lilaebrari tsa puisano

Ntle le nanotec.services.nanolib.dll (e thusa bakeng sa boikhethelo ba Plug & Drive Studio), NanoLib e fana ka lilaeborari tse latelang tsa puisano:

nanolibm_canopen.dll nanolibm_modbus.dll

nanolibm_ethercat.dll nanolibm_restful-api.dll

nanolibm_usbmmsc.dll nanolibm_profinet.dll

Lilaebrari tsohle li beha karolo ea "hardware abstraction layer" lipakeng tsa mantlha le molaoli. Konokono e li jarisa qalong ho tsoa foldareng e khethiloeng ea projeke mme e li sebelisa ho theha puisano le molaoli ka protocol e lumellanang.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

7

Rea qala

Bala mokhoa oa ho theha NanoLib bakeng sa sistimi ea hau ea ts'ebetso ka nepo le mokhoa oa ho hokela lisebelisoa ha ho hlokahala.
4.1 Lokisetsa sistimi ea hau
Pele o kenya li-driver tsa adapter, lokisa komporo ea hau pele ho sistimi e sebetsang. Ho lokisa PC hammoho le Windows OS ea hau, kenya MS Visual Studio e nang le li-extensions tsa C++. Ho kenya make le gcc ka Linux Bash, letsetsa sudo apt install build-essentials. Ebe u nolofalletsa CAP_NET_ADMIN, CAP_NET_RAW, le CAP_SYS_NICE bokhoni ba ts'ebeliso e sebelisang NanoLib: 1. Letsetsa sudo setcap 'cap_net_admin,cap_net_raw,cap_sys_nice+eip'
lebitso>. 2. Ke ka nako eo feela, kenya bakhanni ba adaptara ea hau.
4.2 Kenya mokhanni oa adaptara ea Ixxat bakeng sa Windows
Ke feela ka mor'a ho kenya mokhanni ka nako e loketseng, o ka sebelisa adaptara ea Ixxat ea USB-to-CAN V2. Bala bukana ea sehlahisoa sa li-drive tsa USB, ho ithuta hore na / mokhoa oa ho kenya tšebetsong "virtual comport" (VCP). 1. Khoasolla le ho kenya mokhanni oa Ixxat oa VCI 4 bakeng sa Windows ho tloha www.ixxat.com. 2. Hokela adaptara e kopaneng ea USB-to-CAN V2 ea Ixxat ho PC ka USB. 3. Ka Mookameli oa Sesebelisoa: Hlahloba hore na mokhanni le adaptara ka bobeli li kentsoe / lia tsebahala.
4.3 Kenya peak adaptara driver bakeng sa Windows
Ke feela ka mor'a ho kenya mokhanni ka nako e loketseng, o ka sebelisa adaptara ea Peak's PCAN-USB. Bala bukana ea sehlahisoa sa li-drive tsa USB, ho ithuta hore na / mokhoa oa ho kenya tšebetsong "virtual comport" (VCP). 1. Khoasolla le ho kenya seta sa mokhanni oa sesebelisoa sa Windows (= sephutheloana sa ho instola ka bakhanni ba lisebelisoa, lisebelisoa, le
APIs) ho tloha http://www.peak-system.com. 2. Hokela adaptara ea Peak ea PCAN-USB ho PC ka USB. 3. Ka Mookameli oa Sesebelisoa: Hlahloba hore na mokhanni le adaptara ka bobeli li kentsoe / lia tsebahala.
4.4 Kenya mokhanni oa adaptara ea Ixxat bakeng sa Linux
Ke feela ka mor'a ho kenya mokhanni ka nako e loketseng, o ka sebelisa adaptara ea Ixxat ea USB-to-CAN V2. Tlhokomeliso: Li-adapter tse ling tse tšehelitsoeng li hloka tumello ea hau ka sudo chmod +777/dev/ttyACM* (* nomoro ea sesebelisoa). Bala bukana ea sehlahisoa sa li-drive tsa USB, ho ithuta hore na / mokhoa oa ho kenya tšebetsong "virtual comport" (VCP). 1. Kenya software e hlokahalang bakeng sa mokhanni oa ECI le sesebelisoa sa demo:
sudo apt-fumana ntjhafatso apt-fumana kenya libusb-1.0-0-dev libusb-0.1-4 libc6 libstdc++6 libgcc1 buildessential
2. Khoasolla mokhanni oa ECI-for-Linux ho tsoa ho www.ixxat.com. E notlolle ka:
unzip eci_driver_linux_amd64.zip
3. Kenya mokhanni ka:
cd /EciLinux_amd/src/KernelModule sudo etsa install-usb
4. Lekola ts'ebetso e atlehileng ea mokhanni ka ho hlophisa le ho qala ts'ebeliso ea demo:
cd /EciLinux_amd/src/EciDemos/ sudo etsa cd /EciLinux_amd/bin/release/ ./LinuxEciDemo

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

8

4 Ho qala
4.5 Kenya mokhanni oa adaptara ea Peak bakeng sa Linux
Ke feela ka mor'a ho kenya mokhanni ka nako e loketseng, o ka sebelisa adaptara ea Peak's PCAN-USB. Tlhokomeliso: Li-adapter tse ling tse tšehelitsoeng li hloka tumello ea hau ka sudo chmod +777/dev/ttyACM* (* nomoro ea sesebelisoa). Bala bukana ea sehlahisoa sa li-drive tsa USB, ho ithuta hore na / mokhoa oa ho kenya tšebetsong "virtual comport" (VCP). 1. Sheba hore na Linux ea hau e na le lihlooho tsa kernel: ls /usr/src/linux-headers-`uname -r`. Haeba ho se joalo, kenya
bona: sudo apt-get install linux-headers-`uname -r` 2. Hona joale feela, kenya pakete ea libpopt-dev: sudo apt-get install libpopt-dev 3. Khoasolla sephutheloana se hlokahalang sa mokhanni (peak-linux-driver-xxx.tar.gz) ho tloha www.peak-system.com. 4. Ho e phutholla, sebelisa: tar xzf peak-linux-driver-xxx.tar.gz 5. Foldareng e sa phutholohang: Kopanya le ho kenya li-driver, laeborari ea motheo ea PCAN, joalo-joalo: etsa tsohle.
sudo make install 6. Ho hlahloba tšebetso, hokela adaptara ea PCAN-USB ho eona.
a) Sheba mojule oa kernel:
lsmod | grep pcan b) ... le laeborari e arolelanoang:
ls -l /usr/lib/libpcan*
Ela hloko: Haeba mathata a USB3 a hlaha, sebelisa boema-kepe ba USB2.
4.6 Hokela hardware ea hau
Ho khona ho tsamaisa morero oa NanoLib, hokela selaoli sa Nanotec se lumellanang le PC u sebelisa adaptara ea hau. 1. Ka thapo e loketseng, hokela adaptara ea hau ho molaoli. 2. Hokela adaptara ho PC ho ea ka letlapa la data ea adaptara. 3. Matla ho molaoli o sebelisa motlakase o loketseng. 4. Haeba ho hlokahala, fetola litlhophiso tsa puisano tsa molaoli oa Nanotec joalokaha ho laetsoe bukeng ea eona ea lihlahisoa.
4.7 Laela NanoLib
Ha u qala ka lintho tsa motheo tse potlakileng le tse bonolo, u ka (empa ha ua tlameha) sebelisa ex ea ronaample morero. 1. Ho ipapisitse le sebaka sa hau: Khoasolla NanoLib ho tsoa ho rona websebaka sa EMEA / APAC kapa AMERICA. 2. Unzip ea sephutheloana files / lifoldara ebe u khetha khetho e le 'ngoe: Bakeng sa metheo e potlakileng le e bonolo: Bona Ho qala example morero. Bakeng sa tlhophiso e tsoetseng pele ho Windows: Bona Ho iketsetsa projeke ea hau ea Windows. Bakeng sa tlhophiso e tsoetseng pele ho Linux: Bona Ho iketsetsa projeke ea hau ea Linux.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

9

Ho qala ka example morero

Ka NanoLib e laetsoe ka nepo, ea peleampmorero oa hau o u bontša ka tšebeliso ea NanoLib le molaoli oa Nanotec. Tlhokomeliso: Bakeng sa mohato o mong le o mong, maikutlo ho ex e fanoengample code hlalosa mesebetsi e sebelisoang. Exampprojeke e na le: `*_functions_example.*' files, e nang le ts'ebetso ea sebopeho sa NanoLib e sebetsa `*_callback_example.*' files, e nang le ts'ebetsong bakeng sa li-callback tse fapaneng (scan, data le
ho rema lifate) 'menu_*.*' file, e nang le logic ea menu le khoutu ea Example. * file, e leng lenaneo le ka sehloohong, ho theha menu le ho qala likarolo tsohle tse sebelisoang Sampler_example. * file, e nang le example phethahatso bakeng sa samptšebeliso. U ka fumana ho feta examples, ka litaelo tse ling tsa motsamao bakeng sa mekhoa e fapaneng ea ts'ebetso, ho Knowledge Base ho nanotec.com. Tsohle li ka sebelisoa ho Windows kapa Linux.
Ho Windows e nang le Visual Studio 1. Bula Example.sln file. 2. Bula example.cpp. 3. Kopanya 'me u tsamaise exampkhoutu.
Ho Linux ka Bash 1. Unzip mohloli file, tsamaisetsa foldareng e nang le litaba tse sa buloang. Ka sehloohong file bakeng sa example ke
example.cpp. 2. Ka bash, letsetsa:
a. "sudo make install" ho kopitsa lintho tse arolelanoang le ho letsetsa ldconfig. b. "etsa tsohle" ho aha tlhahlobo e ka phethisoa. 3. Foldara ea bin e na le ex e ka phethisoangample file. Ka bash: E-ea ho foldareng ea tlhahiso ebe u thaepa ./example. Haeba ho se phoso e hlahang, lintho tseo u li arolelaneng li se li kentsoe ka nepo, 'me laeborari ea hau e se e loketse ho sebelisoa. Haeba phoso e baleha ./example: phoso ha o ntse o kenya lilaebrari tse arolelanoang: libnanolib.so: ha e khone ho bula ntho e arolelanoang file: Ha ho joalo file kapa sengoloa, ho kenya lintho tse arolelanoang ho hlolehile. Tabeng ena, latela mehato e latelang. 4. Etsa foldara e ncha ka hare ho /usr/local/lib (litokelo tsa admin tse hlokahalang). Ka bash, ka tsela ena thaepa:
sudo mkdir /usr/local/lib/nanotec
5. Kopitsa lintho tsohle tse arolelanoang ho tswa ho zip filefoldareng ea lib:
kenya ./lib/*.so /usr/local/lib/nanotec/
6. Sheba litaba tsa foldara e shebiloeng ka:
ls -al /usr/local/lib/nanotec/
E lokela ho thathamisa ntho e arolelanoang files ho tsoa foldareng ea lib. 7. Matha ldconfig foldareng ena:
sudo ldconfig /usr/local/lib/nanotec/
Example e kengoa ts'ebetsong joalo ka ts'ebeliso ea CLI mme e fana ka sebopeho sa menu. Likenyo tsa menyu li ipapisitse le maemo, 'me li tla lumelloa kapa li koaloe, ho latela maemo a teng. Ba u fa monyetla oa ho khetha le ho phethahatsa mesebetsi e sa tšoaneng ea laebrari ho latela mokhoa o tloaelehileng oa ho sebetsana le molaoli: 1. Sheba PC bakeng sa hardware e hokahaneng (li-adapter) 'me u li thathamise. 2. Theha khokahano ho adaptara. 3. Skena bese bakeng sa lisebelisoa tsa taolo tse hokahaneng. 4. Hokela sesebelisoa.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

10

5 Ho qala example morero
5. Lekola tšebetso e le 'ngoe kapa tse ngata tsa laeborari: Bala/ngola ho tsoa/ho ea bukeng ea bukantswe ya molaodi, ntjhafatsa firmware, kenya le ho tsamaisa lenaneo la NanoJ, etsa hore motor e sebetse mme o e lokise, lokisa, mme o sebedise ho rekota/s.ampler.
6. Koala khokahanyo, pele ho sesebelisoa, ebe ho adaptara.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

11

Ho iketsetsa morero oa Windows

Theha, bokella le ho tsamaisa morero oa hau oa Windows ho sebelisa NanoLib.
6.1 Kenya NanoLib
Kenya hlooho ea NanoLib files le lilaebrari ka MS Visual Studio.
1. Bula Visual Studio. 2. Ka ho Etsa morero o mocha > Console App C++ > E latelang: Khetha mofuta oa morero. 3. Bolela morero oa hau (mona: NanolibTest) ho etsa fensetere ea morero ho Tharollo ea Tharollo. 4. Kgetha Qetella. 5. Bula lifensetere file explorer le ho ea ho foldara e ncha ea projeke. 6. Etsa lifoldara tse peli tse ncha, inc le lib. 7. Bula foldara ea sephutheloana sa NanoLib. 8. Ho tloha moo: Kopitsa sehlooho files ho tloha ho kenyeletsa foldareng ho kena foldareng ea projeke ea hau inc le tsohle .lib le .dll
files ho foldara ea hau e ncha ea projeke lib. 9. Sheba foldara ea projeke ea hau bakeng sa sebopeho se loketseng, mohlalaampLe:

Nanotic-NanoLib-C++-Programming-FIG- (2)ect foldara bakeng sa sebopeho se loketseng:
. NanolibTest inc accessor_factory.hpp bus_hardware_id.hpp … od_index.hpp result_od_entry.hpp lib nanolibm_canopen.dll nanolib.dll … nanolib.lib NanolibTest.cpp NanolibTest.vcbxTest. NanolibTest.vcxproj.user NanolibTest.sln
6.2 Hlophisa morero oa hau
Sebelisa Solution Explorer ho MS Visual Studio ho theha merero ea NanoLib. Tlhokomeliso: Bakeng sa ts'ebetso e nepahetseng ea NanoLib, khetha tokollo (eseng debug!) ho litlhophiso tsa projeke ea Visual C ++; ebe u haha ​​​​le ho hokahanya morero le linako tsa ho sebetsa tsa VC tsa C ++ redistributables [2022].
1. Ho Tharollo ea Tharollo: E-ea ho foldara ea morero oa hau (mona: NanolibTest). 2. Tobetsa foldareng ka kopanelo ho bula menyu ea litaba. 3. Khetha Properties. 4. Kenya tšebetsong Litlhophiso tsohle le li-platform tsohle. 5. Khetha C/C++ 'me u ee ho Eketsehileng Kenyelletsa Libukana. 6. Kenya: $(ProjectDir)Nanolib/includes;%(AdditionalIncludeDirectories) 7. Khetha Sehokelo ebe u ea ho Libukana tsa Libuka tse Eketsehileng. 8. Kenya: $(ProjectDir)Nanolib;%(AdditionalLibraryDirectories) 9. Eketsa Sehokelo ebe u khetha Input. 10.Eya ho Litšetleho Tse Eketsehileng ebe u kenya: nanolib.lib;%(AdditionalDependencies) 11.Tiisa ka OK.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

12

6 Ho iketsetsa morero oa Windows
12.Eya ho Configuration > C++ > Language > Language Standard > ISO C++17 Standard mme o behe maemo a puo ho C++17 (/std:c++17).
6.3 Theha morero oa hau
Theha morero oa hau oa NanoLib ho MS Visual Studio. 1. Bula ka sehloohong * .cpp file (mona: nanolib_example.cpp) le ho hlophisa khoutu, haeba ho hlokahala. 2. Kgetha Haha > Taolo ya Tlhophiso. 3. Fetola "Active solution platforms" ho x64. 4. Netefatsa ka ho Koala. 5. Kgetha Haha > Haha tharollo. 6. Ha ho phoso? Sheba hore na tlhahiso ea hau e tlalehile ka nepo:
1>—— E hloekile e qalile: Project: NanolibTest, Configuration: Debug x64 —–========== E hloekile: 1 e atlehile, 0 e hlotsoe, 0 e tlotse ==========

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

13

7 Ho iketsetsa morero oa Linux
7 Ho iketsetsa morero oa Linux
Theha, bokella le ho tsamaisa morero oa hau oa Linux ho sebelisa NanoLib. 1. Ka har'a sesebelisoa sa ho kenya NanoLib se sa buloang: Bula /nanotec_nanolib. 2. Fumana lintho tsohle tse arolelanoang ho tar.gz file. 3. Khetha khetho e le 'ngoe: Kenya lib ka 'ngoe ka Makefile kapa ka letsoho.
7.1 Kenya lintho tse arolelanoang le Makefile
Sebelisa Makefile ka Linux Bash ho instola ka boits'oaro bohle ba kamehla *.so files. 1. Via Bash: E-ea foldareng e nang le makefile. 2. Kopitsa lintho tse arolelanoang ka:
sudo make install 3. Netefatsa ka:
ldconfig
7.2 Kenya lintho tse arolelanoang ka letsoho
Sebelisa Bash ho kenya tsohle *.so files ea NanoLib ka letsoho. 1. Ka Bash: Etsa fensetere e ncha ka hare ho /usr/local/lib. 2. Litokelo tsa Admin lia hlokahala! Mofuta:
sudo mkdir /usr/local/lib/nanotec 3. Fetola ho fensetere ea sephutheloana sa ho kenya se sa koaloang. 4. Kopitsa lintho tsohle tse arolelanoang ho lib foldareng ka:
kenya ./nanotec_nanolib/lib/*.so /usr/local/lib/nanotec/ 5. Sheba litaba tsa foldara e lebisitsoeng ka:
ls -al /usr/local/lib/nanotec/ 6. Sheba hore na lintho tsohle tse arolelanoang tse tsoang ho lib foldara li thathamisitsoe. 7. Matha ldconfig foldareng ena ka:
sudo ldconfig /usr/local/lib/nanotec/
7.3 Theha morero oa hau
Ka lintho tseo u li arolelaneng tse kentsoeng: Theha projeke e ncha bakeng sa Linux NanoLib ea hau. 1. Via Bash: Theha foldara e ncha ea projeke (mona: NanoLibTest) ka:
mkdir NanoLibTest cd NanoLibTest
2. Kopitsa hlooho files ho foldareng e kenyeletsang (mona: inc) ka: mkdir inc cp / FILE IS>/nanotec_nanolib/inc/*.hpp inc
3. Theha ka sehloohong file (NanoLibTest.cpp) ka: #include "accessor_factory.hpp" #include

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

14

7 Ho iketsetsa morero oa Linux
int main(){nlc::NanoLibAccessor *accessor = getNanoLibAccessor();
nlc::SephethoBusHwIds = accessor->listAvailableBusHardware();
haeba(result.hasError()) {std::cout << result.getError() << std::endl; }
e 'ngoe{ std:: cout << "Katleho" << std::endl; }
hlakola accessor; khutla 0; }
4. Sheba foldara ea projeke bakeng sa sebopeho se loketseng:

Nanotic-NanoLib-C++-Programming-FIG- (3)
. NanoLibTest
inc accessor_factory.hpp bus_hardware_id.hpp … od_index.hpp result.hpp NanoLibTest.cpp
7.4 Kopanya le ho leka morero oa hau
Etsa hore Linux NanoLib ea hau e itokisetse ho sebelisoa ka Bash.
1. Via Bash: Kopanya sehlooho file ka:
g++ -Wall -Wextra -pedantic -I./inc -c NanoLibTest.cpp -o NanoLibTest
2. Hokela e executable hammoho ka:
g++ -Wall -Wextra -pedantic -I./inc -o teko NanoLibTest.o L/usr/local/lib/nanotec -lnanolib -ldl
3. Etsa lenaneo la teko ka:
./test
4. Sheba hore na Bash ea hau e tlaleha ka nepo:
katleho

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

15

8 Lihlopha / referense ea mesebetsi

8 Lihlopha / referense ea mesebetsi

Fumana mona lethathamo la lihlopha tsa NanoLib tsa mosebelisi le mesebetsi ea litho tsa tsona. Tlhaloso e tloaelehileng ea ts'ebetso e kenyelletsa kenyelletso e khuts'oane, tlhaloso ea ts'ebetso le parameter / lenane la ho khutla:

ExampleFunction () E o bolella ka bokhuts'oane hore na mosebetsi o etsa eng.
virtual void nlc::NanoLibAccessor::ExampleFunction (Param_a const & param_a, Param_b const & param_B)

Liparamente param_a param_b
E khutlisa ResultVoid

Tlhaloso e eketsehileng haeba ho hlokahala. Tlhaloso e eketsehileng haeba ho hlokahala.

8.1 NanoLibAccessor

Sehlopha sa li-interface se sebelisitsoeng e le sebaka sa ho kena ho NanoLib. Mokhoa o tloaelehileng oa ts'ebetso o shebahala tjena:
1. Qala ka ho hlahloba hardware ka NanoLibAccessor.listAvailableBusHardware (). 2. Beha litlhophiso tsa puisano ka BusHardwareOptions (). 3. Bula khokahanyo ea hardware le NanoLibAccessor.openBusHardwareWithProtocol (). 4. Hlakola bese bakeng sa lisebelisoa tse hokahaneng ka NanoLibAccessor.scanDevices (). 5. Kenya sesebelisoa se nang le NanoLibAccessor.addDevice (). 6. Hokela ho sesebelisoa ka NanoLibAccessor.connectDevice (). 7. Kamora ho qeta ts'ebetso, tlosa sesebelisoa ka NanoLibAccessor.disconnectDevice (). 8. Tlosa sesebelisoa ka NanoLibAccessor.removeDevice (). 9. Koala khokahanyo ea hardware le NanoLibAccessor.closeBusHardware ().
NanoLibAccessor e na le mesebetsi e latelang ea setho sa sechaba:

listAvailableBusHardware () Sebelisa ts'ebetso ena ho thathamisa lisebelisoa tse fumanehang tsa fieldbus.
virtual ResultBusHwIds nlc::NanoLibAccessor::listAvailableBusHardware ()

E khutlisa ResultBusHwIds

E fana ka lethathamo la ID ea fieldbus.

OpenBusHardwareWithProtocol () Sebelisa mokhoa ona ho hokahanya lisebelisoa tsa libese.
virtual ResultVoid nlc::NanoLibAccessor::openBusHardwareWithProtocol (BusHardwareId const & busHwId, BusHardwareOptions const & busHwOpt)

Mekhahlelo busHwId busHwOpt
E khutlisa ResultVoid

E totobatsa fieldbus e lokelang ho buloa. E totobatsa likhetho tsa ho bula fieldbus. E netefatsa hore void function e felile.

isBusHardwareOpen () Sebelisa ts'ebetso ena ho hlahloba hore na khokahanyo ea hau ea hardware ea fieldbus e bulehile.
virtual ResultVoid nlc::NanoLibAccessor::openBusHardwareWithProtocol (consst BusHardwareId & busHwId, const BusHardwareOptions & busHwOpt)

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

16

8 Lihlopha / referense ea mesebetsi

Parameters BusHardwareId Returns true
bohata

E qolla fieldbus e 'ngoe le e 'ngoe e lokelang ho buloa. Hardware e butse. Hardware e koetsoe.

getProtocolSpecificAccessor () Sebelisa ts'ebetso ena ho fumana ntho e amanang le protocol e ikhethileng.
virtual ResultVoid nlc::NanoLibAccessor::getProtocolSpecificAccessor (BusHardwareId const & busHwId)

Liparamente busHwId Returns ResultVoid

E hlalosa fieldbus ho fumana accessor bakeng sa. E netefatsa hore void function e felile.

getProfinetDCP () Sebelisa ts'ebetso ena ho khutlisetsa referense ho interface ea Profinet DCP.
virtual ProfinetDCP & getProfinetDCP ()

E khutlisetsa ProfinetDCP

getSamplerInterface () Sebelisa ts'ebetso ena ho fumana moelelo oa sampler interface.
virtual SamplerInterface & getSamplerInterface ()

E khutlisetsa SamplerInterface

E bua ka sampler interface sehlopha.

setBusState () Sebelisa ts'ebetso ena ho beha boemo bo ikhethileng ba bese.
virtual ResultVoid nlc::NanoLibAccessor::setBusState (consst BusHardwareId & busHwId, const std::string & state)

Litekanyetso busHwId state
E khutlisa ResultVoid

E totobatsa fieldbus e lokelang ho buloa. E fana ka boemo bo ikhethileng ba bese joalo ka boleng ba likhoele. E netefatsa hore void function e felile.

scanDevices () Sebelisa ts'ebetso ena ho hlahloba lisebelisoa tsa marang-rang.
virtual ResultDeviceIds nlc::NanoLibAccessor::scanDevices (consst BusHardwareId & busHwId, NlcScanBusCallback* callback)

Li-parameter busHwId callback
E khutlisa ResultDeviceIds IOError

E totobatsa fieldbus e lokelang ho hlahlojoa. NlcScanBusCallback tracker ea tsoelopele. E fana ka lethathamo la ID la sesebelisoa. E tsebisa hore sesebelisoa ha se fumanehe.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

17

8 Lihlopha / referense ea mesebetsi

addDevice ()
Sebelisa ts'ebetso ena ho kenya sesebelisoa sa libese se hlalositsoeng ke deviceId lethathamong la lisebelisoa tsa ka hare tsa NanoLib, le ho khutlisetsa deviceHandle bakeng sa eona.
virtual ResultDeviceHandle nlc::NanoLibAccessor::addDevice (DeviceId const & deviceId)

Parameters deviceId Returns ResultDeviceHandle

E hlalosa sesebediswa seo o ka se kenyang lenaneng. E fana ka letsoho la sesebelisoa.

connectDevice () Sebelisa tshebetso ena ho hokela sesebediswa ka deviceHandle.
virtual ResultVoid nlc ::NanoLibAccessor::connectDevice (DeviceHandle const deviceHandle)

Parameters deviceHandle Returns ResultVoid
Phoso ea IOE

E totobatsa hore na NanoLib e hokela sesebelisoa sefe sa bese. E netefatsa hore void function e felile. E tsebisa hore sesebelisoa ha se fumanehe.

getDeviceName () Sebelisa mokhoa ona ho fumana lebitso la sesebelisoa ka deviceHandle.
virtual ResultString nlc ::NanoLibAccessor::getDeviceName (DeviceHandle const deviceHandle)

Parameters deviceHandle Returns ResultString

E totobatsa hore na NanoLib e reha lebitso la sesebelisoa sa libese sefe. E fana ka mabitso a lisebelisoa joalo ka khoele.

getDeviceProductCode () Sebelisa mokhoa ona ho fumana khoutu ea sehlahisoa ka deviceHandle.
virtual ResultInt nlc ::NanoLibAccessor::getDeviceProductCode (DeviceHandle const deviceHandle)

Parameters deviceHandle Returns ResultInt

E totobatsa hore na NanoLib e fumana khoutu ea sehlahisoa bakeng sa sesebelisoa sa libese sefe. E fana ka likhoutu tsa sehlahisoa joalo ka kakaretso.

getDeviceVendorId () Sebelisa ts'ebetso ena ho fumana ID ea morekisi oa sesebelisoa ka deviceHandle.
virtual ResultInt nlc ::NanoLibAccessor::getDeviceVendorId (DeviceHandle const deviceHandle)

Parameters deviceHandle Returns ResultInt
ResourceUnavailable

E totobatsa hore na NanoLib e fumana ID ea morekisi bakeng sa sesebelisoa sa libese sefe. E fana ka li-ID tsa barekisi joalo ka kakaretso. E tsebisa hore ha ho data e fumanoeng.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

18

8 Lihlopha / referense ea mesebetsi

getDeviceId () Sebelisa ts'ebetso ena ho fumana ID ea sesebelisoa se itseng ho tsoa lenaneng la kahare la NanoLib.
virtual ResultDeviceId nlc::NanoLibAccessor::getDeviceId (DeviceHandle const deviceHandle)

Parameters deviceHandle Returns ResultDeviceId

E totobatsa hore na NanoLib e fumana ID ea sesebelisoa bakeng sa sesebelisoa sa libese sefe. E fana ka ID ea sesebelisoa.

getDeviceIds () Sebelisa ts'ebetso ena ho fumana ID ea lisebelisoa tsohle lethathamong la kahare la NanoLib.
virtual ResultDeviceIds nlc::NanoLibAccessor::getDeviceIds ()

E khutlisa ResultDeviceIds

E fana ka lenane la ID ea sesebelisoa.

getDeviceUid () Sebelisa ts'ebetso ena ho fumana ID e ikhethang ea sesebelisoa (96 bit / 12 bytes) ka sesebelisoaHandle.
virtual ResultArrayByte nlc::NanoLibAccessor::getDeviceUid (DeviceHandle const deviceHandle)

Parameters deviceHandle Returns ResultArrayByte
ResourceUnavailable

E totobatsa hore na NanoLib e fumana ID e ikhethang bakeng sa sesebelisoa sa libese sefe. E fana ka li-ID tse ikhethang joalo ka li-byte array. E tsebisa hore ha ho data e fumanoeng.

getDeviceSerialNumber () Sebelisa mokhoa ona ho fumana nomoro ea serial ea sesebelisoa ka deviceHandle.
virtual ResultString NanolibAccessor::getDeviceSerialNumber (DeviceHandle const deviceHandle)

Parameters deviceHandle Returns ResultString
ResourceUnavailable

E totobatsa hore na NanoLib e fumana nomoro ea serial bakeng sa sesebelisoa sa libese sefe. E fana ka linomoro tsa serial joalo ka khoele. E tsebisa hore ha ho data e fumanoeng.

getDeviceHardwareGroup () Sebelisa mokhoa ona ho fumana sehlopha sa lisebelisoa tsa bese ka deviceHandle.
virtual ResultDeviceId nlc::NanoLibAccessor::getDeviceHardwareGroup (DeviceHandle const deviceHandle)

Parameters deviceHandle Returns ResultInt

E totobatsa hore na NanoLib e fumana sehlopha sa lisebelisoa bakeng sa sesebelisoa sa libese sefe.
E fana ka lihlopha tsa hardware e le kakaretso.

getDeviceHardwareVersion () Sebelisa mokhoa ona ho fumana mofuta oa hardware oa sesebelisoa sa bese ka deviceHandle.
virtual ResultDeviceId nlc::NanoLibAccessor::getDeviceHardwareVersion (DeviceHandle const deviceHandle)

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

19

8 Lihlopha / referense ea mesebetsi

Parameters deviceHandle

E khutla

ResultString ResourceUnavailable

E totobatsa hore na NanoLib e fumana mofuta ofe oa libese bakeng sa sesebelisoa sa libese. E fana ka mabitso a lisebelisoa joalo ka khoele. E tsebisa hore ha ho data e fumanoeng.

getDeviceFirmwareBuildId () Sebelisa ts'ebetso ena ho fumana ID ea firmware ea bese ka deviceHandle.
virtual ResultDeviceId nlc::NanoLibAccessor::getDeviceFirmwareBuildId (DeviceHandle const deviceHandle)

Parameters deviceHandle Returns ResultString

E hlakisa hore na NanoLib e fumana ID ea firmware bakeng sa sesebelisoa sa libese sefe.
E fana ka mabitso a lisebelisoa joalo ka khoele.

getDeviceBooloaderVersion () Sebelisa mokhoa ona ho fumana mofuta oa bootloader oa sesebelisoa sa bese ka deviceHandle.
virtual ResultInt nlc ::NanoLibAccessor::getDeviceBooloaderVersion (DeviceHandle const deviceHandle)

Parameters deviceHandle

E khutla

ResultInt ResourceUnavailable

E totobatsa hore na NanoLib e fumana mofuta oa bootloader bakeng sa sesebelisoa sa bese. E fana ka mefuta ea bootloader e le palo e felletseng. E tsebisa hore ha ho data e fumanoeng.

getDeviceBooloaderBuildId () Sebelisa mokhoa ona ho fumana ID ea "bootloader" ea sesebelisoa sa bese ka deviceHandle.
virtual ResultDeviceId nlc::NanoLibAccessor:: (DeviceHandle const deviceHandle)

Parameters deviceHandle Returns ResultString

E totobatsa hore na NanoLib e fumana ID ea "bootloader" bakeng sa sesebelisoa sa libese sefe.
E fana ka mabitso a lisebelisoa joalo ka khoele.

rebootDevice () Sebelisa ts'ebetso ena ho qala sesebelisoa ka sesebelisoaHandle.
virtual ResultVoid nlc ::NanoLibAccessor::rebootDevice (consst DeviceHandle deviceHandle)

Parameters deviceHandle Returns ResultVoid

E totobatsa fieldbus ho qala bocha. E netefatsa hore void function e felile.

getDeviceState () Sebelisa ts'ebetso ena ho fumana boemo bo ikhethileng ba sesebelisoa.
virtual ResultString nlc ::NanoLibAccessor::getDeviceState (DeviceHandle const deviceHandle)

Parameters deviceHandle

E hlalosa hore na NanoLib e fumana naha bakeng sa sesebelisoa sa libese sefe.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

20

8 Lihlopha / referense ea mesebetsi

E khutlisa ResultString

E fana ka mabitso a lisebelisoa joalo ka khoele.

setDeviceState () Sebelisa tshebetso ena ho seta boemo bo kgethehileng ba sesebediswa.
virtual ResultVoid nlc ::NanoLibAccessor::setDeviceState (consst DeviceHandle deviceHandle, const std::string & state)

Parameters deviceHandle state
E khutlisa ResultVoid

E hlalosa hore na NanoLib e beha boemo bofe bakeng sa sesebelisoa sa libese. E fana ka boemo bo ikhethileng ba bese joalo ka boleng ba likhoele. E netefatsa hore void function e felile.

getConnectionState ()
Sebelisa ts'ebetso ena ho fumana boemo ba ho qetela ba khokahanyo ea sesebelisoa se itseng ka deviceHandle (= E khaotsoe, e hoketsoe, e hokahane leBooloader)
virtual ResultConnectionState nlc::NanoLibAccessor::getConnectionState (DeviceHandle const deviceHandle)

Parameters deviceHandle Returns ResultConnectionState

E totobatsa hore na NanoLib e fumana boemo ba khokahano bakeng sa sesebelisoa sa bese.
E fana ka boemo ba khokahanyo (= E khaotsoe, e hoketsoe, e hokahane leBootloader).

CheckConnectionState ()
Hafeela boemo ba ho qetela bo tsejoang bo ne bo sa Khaoha: Sebelisa ts'ebetso ena ho hlahloba le ho ntlafatsa boemo bo itseng ba khokahano ea sesebelisoa ka deviceHandle le ka ho leka lits'ebetso tse 'maloa tse ikhethileng.
virtual ResultConnectionState nlc::NanoLibAccessor::checkConnectionState (DeviceHandle const deviceHandle)

Parameters deviceHandle Returns ResultConnectionState

E hlakisa hore na NanoLib e hlahloba boemo ba khokahano bakeng sa bese.
E fana ka boemo ba khokahanyo (= ha e Khaotsoe).

assignObjectDictionary () Sebelisa mokhoa ona oa letsoho ho abela bukantswe ya ntho (OD) ho deviceHandle ka bouena.
virtual ResultObjectDictionary nlc::NanoLibAccessor::assignObjectDictionary (DeviceHandle const deviceHandle, ObjectDictionary const & objectDictionary)

Diparamente deviceTšoara nthoDictionary
E khutlisa ResultObjectDictionary

E totobatsa hore na NanoLib e abela OD sesebelisoa sefe sa libese. E bonts'a thepa ea bukantswe ya ntho.

autoAssignObjectDictionary ()
Sebelisa automatism ena ho lumella NanoLib ho abela bukantswe ya ntho (OD) ho deviceHandle. Ha u fumana le ho kenya OD e loketseng, NanoLib e e abela sesebelisoa ka bo eona. Tlhokomeliso: Haeba OD e tsamaellanang e se e kentsoe laeboraring ea ntho, NanoLib e tla e sebelisa ka bo eona ntle le ho hlahloba bukana e rometsoeng.
virtual ResultObjectDictionary nlc::NanoLibAccessor::autoAssignObjectDictionary (DeviceHandle const deviceHandle, const std::string & dictionariesLocationPath)

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

21

8 Lihlopha / referense ea mesebetsi

Parameters deviceHandle

E khutla

didikishinariLocationPath ResultObjectDictionary

E totobatsa hore na NanoLib e tla hlahloba lisebelisoa life tsa libese ka bo eona bakeng sa li-OD tse loketseng. E hlalosa tsela e eang bukeng ea OD. E bonts'a thepa ea bukantswe ya ntho.

getAssignedObjectDictionary ()
Sebelisa mokhoa ona ho fumana bukantswe ya ntho e abelwang sesebediswa ka deviceHandle.
virtual ResultObjectDictionary nlc::NanoLibAccessor::getAssignedObjectDictionary (DeviceHandle const device
Tšoara)

Paramethara deviceHandle Returns ResultObjectDictionary

E totobatsa hore na NanoLib e fumana OD bakeng sa sesebelisoa sa libese sefe. E bonts'a thepa ea bukantswe ya ntho.

getObjectDictionaryLibrary () Mosebetsi ona o khutlisa referense ea OdLibrary.
virtual OdLibrary& nlc::NanoLibAccessor::getObjectDictionaryLibrary ()

E khutlisa OdLibrary&

E bula laeborari eohle ea OD le lidikishinari tsa eona.

setLoggingLevel () Sebelisa ts'ebetso ena ho beha lintlha tse hlokahalang tsa log (le log file boholo). Boemo ba kamehla ke Info.
virtual void nlc ::NanoLibAccessor::setLoggingLevel (LogLevel level)

Boemo ba li-parameter

Lintlha tse latelang tsa log li ka khoneha:

0 = Trace 1 = Debug 2 = Info 3 = Temoso 4 = Phoso 5 = E bohlokoa 6 = E tima

Boemo bo tlase (log e kholo ka ho fetisisa file); e boloka lintlha tsohle tse ka khonehang, hammoho le software ea ho qala / emisa. Boitsebiso ba ho lokisa liphoso (= liphetho tsa nakoana, litaba tse rometsoeng kapa tse amohetsoeng, joalo-joalo) Boemo ba kamehla; boloka melaetsa ea tlhahisoleseding. Mathata a ho rekota a etsahetseng empa a ke ke a emisa algorithm ea hajoale. Loka mathata a matla a ileng a emisa algorithm. Boemo bo phahameng ka ho fetesisa (log e nyane file); e tima ho rema lifate; ha ho na log ho hang. Ha ho sa rengoa lifate ho hang.

setLoggingCallback ()
Sebelisa ts'ebetso ena ho seta sesupa-tsela sa ho rema lifate le mojule oa ho kena (= laebrari) bakeng sa mohala oo (eseng bakeng sa sereti ka bosona).
virtual void nlc ::NanoLibAccessor::setLoggingCallback (NlcLoggingCallback* callback, const nlc::LogModule & logModule)

Liparamente *callback logModule

E beha pointer ea callback. Kenya mohala (eseng logger!) ho laeborari ea hau.

0 = NanolibCore 1 = NanolibCANopen 2 = NanolibModbus 3 = NanolibEtherCAT

E kenya tshebetsong callback bakeng sa mantlha a NanoLib feela. E kenya tshebetsong callback ya CANopen feela. E kenya tshebetsong callback ya Modbus feela. E kenya tshebetsong callback ya EtherCAT feela.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

22

8 Lihlopha / referense ea mesebetsi

4 = NanolibRest 5 = NanolibUSB

E kenya tshebetsong mohala wa REST-feela. E kenya tshebetsong callback ya USB feela.

usetLoggingCallback () Sebelisa ts'ebetso ena ho hlakola sesupa-tsela sa ho rema lifate.
virtual void nlc ::NanoLibAccessor::unsetLoggingCallback ()

balaPalo () Sebelisa tshebetso ena ho bala boleng ba dinomoro ho tswa ho bukantswe ya ntho.
virtual ResultInt nlc ::NanoLibAccessor::readNumber (consst DeviceHandle deviceHandle, const OdIndex odIndex)

Lisebelisoa tsa li-parameter Tšoara odIndex
E khutlisa ResultInt

E totobatsa hore na NanoLib e bala sesebelisoa sa libese sefe. E totobatsa (sub-) index eo ho ka baloang ho eona. E fana ka boleng bo sa hlalosoang ba linomoro (e ka saenoa, ea sa saena, ea lokisa16.16 bit values).

balaNumberArray () Sebedisa tshebetso ena ho bala dithulaganyo tsa dinomoro ho tswa ho bukantswe ya ntho.
virtual ResultArrayInt nlc::NanoLibAccessor::readNumberArray (consst DeviceHandle deviceHandle, const uint16_t index)

Parameters deviceHandle index
E khutlisa ResultArrayInt

E totobatsa hore na NanoLib e bala sesebelisoa sa libese sefe. Lenane la ntho. E fana ka palo e felletseng.

readBytes () Sebelisa mokhoa ona ho bala li-byte tse sa lumellaneng (data ea ntho e itseng) ho tsoa bukeng ea mantsoe.
virtual ResultArrayByte nlc::NanoLibAccessor::readBytes (consst DeviceHandle deviceHandle, const OdIndex odIndex)

Lisebelisoa tsa li-parameter Tšoara odIndex
E khutlisa ResultArrayByte

E totobatsa hore na NanoLib e bala sesebelisoa sa libese sefe. E totobatsa (sub-) index eo ho ka baloang ho eona. E fana ka li-byte array.

readString () Sebelisa ts'ebetso ena ho bala likhoele ho tsoa bukeng ea ntho.
virtual ResultString nlc ::NanoLibAccessor::readString (consst DeviceHandle deviceHandle, const OdIndex odIndex)

Lisebelisoa tsa li-parameter Tšoara odIndex
E khutlisa ResultString

E totobatsa hore na NanoLib e bala sesebelisoa sa libese sefe. E totobatsa (sub-) index eo ho ka baloang ho eona. E fana ka mabitso a lisebelisoa joalo ka khoele.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

23

8 Lihlopha / referense ea mesebetsi

ngolaPalo () Sebelisa ts'ebetso ena ho ngola boleng ba linomoro bukeng ea ntho.
virtual ResultVoid nlc ::NanoLibAccessor::writeNumber (consst DeviceHandle deviceHandle, int64_t value, const OdIndex odIndex, unsigned int bitLength)

Lisebelisoa tsa li-parameterTšoara boleng ba odIndex bitLength
E khutlisa ResultVoid

E totobatsa hore na NanoLib e ngolla sesebelisoa sa libese sefe. Boleng bo sa hlalosoang (bo ka saenoa, bo sa saena, bo lokisa 16.16). E totobatsa (sub-) index eo ho ka baloang ho eona. Bolelele ka hanyane. E netefatsa hore void function e felile.

writeBytes () Sebelisa ts'ebetso ena ho ngola li-byte tse sa lumellaneng (data ea ntho ea domain) bukeng ea ntho.
virtual ResultVoid nlc ::NanoLibAccessor::writeBytes (const DeviceHandle deviceHandle, const std::vector & data, const OdIndex odIndex)

Lisebelisoa tsa lisebelisoaTšoara data odIndex
E khutlisa ResultVoid

E totobatsa hore na NanoLib e ngolla sesebelisoa sa libese sefe. Byte vector / array. E totobatsa (sub-) index eo ho ka baloang ho eona. E netefatsa hore void function e felile.

kenyaFirmware ()
Sebelisa ts'ebetso ena ho ntlafatsa firmware ea hau.
virtual ResultVoid nlc ::NanoLibAccessor:: uploadFirmware (const DeviceHandle deviceHandle, const std::vector & fwData, NlcDataTransferCallback* callback)

Li-parameters deviceHandle fwData NlcDataTransferCallback
E khutlisa ResultVoid

E totobatsa hore na NanoLib e ntlafatsa sesebelisoa sa libese life. Sehlopha se nang le data ea firmware. Sebatli sa tsoelopele ea data. E netefatsa hore void function e felile.

uploadFirmwareFromFile ()
Sebelisa ts'ebetso ena ho ntlafatsa firmware ea hau ka ho e kenya file.
virtual ResultVoid nlc ::NanoLibAccessor:: uploadFirmwareFromFile (consst DeviceHandle deviceHandle, const std::string & absoluteFilePath, NlcDataTransferCallback* callback)

Lisebelisoa tsa li-Parameters Tšoara ka ho feletsengFileTsela ea NlcDataTransferCallback
E khutlisa ResultVoid

E totobatsa hore na NanoLib e ntlafatsa sesebelisoa sa libese life. Tsela ea ho file e nang le data ea firmware (std:: string). Sebatli sa tsoelopele ea data. E netefatsa hore void function e felile.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

24

8 Lihlopha / referense ea mesebetsi

uploadbootloader ()
Sebelisa ts'ebetso ena ho ntlafatsa bootloader ea hau ea taolo.
virtual ResultVoid nlc ::NanoLibAccessor::uploadBooloader (const DeviceHandle deviceHandle, const std::vector & btData, NlcDataTransferCallback* callback)

Parameters deviceHandle btData NlcDataTransferCallback
E khutlisa ResultVoid

E totobatsa hore na NanoLib e ntlafatsa sesebelisoa sa libese life. Sehlopha se nang le data ea bootloader. Sebatli sa tsoelopele ea data. E netefatsa hore void function e felile.

uploadBootloaderFromFile ()
Sebelisa ts'ebetso ena ho ntlafatsa bootloader ea hau ka ho e kenya file.
virtual ResultVoid nlc ::NanoLibAccessor:: uploadBooloaderFromFile (consst DeviceHandle deviceHandle, const std::string & bootloaderAbsoluteFilePath, NlcDataTransferCallback* callback)

Lisebelisoa tsa li-parameterTšoara bootloaderAbsoluteFileTsela ea NlcDataTransferCallback
E khutlisa ResultVoid

E totobatsa hore na NanoLib e ntlafatsa sesebelisoa sa libese life. Tsela ea ho file e nang le data ea bootloader (std:: string). Sebatli sa tsoelopele ea data. E netefatsa hore void function e felile.

kenyaBootloaderFirmware ()
Sebelisa ts'ebetso ena ho ntlafatsa bootloader ea hau ea molaoli le firmware.
virtual ResultVoid nlc ::NanoLibAccessor::uploadBooloaderFirmware (const DeviceHandle deviceHandle, const std::vector & btData, const std::vector & fwData, NlcDataTransferCallback* callback)

Parameters deviceHandle btData fwData NlcDataTransferCallback
E khutlisa ResultVoid

E totobatsa hore na NanoLib e ntlafatsa sesebelisoa sa libese life. Sehlopha se nang le data ea bootloader. Sehlopha se nang le data ea firmware. Sebatli sa tsoelopele ea data. E netefatsa hore void function e felile.

uploadBootloaderFirmwareFromFile ()
Sebelisa ts'ebetso ena ho ntlafatsa bootloader ea hau ea molao le firmware ka ho kenya files.
virtual ResultVoid nlc ::NanoLibAccessor:: uploadBooloaderFirmwareFromFile (consst DeviceHandle deviceHandle, const std::string & bootloaderAbsoluteFileTsela, const std :: khoele & absoluteFilePath, NlcDataTransferCallback* callback)

Lisebelisoa tsa li-parameterTšoara bootloaderAbsoluteFileTsela e phethahetsengFileTsela ea NlcDataTransferCallback
E khutlisa ResultVoid

E totobatsa hore na NanoLib e ntlafatsa sesebelisoa sa libese life. Tsela ea ho file e nang le data ea bootloader (std:: string). Tsela ea ho file e nang le data ea firmware (uint8_t). Sebatli sa tsoelopele ea data. E netefatsa hore void function e felile.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

25

8 Lihlopha / referense ea mesebetsi

uploadNanoJ ()
Sebelisa mosebetsi ona oa sechaba ho kenya lenaneo la NanoJ ho molaoli oa hau.
virtual ResultVoid nlc ::NanoLibAccessor:: uploadNanoJ (DeviceHandle const deviceHandle, std::vector const & vmmData, NlcDataTransferCallback* callback)

Li-parameters deviceHandle vmmData NlcDataTransferCallback
E khutlisa ResultVoid

E totobatsa hore na NanoLib e kenya sesebelisoa sefe. Sehlopha se nang le data ea NanoJ. Sebatli sa tsoelopele ea data. E netefatsa hore void function e felile.

uploadNanoJFromFile ()
Sebelisa ts'ebetso ena ea sechaba ho kenya lenaneo la NanoJ ho molaoli oa hau ka ho kenya faele ea hau file.
virtual ResultVoid nlc ::NanoLibAccessor:: uploadNanoJFromFile (consst DeviceHandle deviceHandle, const std::string & absoluteFilePath, NlcDataTransferCallback* callback)

Lisebelisoa tsa li-Parameters Tšoara ka ho feletsengFileTsela ea NlcDataTransferCallback
E khutlisa ResultVoid

E totobatsa hore na NanoLib e kenya sesebelisoa sefe. Tsela ea ho file e nang le data ea NanoJ (std:: string). Sebatli sa tsoelopele ea data. E netefatsa hore void function e felile.

disconnectDevice () Sebelisa tshebetso ena ho hakolla sesebediswa sa hao ka deviceHandle.
virtual ResultVoid nlc ::NanoLibAccessor::disconnectDevice (DeviceHandle const deviceHandle)

Parameters deviceHandle Returns ResultVoid

E hlakisa hore na NanoLib e hakolla sesebelisoa sa libese ho eng. E netefatsa hore void function e felile.

removeDevice () Sebelisa ts'ebetso ena ho tlosa sesebelisoa sa hau lenaneng la lisebelisoa tsa kahare tsa NanoLib.
virtual ResultVoid nlc ::NanoLibAccessor::removeDevice (consst DeviceHandle deviceHandle)

Parameters deviceHandle Returns ResultVoid

E totobatsa hore na NanoLib e beha sesebelisoa sefe sa libese. E netefatsa hore void function e felile.

closeBusHardware () Sebelisa mokhoa ona ho hakolla ho hardware ea hau ea fieldbus.
virtual ResultVoid nlc::NanoLibAccessor::closeBusHardware (BusHardwareId const & busHwId)

Liparamente busHwId Returns ResultVoid

E totobatsa fieldbus eo u lokelang ho e khaola ho eona. E netefatsa hore void function e felile.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

26

8 Lihlopha / referense ea mesebetsi

8.2 BusHardwareId
Sebelisa sehlopha sena ho tsebahatsa lisebelisoa tsa libese ka bonngoe kapa ho khetholla lisebelisoa tse fapaneng tsa libese ho tse ling. Sehlopha sena (ntle le mesebetsi ea setter e ke keng ea fetoha ho tloha pōpong ho ea pele) e boetse e na le boitsebiso ho:
Hardware (= lebitso la adaptara, adaptara ea marang-rang joalo-joalo) Protocol e sebelisoang (= Modbus TCP, CANopen joalo-joalo) Setsebi sa lisebelisoa tsa libese (= lebitso la seriale la boema-kepe, Lebitso la Botsoalle la MAC
aterese jj.)

BusHardwareId () [1/3] Moetsi ea thehang ntho e ncha ea ID ea bese.
nlc::BusHardwareId::BusHardwareId (std::string const & busHardware_, std::string const & protocol_, std::string const & hardwareSpecifier_, std::string const & name_)

Liparamente busHardware_ protocol_ hardwareSpecifier_ extraHardwareSpecifier_ name_

Mofuta oa thepa (= ZK-USB-CAN-1 joalo-joalo). Protocol ea puisano ea libese (= CANopen joalo-joalo). Tlhaloso ea hardware (= COM3 joalo-joalo). Tlhaloso e eketsehileng ea hardware (e re, lintlha tsa sebaka sa USB). Lebitso la botsoalle (= AdapterName (Port) joalo-joalo).

BusHardwareId () [2/3] Sehahi se thehang ntho e ncha ea ID ea bese, e nang le boikhethelo bakeng sa speicifier e eketsehileng ea hardware.
nlc::BusHardwareId::BusHardwareId (std::string const & busHardware_, std::string const & protocol_, std::string const & hardwareSpecifier_, std::string const & extraHardwareSpecifier_, std::string const & name_)

Liparamente busHardware_ protocol_ hardwareSpecifier_ extraHardwareSpecifier_ name_

Mofuta oa thepa (= ZK-USB-CAN-1 joalo-joalo). Protocol ea puisano ea libese (= CANopen joalo-joalo). Tlhaloso ea hardware (= COM3 joalo-joalo). Tlhaloso e eketsehileng ea hardware (e re, lintlha tsa sebaka sa USB). Lebitso la botsoalle (= AdapterName (Port) joalo-joalo).

BusHardwareId () [3/3] Sehahi se kopitsang bese e leng tengHardwareId.
nlc::BusHardwareId::BusHardwareId (BusHardwareId const &)

nlc::BusHardwareId::BusHardwareId (BusHardwareId const &)

Parameters busHardwareId

E bolela ID ea lisebelisoa tsa bese eo u ka kopitsang ho eona.

equals () E bapisa ID e ncha ea hardware ea bese le tse teng.
bool nlc ::BusHardwareId::equals (BusHardwareId const & tse ling) const

Parameters other Returns 'nete

Ntho e 'ngoe ea sehlopha se le seng. Haeba ka bobeli li lekana ka litekanyetso tsohle.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

27

8 Lihlopha / referense ea mesebetsi

bohata

Haeba litekanyetso li fapane.

getBusHardware () E bala khoele ea lisebelisoa tsa bese.
std::string nlc::BusHardwareId::getBusHardware () const

E khutlisetsa khoele

getHardwareSpecifier () E bala thapo e hlalosang lisebelisoa tsa bese (= lebitso la marang-rang jj.).
std::string nlc::BusHardwareId::getHardwareSpecifier () const

E khutlisetsa khoele

getExtraHardwareSpecifier () E bala thapo e hlakisang lisebelisoa tse ling tsa bese (= aterese ea MAC joalo-joalo).
std::string nlc::BusHardwareId::getExtraHardwareSpecifier () const

E khutlisetsa khoele

getName () E bala mabitso a botsoalle a hardware ea bese.
std::string nlc::BusHardwareId::getName () const

E khutlisetsa khoele

getProtocol () E bala khoele ea protocol ea bese.
std::string nlc::BusHardwareId::getProtocol () const

E khutlisetsa khoele

toString () E khutlisa ID ea lisebelisoa tsa bese e le khoele.
std::string nlc::BusHardwareId::toString () const

E khutlisetsa khoele
8.3 Likhetho tsa BusHardware
Fumana ka phaposing ena, lethathamong la li-key-value tsa likhoele, likhetho tsohle tse hlokahalang ho bula lisebelisoa tsa libese.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

28

8 Lihlopha / referense ea mesebetsi

BusHardwareOptions () [1/2] E theha ntho e ncha ea khetho ea hardware ea libese.
nlc::BusHardwareOptions::BusHardwareOptions () Sebelisa tšebetso ea addOption () ho eketsa lipara tsa bohlokoa.

BusHardwareOptions () [2/2] E theha ntho e ncha ea likhetho tsa lisebelisoa tsa libese ka 'mapa oa boleng ba bohlokoa o seng o ntse o le teng.
nlc::BusHardwareOptions::BusHardwareOptions (std::mapa const & options)

Likhetho tsa parameters

'Mapa o nang le likhetho tsa lisebelisoa tsa libese.

addOption () E theha linotlolo le litekanyetso tse eketsehileng.
void nlc ::BusHardwareOption::addOption (std::string const & key, std::string const & value)

Li-parameters tsa bohlokoa

Example: BAUD_RATE_OPTIONS_NAME, sheba likhetho tsa bus_hw_options_
ExampLe: BAUD_RATE_1000K, bona bus_hw_options_defaults

lekana () Bapisa BusHardwareOptions ho tse seng li ntse li le teng.
bool nlc ::BusHardwareOptions::equals (BusHardwareOptions const & other) const

Parameters other Returns 'nete
bohata

Ntho e 'ngoe ea sehlopha se le seng. Haeba ntho e 'ngoe e na le likhetho tse tšoanang hantle. Haeba ntho e 'ngoe e na le linotlolo kapa litekanyetso tse fapaneng.

getOptions () E bala lipara tsohle tse kentsoeng tsa bohlokoa.
std::mapa nlc::BusHardwareOptions::getOptions () const

E khutlisa 'mapa oa likhoele

toString () E khutlisa linotlolo / litekanyetso tsohle joalo ka khoele.
std::string nlc::BusHardwareId::toString () const

E khutlisetsa khoele
8.4 BushHwOptionsDefault
Sehlopha sena sa litlhophiso tsa kamehla se na le litšobotsi tse latelang tsa sechaba:

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

29

8 Lihlopha / referense ea mesebetsi

const CanBus const Serial const RESTfulBus const EtherCATBus

canBus = CanBus () serial = Serial () restfulBus = RESTfulBus() ethercatBus = EtherCATBus()

8.5 CanBaudRate

Sebopeho se nang le li-baudrates tsa libese tsa CAN ho litšobotsi tse latelang tsa sechaba:

const std ::khoele const std :: khoele const std :: khoele const std :: khoele const std :: khoele const std :: khoele const std :: khoele const std : :

BAUD_RATE_1000K = “1000k” BAUD_RATE_800K = “800k” BAUD_RATE_500K = “500k” BAUD_RATE_250K = “250k” BAUD_RATE_125K = “125k” BAUD_RATE_100 BAUD_100 BAUD_50 BAUD_50 TE_20K = “20k” BAUD_RATE_10K = “10k” BAUD_RATE_5K = “5k”

8.6 CanBus

Likhetho tsa meralo ea kamehla e nang le litšobotsi tse latelang tsa sechaba:

const std :: khoele const CanBaudRate const Ixxat

BAUD_RATE_OPTIONS_NAME = “ka adapter baud rate” baudRate = CanBaudRate () ixxat = Ixxat ()

8.7 CanOpenNmtService

Bakeng sa ts'ebeletso ea NMT, sebopeho sena se na le lintlha tsa CANopen NMT e le boleng ba litšoaneleho tse latelang tsa sechaba:

const std :: khoele const std :: khoele const std :: khoele const std :: khoele const std :: khoele

QALA = “QALA” EMA = “ETSA” PRE_OPERATIONAL = “PRE_OPERATIONAL” SETSHETSA PESA = “RESETSA” RESET_COMMUNICATION = “RESET_COMMUNICATION”

8.8 CanOpenNmtState

Sebopeho sena se na le lintlha tsa CANopen NMT e le boleng ba mekhoa e latelang ea sechaba:

const std :: khoele const std :: khoele const std :: khoele const std :: khoele const std :: khoele

E EMISITSOE = “EMA” PRE_OPERATIONAL = “PRE_OPERATIONAL” OPERATIONAL = “OPERATIONAL” INITIALIZATION = “QALEHO” E SA TSEBANG = “HA TSEBANE”

8.9 Sebopeho sa EtherCATBus

Sebopeho sena se na le likhetho tsa tlhophiso ea puisano ea EtherCAT ho litšobotsi tse latelang tsa sechaba:

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

30

8 Lihlopha / referense ea mesebetsi

const std::string NETWORK_FIRMWARE_STATE_OP- Boemo ba netweke bo nkuoa joalo ka mokhoa oa firmware. E amohelehang

TION_NAME = "Network Firmware State"

boleng (kamehla = PRE_OPERATIONAL):

EtherCATState::PRE_OPERATIONAL EtherCATstate::SAFE_OPERATIONAL EtherCATState::OPERATIONAL

const std:: khoele DEFAULT_NETWORK_FIRMWARE_ STATE = “PRE_OPERATIONAL”

const std::string EXCLUSIVE_LOCK_TIMEOUT_OP- Nako e felile ka milliseconds ho fumana senotlolo sa ho bula

TION_NAME = “Nako e Kopanetsoeng ea Lock”

marang-rang (kamehla = 500 ms).

const int e sa ngolisoang DEFAULT_EXCLUSIVE_LOCK_ TIMEOUT = “500”

const std::string SHARED_LOCK_TIMEOUT_OPTION_ Nako e felile ka milliseconds ho fumana senotlolo se arolelanoang

NAME = “Nako ea ho Lokela e Kopanetsoeng”

marang-rang (kamehla = 250 ms).

const int e sa ngolisoang DEFAULT_SHARED_LOCK_TIMEOUT = “250”

const std::string READ_TIMEOUT_OPTION_NAME = Nako e felile ka milliseconds bakeng sa ts'ebetso ea ho bala (ea kamehla

“Bala Nako ea ho Bala”

= 700 ms).

const int int int DEFAULT_READ_TIMEOUT = “700”

const std::string WRITE_TIMEOUT_OPTION_NAME = Nako e felile ka milliseconds bakeng sa mosebetsi oa ho ngola (kamehla

“Ngola Nako”

= 200 ms).

const int e sa saena DEFAULT_WRITE_TIMEOUT = “200”

const std::string READ_WRITE_ATTEMPTS_OPTION_ Boiteko bo phahameng ba ho bala kapa ho ngola (litekanyetso tse seng lefela

NAME = “Boiteko ba ho Bala/Ngola”

feela; kamehla = 5).

const int e sa ngolisoang DEFAULT_READ_WRITE_ATTEMPTS = “5”

const std::string CHANGE_NETWORK_STATE_ATTEMPTS_OPTION_NAME = “Fetola Liteko tsa Boemo ba Netweke”

Palo e kholo ea boiteko ba ho fetola boemo ba marang-rang (litekanyetso tse seng tsa zero feela; default = 10).

const int e sa ngolisoang DEFAULT_CHANGE_NETWORK_ STATE_ATTEMPTS = “10”

const std::string PDO_IO_ENABLED_OPTION_NAME E nolofalletsa kapa e tima ts'ebetso ea PDO bakeng sa dijithale ho- /

= "PDO IO E nolofalitsoe"

dipoelo (“Nnete” kapa “Bohata” feela; kamehla = “Nnete”).

const std:: khoele DEFAULT_PDO_IO_ENABLED = “Nnete”

8.10 Sebopeho sa EtherCATSstate

Sebopeho sena se na le EtherCAT lekhoba / linaha tsa marang-rang e le litekanyetso tsa likhoele ho litšobotsi tse latelang tsa sechaba. Tlhokomeliso: Boemo ba kamehla bo sebetsang ke PRE_OPERATIONAL; NanoLib e ke ke ea fana ka boemo bo ka tšeptjoang ba "OPERATIONAL" tsamaisong eo eseng ea nako ea nnete:

const std :: khoele const std :: khoele const std :: khoele const std :: khoele const std :: khoele const std :: khoele

NONE = “NOONE” INIT = “INIT” PRE_OPERATIONAL = “PRE_OPERATIONAL” BOOT = “BOOT” SAFE_OPERATIONAL = “SAFE_OPERATIONAL” OPERATIONAL = “OPERATIONAL”

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

31

8 Lihlopha / referense ea mesebetsi

8.11 Ixxat

Sebopeho sena se tšoere lintlha tsohle tsa Ixxat usb-to-can ka litšobotsi tse latelang tsa sechaba:

const std :: khoele

ADAPTER_BUS_NUMBER_OPTIONS_NAME = "nomoro ea bese ea adaptara ea ixxat"

const IxxatAdapterBusNumber adapterBusNumber = IxxatAdapterBusNumber ()

8.12 IxxatAdapterBusNumber

Sebopeho sena se na le nomoro ea bese bakeng sa Ixxat usb-to-can ka litšobotsi tse latelang tsa sechaba:

const std :: khoele const std :: khoele const std :: khoele const std :: khoele

BUS_NUMBER_0_DEFAULT = “0” BUS_NUMBER_1 = “1” BUS_NUMBER_2 = “2” BUS_NUMBER_3 = “3”

Tlhoro ea 8.13

Sebopeho sena se tšoere lintlha tsohle tsa Peak usb-to-can ka litšobotsi tse latelang tsa sechaba:

const std :: khoele

ADAPTER_BUS_NUMBER_OPTIONS_NAME = "nomoro ea bese ea adaptara e holimo"

const PeakAdapterBusNumber adapterBusNumber = PeakAdapterBusNumber ()

8.14 PeakAdapterBusNomoro

Sebopeho sena se na le nomoro ea bese bakeng sa Peak usb-to-can ka litšobotsi tse latelang tsa sechaba:

const std:: khoele const std:: khoele const std:: khoele const std:: khoele const std:: khoele const std:: khoele const std:: khoele const std:: khoele const std:: khoele const std:: khoele const std:: khoele const std: khoele: std :: khoele const std:: khoele

BUS_NUMBER_1_DEFAULT = std::to_string (PCAN_USBBUS1) BUS_NUMBER_2 = std::to_string (PCAN_USBBUS2) BUS_NUMBER_3 = std::to_string (PCAN_USBBUS3) BUS_NUMBER_4 = std::to_USd string (PCAN_USBBUS4) = 5to BUSD_USB (PCAN_USBBUS5) (PCAN_USBBUS6) BUS_NUMBER_6 = std::to_string (PCAN_USBBUS7) BUS_NUMBER_7 = std::to_string (PCAN_USBBUS8) BUS_NUMBER_8 = std::to_string (PCAN_USBBUS9) BUS_NUMBER_9 = std::USBUS_NUMBER (PCAN_USB_10) std::to_string (PCAN_USBBUS10) BUS_NUMBER_11 = std::to_string (PCAN_USBBUS11) BUS_NUMBER_12 = std::to_string (PCAN_USBBUS12) BUS_NUMBER_13 = std::to_string (PCAN_USBBUSst_string_to_13) = 14 (PCAN_USBBUS14) BUS_NUMBER_15 = std::to_string (PCAN_USBBUS15) BUS_NUMBER_16 = std::to_string (PCAN_USBBUS16)

8.15 DeviceHandle
Sehlopha sena se emela sebapi sa ho laola sesebelisoa beseng 'me se na le mesebetsi e latelang ea litho tsa sechaba.

DeviceHandle () DeviceHandle (uint32_t handle)

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

32

8 Lihlopha / referense ea mesebetsi

lekana () E ipapisa le mofeng oa sesebelisoa se fanoeng.
bool e lekana (DeviceHandle const other) const (uint32_t handle)

toString () E khutlisa kemiso ea likhoele ea mothapo oa sesebelisoa.
std:: khoele toString () const

fumana () E khutlisa molamu oa sesebelisoa.
uint32_t fumana () const

8.16 SesebelisoaId
Sebelisa sehlopha sena (se ke keng sa fetoha ho tloha pōpong ho ea pele) ho tseba le ho khetholla lisebelisoa tse ka beseng:

Sekhetho sa adaptara ea Hardware

Setsebi sa sesebelisoa

Tlhaloso

Moelelo oa litekanyetso tsa ID / tlhaloso ea sesebelisoa o itšetlehile ka bese. Bakeng sa mohlalaample, bese ea CAN e ka sebelisa nomoro ea ID.

DeviceId () [1/3] E etsa ntho e ncha ea ID ea sesebelisoa.
nlc::DeviceId::DeviceId (BusHardwareId const & busHardwareId_, int deviceId_ e sa ngolisoang, std::string const & definition_)

Liparamente busHardwareId_ deviceId_ description_

Sesupo sa bese. Index; tlas'a bese (= CANopen node ID joalo-joalo). Tlhaloso (e ka ba e se nang letho); tlas'a bese.

DeviceId () [2/3] E etsa ntho e ncha ea ID ea sesebelisoa ka likhetho tse atolositsoeng tsa ID.
nlc::DeviceId::DeviceId (BusHardwareId const & busHardwareId, int device e sa saenaId_, std::string const & description_ std::vector const & extraId_, std ::string const & extraStringId_)

Liparamente busHardwareId_ deviceId_ description_ extraId_ extraStringId_

Sesupo sa bese. Index; tlas'a bese (= CANopen node ID joalo-joalo). Tlhaloso (e ka ba e se nang letho); tlas'a bese. ID e eketsehileng (e ka 'na ea se na letho); moelelo o itšetlehile ka bese. ID ea khoele e eketsehileng (e ka 'na ea se na letho); moelelo o itšetlehile ka bese.

DeviceId () [3/3] E etsa kopi ea ntho ea ID ea sesebelisoa.
nlc ::DeviceId ::DeviceId (DeviceId const &)

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

33

8 Lihlopha / referense ea mesebetsi

Li-parameter deviceId_

ID ea sesebelisoa eo u ka kopitsang ho eona.

lekana () Bapisa tse ncha le lintho tse teng.
bool nlc ::DeviceId::equals (DeviceId const & tse ling) const

E khutlisetsa boolean

getBusHardwareId () E bala ID ea lisebelisoa tsa bese.
BusHardwareId nlc::DeviceId::getBusHardwareId () const

E khutlisa BusHardwareId

getDescription () E bala tlhaloso ea sesebelisoa (mohlomong ha e sebelisoe).
std::string nlc::DeviceId::getDescription () const

E khutlisetsa khoele

getDeviceId () E bala ID ea sesebelisoa (mohlomong ha e sebelisoe).
unsigned int nlc::DeviceId::getDeviceId () const

E khutlisetsa int e sa ngolisoang

toString () E khutlisetsa ntho joalo ka khoele.
std::string nlc::DeviceId::toString () const

E khutlisetsa khoele

getExtraId () E bala ID e eketsehileng ea sesebelisoa (e ka 'na ea se ke ea sebelisoa).
const std::vector &getExtraId () const

E khutlisetsa vector

Vector ea li-ID tsa tlatsetso (e kanna ea ba e se na letho); moelelo o itšetlehile ka bese.

getExtraStringId () E bala ID ea khoele e eketsehileng ea sesebelisoa (e ka 'na ea se ke ea sebelisoa).
std :: khoele getExtraStringId () const

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

34

8 Lihlopha / referense ea mesebetsi

E khutlisetsa khoele

ID ea khoele e eketsehileng (e ka 'na eaba ha e na letho); moelelo o itšetlehile ka bese.

8.17 LogLevelConverter

Sehlopha sena se khutlisa boemo ba hau ba log e le khoele. static std::string toString (nlc::LogLevel logLevel)

8.18 LogModuleConverter

Sehlopha sena se khutlisa laeborari e khethehileng ea logsetLoggingLevel () joalo ka khoele.

static std:: khoele

toString (nlc::LogModule logModule)

static std::string toString (nlc::LogModule logModule)

8.19 ObjectDictionary
Sehlopha sena se emela bukantswe ya ntho ya molaodi mme se na le mesebetsi e latelang ya setho: getDeviceHandle ()
virtual ResultDeviceHandle getDeviceHandle () const Returns ResultDeviceHandle

getObject () virtual ResultObjectSubEntry getObject (OdIndex const odIndex) E khutlisa ResultObjectSubEntry

getObjectEntry () virtual ResultObjectEntry getObjectEntry (uint16_t index)

E khutlisa ResultObjectEntry

E tsebisa ka matlotlo a ntho.

fumanaXmlFileLebitso () virtual ResultString getXmlFileLebitso () const

E khutlisa ResultString

E khutlisetsa XML file lebitso joalo ka khoele.

balaNumber () virtual ResultInt readNumber (OdIndex const odIndex) E khutlisa ResultInt
balaNumberArray () virtual ResultArrayInt readNumberArray (uint16_t const index)

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

35

8 Lihlopha / referense ea mesebetsi
E khutlisa ResultArrayInt readString ()
virtual ResultString readString (OdIndex const odIndex) Returns ResultString readBytes () virtual ResultArrayByte readBytes (OdIndex const odIndex) Returns ResultArrayByte writeNumber () virtual ResultVoid writeNumber (OdIndex const odInturns_Returns) writeBytes () virtual ResultVoid writeBytes (OdIndex const OdIndex, std::vector
const & data) E khutlisa ResultVoid Related Links OdIndex
8.20 ObjectEntry
Sehlopha sena se emela sengoloa sa bukantswe ya ntho, se na le semelo se latelang se sireleditsweng le mesebetsi ya setho sa setjhaba:
static nlc::ObjectSubEntry invalidObject
getName () E bala lebitso la ntho joalo ka khoele.
virtual std :: khoele getName () const
getPrivate () E hlahloba hore na ntho eo ke ea lekunutu.
virtual bool getPrivate () const
getIndex () E bala aterese ea index ea ntho.
virtual uint16_t getIndex () const

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

36

8 Lihlopha / referense ea mesebetsi

getDataType () E bala mofuta oa data oa ntho eo.
virtual nlc::ObjectEntryDataType getDataType () const

getObjectCode () E bala khoutu ea ntho:

Rekoto ea Null Deftype Defstruct Var Array Record

0x00 0x05 0x06 0x07 0x08 0x09

virtual nlc::ObjectCode getObjectCode () const

getObjectSaveable () E lekola hore na ntho e ka bolokeha le hore ke sehlopha (sheba bukana ea tataiso bakeng sa lintlha tse ling): APPLICATION, COMMUNICATION, DRIVE, MISC_CONFIG, MODBUS_RTU, NO, TUNING, CUSTOMER, ETHERNET, CANOPEN, VERIFY1020, UNKLEABLE_PEAX_SAVE
virtual nlc::ObjectSaveable getObjectSaveable () const

getMaxSubIndex () E bala palo ea li-subindices tse tšehetsoeng ke ntho ena.
virtual uint8_t getMaxSubIndex () const

getSubEntry () virtual nlc ::ObjectSubEntry & getSubEntry (uint8_t subIndex)
Sheba hape ObjectSubEntry.
8.21 ObjectSubEntry
Sehlopha sena se emela karoloana ea ntho (subindex) ea bukantswe ya ntho mme e na le mesebetsi e latelang ya setho:
getName () E bala lebitso la ntho joalo ka khoele.
virtual std :: khoele getName () const

getSubIndex () E bala aterese ea subindex.
virtual uint8_t getSubIndex () const

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

37

8 Lihlopha / referense ea mesebetsi

getDataType () E bala mofuta oa data oa ntho eo.
virtual nlc::ObjectEntryDataType getDataType () const

getSdoAccess () E hlahloba hore na subindex e fumaneha ka SDO:

BalaFeela

1

WriteOnly

2

BalaNgola

3

NoAccess

0

virtual nlc ::ObjectSdoAccessAttribute getSdoAccess () const

getPdoAccess () E hlahloba hore na subindex e fumaneha / e ka khoneha ka PDO:

Tx

1

Rx

2

TxRx

3

Che

0

virtual nlc::ObjectPdoAccessAttribute getPdoAccess () const

getBitLength () E hlahloba bolelele ba subindex.
virtual uint32_t getBitLength () const

getDefaultValueAsNumeric () E bala boleng ba kamehla ba subindex bakeng sa mefuta ea data ea linomoro.
virtual ResultInt getDefaultValueAsNumeric (std::string const & key) const

getDefaultValueAsString () E bala boleng ba kamehla ba subindex bakeng sa mefuta ea data ea likhoele.
virtual ResultString getDefaultValueAsString (std::string const & key) const

getDefaultValues ​​() E bala boleng ba kamehla ba subindex.
virtual std::mapa getDefaultValues ​​() const

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

38

8 Lihlopha / referense ea mesebetsi

balaNomoro () E bala palo ea sebele ea boleng ba subindex.
virtual ResultInt readNumber () const

readString () E bala thapo boleng ba 'nete ba subindex.
virtual ResultString readString () const

readBytes () E bala boleng ba 'nete ba subindex ka li-byte.
virtual ResultArrayByte readBytes () const

writeNumber () E ngola boleng ba linomoro ho subindex.
virtual ResultVoid writeNumber (consst int64_t value) const

writeBytes () E ngola boleng ho subindex ka li-byte.
virtual ResultVoid writeBytes (std::vector const & data) const

8.22 OdIndex
Sebelisa sehlopha sena (se ke keng sa fetoha ho tloha pōpong ho ea pele) ho phuthela le ho fumana li-indices / sub-indices. OD ea sesebelisoa e na le mela e fihlang ho 65535 (0xFFFF) le litšiea tse 255 (0xFF); e nang le likheo lipakeng tsa mela e sa khaotseng. Sheba maemo a CANopen le bukana ea hau ea sehlahisoa bakeng sa lintlha tse ling.
OdIndex () E theha ntho e ncha ea OdIndex.
nlc::OdIndex::OdIndex (uint16_t index, uint8_t subIndex)

Parameters index subindex

Ho tloha ho 0 ho isa ho 65535 (0xFFFF) ho kenyelletsa. Ho tloha ho 0 ho isa ho 255 (0xFF) ho kenyeletsa.

getIndex () E bala index (ho tloha 0x0000 ho isa 0xFFFF).
uint16_t nlc::OdIndex::getIndex () const

E khutlisetsa uint16_t

getSubindex () E bala index e nyane (ho tloha ho 0x00 ho isa 0xFF)
uint8_t nlc::OdIndex::getSubIndex () const

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

39

8 Lihlopha / referense ea mesebetsi

E khutlisetsa uint8_t

toString () E khutlisetsa index le subindex e le khoele. Khoele ea kamehla ea 0xIIII: 0xSS e baleha tjena:

I = index ho tloha 0x0000 ho isa 0xFFFF

S = index e nyane ho tloha ho 0x00 ho isa ho 0xFF

std::string nlc::OdIndex::toString () const

E khutlisa 0xIII: 0xSS

Kemelo ea thapo ea kamehla

8.23 OdLibrary
Sebelisa sebopeho sena sa lenaneo ho theha mehlala ea sehlopha sa ObjectDictionary ho tsoa ho XML. Ka assignObjectDictionary, joale o ka tlama mohlala o mong le o mong ho sesebelisoa se itseng ka lebaka la sekhetho se ikhethileng. Maemo a ObjectDictionary ka hona a bōpiloe a bolokiloe nthong ea OdLibrary hore e fihlellehe ka index. Sehlopha sa ODLibrary se jarisa lintho tsa ObjectDictionary ho tloha file kapa li hlophisitsoe, li li boloke, 'me li na le mesebetsi e latelang ea litho tsa sechaba:

getObjectDictionaryCount () virtual uint32_t getObjectDictionaryCount () const

getObjectDictionary () virtual ResultObjectDictionary getObjectDictionary (uint32_t odIndex)

E khutlisa ResultObjectDictionary

addObjectDictionaryFromFile ()
virtual ResultObjectDictionary addObjectDictionaryFromFile (std::string const & absoluteXmlFileTsela)

E khutlisa ResultObjectDictionary

addObjectDictionary ()
virtual ResultObjectDictionary addObjectDictionary (std::vector const & odXmlData, const std::string &xmlFileTsela = std :: khoele ())

E khutlisa ResultObjectDictionary
8.24 OdTypesHelper
Ho phaella mesebetsing e latelang ea litho tsa sechaba, sehlopha sena se na le mefuta ea data e tloaelehileng. Tlhokomeliso: Ho hlahloba mefuta ea hau ea data e tloaelehileng, sheba mofuta oa enum ObjectEntryDataType ho od_types.hpp.

uintToObjectCode () E fetolela linomoro tse sa ngolisoang ho ba khoutu ea ntho:

Null Defftype

0x00 0x05

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

40

8 Lihlopha / referense ea mesebetsi

Defstruct Var Array Record

0x06 0x07 0x08 0x09

static ObjectCode uintToObjectCode (un saen int objectCode)

isNumericDataType () E tsebisa haeba mofuta wa data e le dinomoro kapa tjhe.
static bool isNumericDataType (ObjectEntryDataType dataType)

isDefstructIndex () E tsebisa haeba ntho e le index ea sebopeho sa tlhaloso kapa che.
static boool isDefstructIndex (uint16_t typeNum)

isDeftypeIndex () E tsebisa haeba ntho e le index ea mofuta oa tlhaloso kapa che.
static boool isDeftypeIndex (uint16_t typeNum)

isComplexDataType () E tsebisa haeba mofuta oa data o rarahane kapa che.
static bool isComplexDataType (ObjectEntryDataType dataType)

uintToObjectEntryDataType () E fetolela linomoro tse sa ngolisoang hore e be mofuta oa data oa OD.
sstatic ObjectEntryDataType uintToObjectEntryDataType (uint16_t objectDataType)

objectEntryDataTypeToString () E fetolela mofuta oa data oa OD ho khoele.
static std::string objectEntryDataTypeToString (ObjectEntryDataType odDataType)

stringToObjectEntryDatatype () E fetolela khoele ho mofuta oa data oa OD ha ho khoneha. Ho seng joalo, e khutlisa UNKNOWN_DATATYPE.
static ObjectEntryDataType stringToObjectEntryDatatype (std::string dataTypeString)

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

41

8 Lihlopha / referense ea mesebetsi

objectEntryDataTypeBitLength () E tsebisa ka bonyane bolelele ba mofuta oa data e kenoang.
static uint32_t objectEntryDataTypeBitLength (ObjectEntryDataType const & dataType)

8.25 RESTfulBus sebopeho

Sebopeho sena se na le likhetho tsa tlhophiso ea puisano bakeng sa sebopeho sa RESTful (ho feta Ethernet). E na le litšobotsi tse latelang tsa sechaba:

const std :: khoele const e sa ngolisoa nako e telele const std :: khoele const e sa ngolisoa nako e telele const std:: khoele const e sa saena bolelele

CONNECT_TIMEOUT_OPTION_NAME = “Restful Connect Timeout” DEFAULT_CONNECT_TIMEOUT = 200 REQUEST_TIMEOUT_OPTION_NAME = “Restful Request Timeout” DEFAULT_REQUEST_TIMEOUT = 200 RESPONSE_TIMEOUT_OPTION_NAME = “RESTful Response Timeout750_FARESTs Timeout” DEFAULT_REQUEST_TIMEout

8.26 ProfinetDCP
Tlas'a Linux, sesebelisoa sa mohala se hloka CAP_NET_ADMIN le CAP_NET_RAW bokhoni. Ho thusa: sudo setcap 'cap_net_admin,cap_net_raw+eip' ./executable. Ho Windows, sebopeho sa ProfinetDCP se sebelisa WinPcap (e lekiloeng ka mofuta oa 4.1.3) kapa Npcap (e lekoa ka liphetolelo tsa 1.60 le 1.30). Ka hona e batla laeborari ea wpcap.dll e kentsoeng ka matla ka tatellano e latelang (Hlokomela: ha ho na tšehetso ea Win10Pcap ea hajoale):
1. Nanolib.dll directory 2. Windows system directory SystemRoot%System32 3. Bukana ea ho kenya Npcap SystemRoot%System32Npcap 4. Tsela ea tikoloho
Sehlopha sena se emela sebopeho sa Profine DCP mme se na le mesebetsi e latelang ea litho tsa sechaba:

getScanTimeout () E tsebisa ka nako ya ho sekena ha sesebediswa (default = 2000 ms).
virtual uint32_t nlc::ProfinetDCP::getScanTimeout () const

setScanTimeout () E seta nako ya ho fela ha skena sa sesebediswa (default = 2000 ms).
virtual void nlc ::setScanTimeout (uint32_t timeoutMsec)

getResponseTimeout () E tsebisa ka nako ea karabo ea sesebelisoa bakeng sa ho seta, ho seta bocha le ho panya (kameho = 1000 ms).
virtual uint32_t nlc::ProfinetDCP::getResponseTimeout () const

setResponseTimeout () E tsebisa ka nako ea karabelo ea sesebelisoa bakeng sa ho seta, ho seta botjha le ho panya (default = 1000 ms).
virtual void nlc::ProfinetDCP::setResponseTimeout (uint32_t timeoutMsec)

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

42

8 Lihlopha / referense ea mesebetsi

isServiceAvailable ()
Sebedisa tshebetso ena ho lekola boteng ba tshebeletso ya Profinet DCP.
Ho nepahala ha adaptara ea marang-rang / ho fumaneha ha Windows: WinPcap / Npcap fumaneha Linux: CAP_NET_ADMIN / CAP_NET_RAW bokhoni
virtual ResultVoid nlc::ProfinetDCP::isServiceAvailable (consst BusHardwareId & busHardwareId)

Parameters BusHardwareId Returns true
bohata

ID ea Hardware ea tšebeletso ea Profine DCP ho hlahloba. Tšebeletso e teng. Ts'ebeletso ha e teng.

scanProfinetDevices () Sebelisa ts'ebetso ena ho hlahloba bese ea hardware bakeng sa boteng ba lisebelisoa tsa Profinet.
virtual ResultProfinetDevices scanProfinetDevices (const BusHardwareId & busHardwareId)

Parameters BusHardwareId Returns ResultProfinetDevices

E qolla fieldbus e 'ngoe le e 'ngoe e lokelang ho buloa. Hardware e butse.

setupProfinetDevice () E theha litlhophiso tse latelang tsa sesebelisoa:

Lebitso la sesebelisoa

Aterese ea IP

Mask oa marang-rang

Tsela ea kamehla

virtual ResultVoid nlc::setupProfinetDevice (consst BusHardwareId & busHardwareId, const ProfinetDevice struct & profinetDevice, bool savePermanent)

resetProfinetDevice () E emisa sesebelisoa ebe e se hlophisa bocha hore e be litlhophiso tsa feme.
virtual ResultVoid nlc::resetProfinetDevice (consst BusHardwareId & busHardwareId, const ProfinetDevice & profinetDevice)

blinkProfinetDevice () E laela sesebelisoa sa Profinet hore se qale ho panya LED ea eona ea Profinet.
virtual ResultVoid nlc::blinkProfinetDevice (consst BusHardwareId & busHardwareId, const ProfinetDevice &profinetDevice)

validateProfinetDeviceIp () Sebelisa ts'ebetso ena ho hlahloba aterese ea IP ea sesebelisoa.
virtual ResultVoid validateProfinetDeviceIp (const BusHardwareId &busHardwareId, const ProfinetDevice & profinetDevice)

Parameters BusHardwareId ProfinetDevice

E totobatsa ID ea hardware eo u lokelang ho e hlahloba. E hlakisa sesebelisoa sa Profinet ho netefatsa.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

43

8 Lihlopha / referense ea mesebetsi

E khutlisa ResultVoid

8.27 Sebopeho sa ProfinetDevice

Lintlha tsa sesebelisoa sa Profinet li na le lintlha tse latelang tsa sechaba:

std::string std::string std::array< uint8_t, 6 > uint32_t uint32_t uint32_t

deviceName deviceVendor macAddress ipAddress netMask defaultGateway

Aterese ea MAC e fanoe ka mokhoa o hlophisitsoeng ka mokhoa oa macAddress = {xx, xx, xx, xx, xx, xx}; athe aterese ea IP, mask a marang-rang le heke kaofela li hlalosoa e le linomoro tse kholo tsa hex, joalo ka:

Aterese ea IP: 192.168.0.2 Mask ea netweke: 255.255.0.0 Gateway: 192.168.0.1

0xC0A80002 0xFFFF0000 0xC0A80001

8.28 Litlelase tsa sephetho

Sebelisa "boikhethelo" ba ho khutlisa litlelase tsena ho bona hore na mohala o atlehile kapa che, le ho fumana mabaka a hlolehileng. Ha u atleha, mosebetsi oa hasError () o khutlisa o le leshano. Ka getResult (), o ka bala boleng ba sephetho ho latela mofuta (ResultInt joalo-joalo). Haeba mohala o hloleha, o bala lebaka ka GetError ().

Litšobotsi tse sirelelitsoeng

khoele NlcErrorCode uint32_t

errorString errorCode exErrorCode

Hape, sehlopha sena se na le mesebetsi e latelang ea litho tsa sechaba:

hasError () E bala katleho ea mohala oa tšebetso.
bool nlc::Sephetho::hasError () const

E khutla

bohata ba nnete

Mohala o hlolehileng. Sebelisa getError () ho bala boleng. Mohala o atlehileng. Sebelisa getResult () ho bala boleng.

getError () E bala lebaka haeba mohala oa ts'ebetso o hloleha.
const std::string nlc::Sephetho::getError () const

E khutlisetsa const string

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

44

8 Lihlopha / referense ea mesebetsi
sephetho () Mesebetsi e latelang e thusa ho hlalosa sephetho hantle:
Sephetho (std::string const & errorString_)
Sephetho (NlcErrorCode const & errCode, std::string const & errorString_)
Sephetho (NlcErrorCode const & errCode, const uint32_t exErrCode, std::string const & errorString_)
Sephetho (Sephetho const & sephetho)
getErrorCode () Bala NlcErrorCode.
NlcErrorCode getErrorCode () const
getExErrorCode () uint32_t getExErrorCode () const
8.28.1 SephethoVoid
NanoLib e u romella mohlala oa sehlopha sena haeba ts'ebetso e khutla e se na letho. Sehlopha se rua mesebetsi ea sechaba le litšobotsi tse sirelelitsoeng ho tsoa sehlopheng sa sephetho mme se na le mesebetsi e latelang ea litho tsa sechaba:
ResultVoid () Mesebetsi e latelang e thusa ho hlalosa sephetho se nepahetseng:
ResultVoid (std::string const &errorString_)
ResultVoid (NlcErrorCode const & errCode, std::string const & errorString_)
ResultVoid (NlcErrorCode const & errCode, const uint32_t exErrCode, std:: string const & errorString_)
ResultVoid (Sephetho const & sephetho)
8.28.2 SephethoInt
NanoLib e u romella mohlala oa sehlopha sena haeba ts'ebetso e khutlisa palo e felletseng. Sehlopha se rua mesebetsi ea sechaba / litšobotsi tse sirelelitsoeng ho tsoa sehlopheng sa sephetho mme se na le mesebetsi e latelang ea litho tsa sechaba:
getResult () E khutlisa sephetho se felletseng haeba mohala oa tšebetso o atlehile.
int64_t getResult () const
E khutlisetsa int64_t

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

45

8 Lihlopha / referense ea mesebetsi
ResultInt () Mesebetsi e latelang e thusa ho hlalosa sephetho se felletseng:
SephethoInt (int64_t sephetho_)
ResultInt (std::string const & errorString_)
ResultInt (NlcErrorCode const & errCode, std::string const & errorString_)
ResultInt (NlcErrorCode const & errCode, const uint32_t exErrCode, std::string const & errorString_)
ResultInt (Sephetho const & sephetho)
8.28.3 ReultString
NanoLib e u romella mohlala oa sehlopha sena haeba ts'ebetso e khutlisa khoele. Sehlopha se rua mesebetsi ea sechaba / litšobotsi tse sirelelitsoeng ho tsoa sehlopheng sa sephetho mme se na le mesebetsi e latelang ea litho tsa sechaba:
getResult () E bala sephetho sa khoele haeba mohala oa ts'ebetso o atlehile.
const std::string nlc::ResultString::getResult () const
E khutlisetsa const string
ResultString () Mesebetsi e latelang e thusa ho hlalosa sephetho sa khoele hantle:
ResultString (std::string const & message, bool hasError_)
ResultString (NlcErrorCode const & errCode, std::string const & errorString_)
ResultString (NlcErrorCode const & errCode, const uint32_t exErrCode, std:: string const & errorString_)
ResultString (Sephetho const & sephetho)
8.28.4 SephethoArrayByte
NanoLib e u romella mohlala oa sehlopha sena haeba ts'ebetso e khutlisa lethathamo la li-byte. Sehlopha se rua mesebetsi ea sechaba / litšobotsi tse sirelelitsoeng ho tsoa sehlopheng sa sephetho mme se na le mesebetsi e latelang ea litho tsa sechaba:
getResult () E bala "byte vector" haeba mohala oa ts'ebetso o atlehile.
const std::vector nlc::ResultArrayByte::getResult () const
E khutlisetsa const vector

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

46

8 Lihlopha / referense ea mesebetsi
ResultArrayByte () Mesebetsi e latelang e thusa ho hlalosa sephetho se nepahetseng sa li-byte:
SephethoArrayByte (std::vector const & result_)
ResultArrayByte (std::string const & errorString_)
ResultArrayByte (NlcErrorCode const & errCode, std::string const & error String_)
ResultArrayByte (NlcErrorCode const & errCode, const uint32_t exErrCode, std:: string const & errorString_)
ResultArrayByte (Sephetho const & sephetho)
8.28.5 SephethoArrayInt
NanoLib e u romella mohlala oa sehlopha sena haeba ts'ebetso e khutlisa palo e felletseng. Sehlopha se rua mesebetsi ea sechaba / litšobotsi tse sirelelitsoeng ho tsoa sehlopheng sa sephetho mme se na le mesebetsi e latelang ea litho tsa sechaba:
getResult () E bala palo e kholo ea vector haeba mohala oa ts'ebetso o atlehile.
const std::vector nlc::ResultArrayInt::getResult () const
E khutlisetsa const vector
ResultArrayInt () Mesebetsi e latelang e thusa ho hlalosa sephetho se felletseng sa sehlopha:
ResultArrayInt (std::vector const & result_)
ResultArrayInt (std::string const & errorString_)
ResultArrayInt (NlcErrorCode const & errCode, std::string const & error String_)
ResultArrayInt (NlcErrorCode const & errCode, const uint32_t exErrCode, std:: string const & errorString_)
ResultArrayInt (Sephetho const & sephetho)
8.28.6 SephethoBusHwIds
NanoLib e u romella mohlala oa sehlopha sena haeba ts'ebetso e khutlisa lethathamo la ID ea libese. Sehlopha se rua mesebetsi ea sechaba / litšobotsi tse sirelelitsoeng ho tsoa sehlopheng sa sephetho mme se na le mesebetsi e latelang ea litho tsa sechaba:
getResult () E bala bus-hardware-ID vector haeba mohala oa ts'ebetso o atlehile.
const std::vector nlc::ResultBusHwIds::getResult () const
Liparamente li theha vector

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

47

8 Lihlopha / referense ea mesebetsi
ResultBusHwIds () Mesebetsi e latelang e thusa ho hlalosa hantle sephetho sa bus-hardware-ID-array:
ResultBusHwIds (std::vector const & result_)
ResultBusHwIds (std::string const & errorString_)
ResultBusHwIds (NlcErrorCode const & errCode, std::string const & errorString_)
ResultBusHwIds (NlcErrorCode const & errCode, const uint32_t exErrCode, std::string const & errorString_)
ResultBusHwIds (Sephetho const & sephetho)
8.28.7 ResultDeviceId
NanoLib e u romella mohlala oa sehlopha sena haeba ts'ebetso e khutlisa ID ea sesebelisoa. Sehlopha se rua mesebetsi ea sechaba / litšobotsi tse sirelelitsoeng ho tsoa sehlopheng sa sephetho mme se na le mesebetsi e latelang ea litho tsa sechaba:
getResult () E bala vector ea ID ea sesebelisoa haeba mohala oa ts'ebetso o atlehile.
DeviceId nlc::ResultDeviceId::getResult () const
E khutlisetsa const vector
ResultDeviceId () Mesebetsi e latelang e thusa ho hlalosa sephetho se nepahetseng sa ID ea sesebelisoa:
ResultDeviceId (DeviceId const & result_)
ResultDeviceId (std::string const & errorString_)
ResultDeviceId (NlcErrorCode const & errCode, std::string const & errorString_)
ResultDeviceId (NlcErrorCode const & errCode, const uint32_t exErrCode, std::string errorString_)
ResultDeviceId (Sephetho le sephetho)
8.28.8 ResultDeviceIds
NanoLib e u romella mohlala oa sehlopha sena haeba ts'ebetso e khutlisa pokello ea ID ea sesebelisoa. Sehlopha se rua mesebetsi ea sechaba / litšobotsi tse sirelelitsoeng ho tsoa sehlopheng sa sephetho mme se na le mesebetsi e latelang ea litho tsa sechaba:
getResult () E khutlisa vector ea ID ea sesebelisoa haeba mohala oa ts'ebetso o atlehile.
DeviceId nlc::ResultDeviceIds::getResult () const
E khutlisetsa const vector

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

48

8 Lihlopha / referense ea mesebetsi
ResultDeviceIds () Mesebetsi e latelang e thusa ho hlalosa sephetho se nepahetseng hantle sa ID-array:
ResultDeviceIds (std::vector const & result_)
ResultDeviceIds (std::string const & errorString_)
ResultDeviceIds (NlcErrorCode const & errCode, std::string const & errorString_)
ResultDeviceIds (NlcErrorCode const & errCode, const uint32_t exErrCode, std::string const & errorString_)
ResultDeviceIds (Sephetho le sephetho)
8.28.9 ResultDeviceHandle
NanoLib e u romella mohlala oa sehlopha sena haeba ts'ebetso e khutlisa boleng ba sesebelisoa sa sesebelisoa. Sehlopha se rua mesebetsi ea sechaba / litšobotsi tse sirelelitsoeng ho tsoa sehlopheng sa sephetho mme se na le mesebetsi e latelang ea litho tsa sechaba:
getResult () E bala sesebelisoa sa sesebelisoa haeba mohala oa ts'ebetso o atlehile.
DeviceHandle nlc::ResultDeviceHandle::getResult () const
E khutlisetsa DeviceHandle
ResultDeviceHandle () Mesebetsi e latelang e thusa ho hlalosa sephetho se nepahetseng sa sesebelisoa:
ResultDeviceHandle (DeviceHandle const & result_)
ResultDeviceHandle (std::string const & errorString_)
ResultDeviceHandle (NlcErrorCode const & errCode, std::string const & errorString_)
ResultDeviceHandle (NlcErrorCode const & errCode, const uint32_t exErrCode, std::string const & errorString_)
ResultDeviceHandle (Sephetho const & sephetho)
8.28.10 SephethoObjectDictionary
NanoLib e u romella mohlala oa sehlopha sena haeba tšebetso e khutlisa litaba tsa bukantswe ya ntho. Sehlopha se rua mesebetsi ea sechaba / litšobotsi tse sirelelitsoeng ho tsoa sehlopheng sa sephetho mme se na le mesebetsi e latelang ea litho tsa sechaba:
getResult () E bala vector ea ID ea sesebelisoa haeba mohala oa ts'ebetso o atlehile.
const nlc::ObjectDictionary & nlc::ResultObjectDictionary::getResult () const

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

49

8 Lihlopha / referense ea mesebetsi

E khutla

const vector

ResultObjectDictionary () Mesebetsi e latelang e thusa ho hlalosa hantle sephetho sa bukantswe ya ntho:
ResultObjectDictionary (nlc::ObjectDictionary const & result_)

ResultObjectDictionary (std::string const & errorString_)

ResultObjectDictionary (NlcErrorCode const & errCode, std::string const & errorString_)

ResultObjectDictionary (NlcErrorCode const & errCode, const uint32_t exErrCode, std::string const & errorString_)

ResultObjectDictionary (Sephetho const & sephetho)

8.28.11 ResultConnectionState
NanoLib e u romella mohlala oa sehlopha sena haeba ts'ebetso e khutlisa leseli la boemo ba khokahano ea sesebelisoa. Sehlopha se rua mesebetsi ea sechaba / litšobotsi tse sirelelitsoeng ho tsoa sehlopheng sa sephetho mme se na le mesebetsi e latelang ea litho tsa sechaba:
getResult () E bala sesebelisoa sa sesebelisoa haeba mohala oa ts'ebetso o atlehile.
DeviceConnectionStateInfo nlc::ResultConnectionState::getResult () const

E khutlisa DeviceConnectionStateInfo e hokahantsoeng / e khaotsoe / e hokahane leBootloader

ResultConnectionState () Mesebetsi e latelang e thusa ho hlalosa hantle sephetho sa boemo ba khokahanyo:
ResultConnectionState (DeviceConnectionStateInfo const & result_)

ResultConnectionState (std::string const & errorString_)

ResultConnectionState (NlcErrorCode const & errCode, std::string const & errorString_)

ResultConnectionState (NlcErrorCode const & errCode, const uint32_t exErrCode, std::string const & errorString_)

ResultConnectionState (Sephetho sa const & sephetho)

8.28.12 ResultObjectEntry
NanoLib e u romella mohlala oa sehlopha sena haeba ts'ebetso e khutlisa keno ea ntho. Sehlopha se rua mesebetsi ea sechaba / litšobotsi tse sirelelitsoeng ho tsoa sehlopheng sa sephetho mme se na le mesebetsi e latelang ea litho tsa sechaba:

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

50

8 Lihlopha / referense ea mesebetsi
getResult () E khutlisa vector ea ID ea sesebelisoa haeba mohala oa ts'ebetso o atlehile.
nlc::ObjectEntry const& nlc::ResultObjectKeno::getResult () const
E khutlisa const ObjectEntry
ResultObjectEntry () Mesebetsi e latelang e thusa ho hlalosa sephetho se nepahetseng sa ho kenya ntho:
ResultObjectEntry (nlc::ObjectEntry const & result_)
ResultObjectEntry (std::string const & errorString_)
ResultObjectEntry (NlcErrorCode const & errCode, std::string const & errorString_)
ResultObjectEntry (NlcErrorCode const & errCode, const uint32_t exErrCode, std::string const & errorString_)
ResultObjectEntry (Sephetho le sephetho)
8.28.13 ResultObjectSubEntry
NanoLib e u romella mohlala oa sehlopha sena haeba ts'ebetso e khutlisa ntho e nyane e kentsoeng. Sehlopha se rua mesebetsi ea sechaba / litšobotsi tse sirelelitsoeng ho tsoa sehlopheng sa sephetho mme se na le mesebetsi e latelang ea litho tsa sechaba:
getResult () E khutlisa vector ea ID ea sesebelisoa haeba mohala oa ts'ebetso o atlehile.
nlc::ObjectSubEntry const & nlc::ResultObjectSubEntry::getResult () const
E khutlisa const ObjectSubEntry
ResultObjectSubEntry () Mesebetsi e latelang e thusa ho hlalosa hantle sephetho se kentsoeng ka tlase:
ResultObjectSubEntry (nlc::ObjectEntry const & result_)
ResultObjectSubEntry (std::string const & errorString_)
ResultObjectSubEntry (NlcErrorCode const & errCode, std::string const & errorString_)
ResultObjectSubEntry (NlcErrorCode const & errCode, const uint32_t exErrCode, std::string const & errorString_)
ResultObjectSubEntry (Result const & result)
8.28.14 ResultProfinetDevices
NanoLib e u romella mohlala oa sehlopha sena haeba ts'ebetso e khutlisa sesebelisoa sa Profinet. Sehlopha se rua mesebetsi ea sechaba / litšobotsi tse sirelelitsoeng ho tsoa sehlopheng sa sephetho mme se na le mesebetsi e latelang ea litho tsa sechaba:

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

51

8 Lihlopha / referense ea mesebetsi

getResult () E bala vector ea sesebelisoa sa Profinet haeba mohala oa ts'ebetso o atlehile.
const std::vector & getResult () const

ResultProfinetDevices () Mesebetsi e latelang e thusa ho hlalosa hantle lisebelisoa tsa Profinet.
ResultProfinetDevices (consst std::vector & profinetDevices)
ResultProfinetDevices (Const Result & result)
ResultProfinetDevices (consst std::string &errorText, NlcErrorCode errorCode = NlcErrorCode::GeneralError, uint32_t extendedErrorCode = 0)
8.28.15 LiphethoampleDataArray
NanoLib e u romella mohlala oa sehlopha sena haeba ts'ebetso e khutla e leample data array. Sehlopha se rua mesebetsi ea sechaba / litšobotsi tse sirelelitsoeng ho tsoa sehlopheng sa sephetho mme se na le mesebetsi e latelang ea litho tsa sechaba:
getResult () E bala lethathamo la data haeba mohala oa ts'ebetso o atlehile.
const std::vector <SampleData> & getResult () const

LiphethoSampleDataArray () Mesebetsi e latelang e thusa ho hlalosa lisebelisoa tse nepahetseng tsa Profine.
LiphethoSampleDataArray (const std::vector <SampleData> & dataArray)

LiphethoSampleDataArray (consst std::string &errorDesc, const NlcErrorCode errorCode = NlcErrorCode::GeneralError, const uint32_t extendedErrorCode = 0)

LiphethoSampleDataArray (consst ResultSampleDataArray & tse ling)

LiphethoSampleDataArray (Const Result & result)

8.28.16 LiphethoamplerState
NanoLib e u romella mohlala oa sehlopha sena haeba ts'ebetso e khutla e leampler state.Sehlopha sena se rua mesebetsi ea sechaba / litšobotsi tse sirelelitsoeng ho tsoa sehlopheng sa sephetho mme se na le mesebetsi e latelang ea litho tsa sechaba:

getResult () E bala sampler state vector haeba mohala oa ts'ebetso o atlehile.
SamplerState getResult () const

E khutlisetsa SamplerState>

Ha ea hlophisoa / E hlophisitsoe / E ikemiselitse / E matha / E phethiloe / E hlolehile / E hlakotsoe

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

52

8 Lihlopha / referense ea mesebetsi

LiphethoSamplerState () Mesebetsi e latelang e thusa ho hlalosa hantle sampler state.
LiphethoSamplerState (consst SamplerState state)

LiphethoSamplerState (consst std::string & errorDesc, const NlcErrorCode errorCode = NlcErrorCode::GeneralError, const uint32_t
extendedErrorCode = 0)

LiphethoSamplerState (consst ResultSamplerState & tse ling)

LiphethoSamplerState (Const Result & result)

8.29 NlcErrorCode

Haeba ho na le ho hong ho sa tsamaeeng hantle, litlelase tsa sephetho li tlaleha e 'ngoe ea likhoutu tsa liphoso tse thathamisitsoeng lenaneng lena.

Khoutu ea phoso Katleho KakaretsoError BusUnavailable CommunicationError ProtocolError
ODDoesHa e teng ODIHa e nepahale phihlello ODTypeMismatch Ts'ebetso e Khaotsoe Ha e Tšehetsoe Ts'ebetso e sa sebetseng
Likhang Tse Fosahetseng Mohloli o Hanetsoeng Ha o Fumane MohloliHa o fumanehe OutOfMemory TimeOutError

C: Sehlopha sa D: Tlhaloso R: Lebaka C: Ha ho letho. D: Ha ho phoso. R: Ts'ebetso e phethiloe ka katleho.
C: Ha ea hlalosoa. D: Phoso e sa hlalosoang. R: Ho hloleha ho sa lumellaneng le sehlopha se seng.
C: Bese. D: Bese ea Hardware ha e fumanehe. R: Bese ha e eo, e khaotsoe kapa e na le bothata.
C: Puisano. D: Puisano ha e tšepahale. R: Lintlha tse sa lebelloang, CRC e fosahetseng, liphoso tsa foreimi kapa tekano, joalo-joalo.
C: Protocol. D: Phoso ea protocol. R: Karabo ka mor'a khetho ea protocol e sa tšehetsoeng, tlaleho ea sesebelisoa e sa tšehetsoeng, phoso ho protocol (e re, SDO segment sync bit), joalo-joalo R: Karabo kapa tlaleho ea sesebelisoa ho protocol e sa tšehetsoeng (likhetho) kapa liphoso tsa protocol (re, SDO segment sync bit), joalo-joalo R: Protocol e sa tšehetsoeng (likhetho) kapa phoso ho protocol (re, SDO segment sync bit), joalo-joalo.
C: Bukantswe ya selo. D: Aterese ea OD ha e eo. R: Ha ho aterese e joalo bukeng ea mantsoe.
C: Bukantswe ya selo. D: Ho fihlella atereseng ea OD ha hoa nepahala. R: Leka ho ngola ho bala feela, kapa ho bala ho tsoa atereseng e ngotsoeng feela.
C: Bukantswe ya selo. D: Mofuta o fapaneng. R: Boleng ha bo fetoleloe ho mofuta o boletsoeng, ho re, molemong oa ho tšoara khoele joalo ka nomoro.
C: Kopo. D: Ts'ebetso e felisitsoe. R: Ts'ebetso e khaotsoe ka kopo ea kopo. E khutlisa feela ts'ebetsong e sitisoa ke ts'ebetso ea callback, ho re, ho tsoa ho scanning ea bese.
C: E tloaelehileng. D: Ts'ebetso ha e tšehetsoe. R: Ha ho tšehetso ea bese ea lisebelisoa / sesebelisoa.
C: E tloaelehileng. D: Ts'ebetso e fosahetse maemong a hajoale, kapa e fosahetse le khang ea hajoale. R: Teko ea ho hokahanya hape ho libese / lisebelisoa tse seng li hokahane. Teko ea ho khaolla tse seng li khaotsoe. Teko ea ts'ebetso ea bootloader ka mokhoa oa firmware kapa ka tsela e fapaneng.
C: E tloaelehileng. D: Khang ha e sebetse. R: Maikutlo a fosahetseng kapa syntax.
C: E tloaelehileng. D: Ho hana ho kena. R: Khaello ea litokelo kapa bokhoni ba ho etsa ts'ebetso e kopiloeng.
C: E tloaelehileng. D: Ntho e boletsoeng ha e fumanehe. R: Bese ea Hardware, protocol, sesebelisoa, aterese ea OD sesebelisoa, kapa file ha ea fumanoa.
C: E tloaelehileng. D: Ntho e boletsoeng ha e fumanehe. R: e phathahane, ha e eo, e kgaohile kapa e na le sekodi.
C: E tloaelehileng. D: Mehopolo e sa lekaneng. R: Ho na le memori e nyane haholo ho sebetsa taelo ena.
C: E tloaelehileng. D: Ts'ebetso e felile. R: Khutla ka mor'a hore nako e felile. Nako ea ho felloa ke nako e ka ba nako ea karabelo ea sesebelisoa, nako ea ho fumana phihlello e arolelanoang kapa e ikhethileng ea lisebelisoa, kapa nako ea ho fetolela bese / sesebelisoa sebakeng se loketseng.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

53

8 Lihlopha / referense ea mesebetsi

8.30 NlcCallback
Sehlopha sena sa batsoali sa li-callback se na le mesebetsi e latelang ea setho: callback ()
ho letsetsa sephetho sa Virtual ()

E khutla

SephethoVoid

8.31 NlcDataTransferCallback
Sebelisa sehlopha sena sa mehala bakeng sa phetisetso ea data (apdeite ea firmware, upload ea NanoJ joalo-joalo). 1. Bakeng sa ho kenya firmware: Hlalosa "co-class" e atolosang ena ka mokhoa o tloaelehileng oa ho khutlela morao
phethahatso. 2. Sebelisa maemo a "co-class" ho mehala ea NanoLibAccessor.uploadFirmware (). Sehlopha se seholo ka bosona se na le mosebetsi o latelang oa setho sa sechaba:

callback () virtual ResultVoid callback (nlc::DataTransferInfo info, int32_t data)

E khutla

SephethoVoid

8.32 NlcScanBusCallback
Sebelisa sehlopha sena sa ho khutlela morao ho hlahloba libese. 1. Hlalosa "co-class" e atolosang ena ka mokhoa oa tloaelo oa ho khutlisa. 2. Sebelisa maemo a "co-class" ho mehala ea NanoLibAccessor.scanDevices (). Sehlopha se seholo ka boeona se na le mosebetsi o latelang oa setho sa sechaba.

letsa hape ()
virtual ResultVoid callback (nlc::BusScanInfo info, std::vector const & devicesFound, int32_t data)

E khutlisa ResultVoid
8.33 NlcLoggingCallback
Sebelisa sehlopha sena sa li-callback bakeng sa ho rema li-callback. 1. Hlalosa sehlopha se atolosang sehlopha sena ka mokhoa oa tloaelo oa ho letsa 2. Sebelisa pointer ho maemo a eona ho etsa callback ka NanoLibAccessor >
setLoggingCallback (…).
ho kgutlela morao ha nnete (consst std::string & payload_str, const std::string & formatted_str, const std::string & logger_name, const unsigned int log_level, const std::uint64_t time_since_epoch, const size_t thread_id)

8.34 SamplerInterface
Sebelisa sehlopha sena ho lokisa, qala le ho emisa sampler, kapa ho fumana sampled data le lata e leampboemo ba ler kapa phoso ea ho qetela. Sehlopha se na le mesebetsi e latelang ea litho tsa sechaba.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

54

8 Lihlopha / referense ea mesebetsi

configure () Configures asampler.
virtual ResultVoid nlc::SamplerInterface :: lokisa (consst DeviceHandle deviceHandle, const SamplerConfiguration & samplerConfiguration)

Mekhahlelo [ka] deviceHandle [in] samplerConfiguration
E khutlisa ResultVoid

E hlalosa hore na ke sesebelisoa sefe se lokelang ho hlophisoa sampler bakeng sa. E totobatsa boleng ba litšoaneleho tsa tlhophiso. E netefatsa hore void function e felile.

getData () E fumana sampya data se ile sa etsa.
virtual LiphethoampleDataArray nlc::SamplerInterface ::getData (const DeviceHandle deviceHandle)

Liparamente [ka] deviceHandle Returns ResultSampleDataArray

E hlalosa hore na data e fumaneha bakeng sa sesebelisoa sefe.
E fana ka sampled data, e ka bang lethathamo le se nang letho haeba sampLerNotify e sebetsa ha e qala.

getLastError () Gets asampphoso ea ho qetela ea ler.
virtual ResultVoid nlc::SamplerInterface ::getLastError (consst DeviceHandle deviceHandle)

E khutlisa ResultVoid

E netefatsa hore void function e felile.

getState () Fumana joalo kaampboemo ba ler.
virtual LiphethoamplerState nlc::SamplerInterface ::getState (consst DeviceHandle deviceHandle)

E khutlisa LiphethoamplerState

E fana ka sampler state.

qala () E qala joalo kaampler.
virtual ResultVoid nlc::SamplerInterface :: qala (consst DeviceHandle deviceHandle, SamplerNotify* samplerNotify, int64_t applicationData)

Liparamente [in] deviceHandle [in] SamplerNotify [in] applicationData
E khutlisa ResultVoid

E hlalosa hore na ke sesebelisoa sefe se lokelang ho qala sampler bakeng sa.
E totobatsa lintlha tsa boikhethelo tseo u ka li tlalehang (e ka ba nullptr).
Khetho: Ho fetisetsa data e amanang le ts'ebeliso (e hlalositsoeng ke 8-bit ea boleng / ID / index ea sesebelisoa, kapa nako ea letsatsi, sesupa sa phetoho / ts'ebetso, joalo-joalo) ho s.amplerNotify.
E netefatsa hore void function e felile.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

55

8 Lihlopha / referense ea mesebetsi

emisa () Ema joalo kaampler.
virtual ResultVoid nlc::SamplerInterface :: emisa (const DeviceHandle deviceHandle)

Liparamente [ka] deviceHandle Returns ResultVoid

E hlalosa hore na ke sesebelisoa sefe sa ho emisa sampler bakeng sa. E netefatsa hore void function e felile.

8.35 SamplerConfiguration sebopeho

Sebopeho sena se na le data samplikhetho tsa tlhophiso ea ler (e tsitsitseng kapa che).

Litšobotsi tsa sechaba

std::vector TrackedAdresses

Ho fihla ho 12 liaterese tsa OD ho ba sampLED.

uint32_t

phetolelo

Phetolelo ea sebopeho.

uint32_t

durationMilliseconds

Sampnako e telele ho ms, ho tloha ho 1 ho isa ho 65535

uint16_t

nakoMilliseconds

Sampnako e telele ho ms.

uint16_t

nomoroOfSamples

Sampchelete e fokolang.

uint16_t

preTriggerNumberOfSamples

Sampchelete e fokolang pele ho qala.

bool

sebelisaSoftwareImplementation

Sebelisa lisebelisoa tsa software.

bool

sebelisaNewFWSamplerKenyeletso Sebelisa ts'ebetsong ea FW bakeng sa lisebelisoa tse nang le

Mofuta oa FW v24xx kapa o mocha.

SamplerMode

mokgoa

E tloaelehileng, e pheta-phetoang kapa e tsoelang pele sampling.

SamplerTriggerCondition triggerCondition

Maemo a ho qala: TC_FALSE = 0x00 TC_TRUE = 0x01 TC_SET = 0x10 TC_CLEAR = 0x11 TC_RISING_EDGE = 0x12 TC_FALLING_EDGE = 0x13 TC_BIT_TOGGLE = 0x14 = 0x15 TC_GREATER_OR_EQUAL = 0x16 TC_LESS = 0x17 TC_LESS_OR_EQUAL = 0x18 TC_EQUAL = 0x19 TC_NOT_EQUAL = 0x1A TC_ONE_EDGE = 0x1B TC_MULTIx0Cree,Olti_EDGE

SamplerTrigger

SamplerTrigger

Leqhubu la ho qala joalo kaampler?

Litšobotsi tse tsitsitseng tsa sechaba
static constexpr size_t SAMPLER_CONFIGURATION_VERSION = 0x01000000 static constexpr size_t MAX_TRACKED_ADDRESSES = 12
8.36 SamplerNotify
Sebelisa sehlopha sena ho kenya tshebetsong sampler litsebiso ha u qala e leampler. Sehlopha se na le mosebetsi o latelang oa setho sa sechaba.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

56

8 Lihlopha / referense ea mesebetsi

tsebisa ()
E fana ka tsebiso.
virtual void nlc::SamplerNotify:: tsebisa (consst ResultVoid & lastError, const SamplerState samplerState, const std::vector <SampleData> & sampleDatas, int64_t applicationData)

Liparamente [ka] lastError [ka] samplerState
[ka] sampleDatas [in] applicationData

E tlaleha phoso ea ho qetela e etsahetseng ha sampling. E tlaleha sampboemo ba ler ka nako ea tsebiso: Ha ea hlophisoa / E lokisitsoe / E Lokisitsoe / E matha / E phethiloe / E hlolehile / E hlakotsoe. E tlaleha sampled-data array. E tlaleha data e ikhethileng ea ts'ebeliso.

8.37 Sampsebopeho sa leData

Sebopeho sena se na le sampya data se ile sa etsa.

uin64_t iterationNumber

E qala ho 0 mme e eketseha feela ka mokhoa oa ho pheta-pheta.

std::vector<SampledValues> E na le sehlopha sa samplitekanyetso tse etelletsoeng pele.

8.38 SampledValue sebopeho

Sebopeho sena se na le samplitekanyetso tse etelletsoeng pele.

in64_t bohlokoa uin64_t CollectTimeMsec

E na le boleng ba aterese ea OD e lateloang.
E na le nako ea pokello ka milliseconds, mabapi le sample qala.

8.39 SamplerTrigger sebopeho

Sebopeho sena se na le litlhophiso tsa trigger ea sampler.

Sampboemo ba lerTriggerCondition
OdIndex uin32_t boleng

Boemo ba ho qhomisa:TC_FALSE = 0x00 TC_TRUE = 0x01 TC_SET = 0x10 TC_CLEAR = 0x11 TC_RISING_EDGE = 0x12 TC_FALLING_EDGE = 0x13 TC_BIT_TOGGLE = 0xG14 TC_0 TC_15TER TC_GREATER_OR_EQUAL = 0x16 TC_LESS = 0x17 TC_LESS_OR_EQUAL = 0x18 TC_EQUAL = 0x19 TC_NOT_EQUAL = 0x1A TC_ONE_EDGE = 0x1B TC_MULTI_EDGE = 0x1B TC_MULTI_EDGE =
OdIndex ea trigger (aterese).
Boleng ba boemo kapa nomoro ea bonyenyane (ho qala ho bit zero).

8.40 Sebopeho sa serial

Fumana mona likhetho tsa hau tsa morao-rao tsa puisano le litšobotsi tse latelang tsa sechaba:

const std :: khoele const SerialBaudRate

BAUD_RATE_OPTIONS_NAME = "serial baud rate" baudRate =SerialBaudRate struct

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

57

8 Lihlopha / referense ea mesebetsi

const std :: khoele const SerialParity

PARITY_OPTIONS_NAME = "serial parity" parity = SerialParity struct

8.41 SerialBaudRate sebopeho

Fumana mona sekhahla sa hau sa marang-rang sa baud le litšobotsi tse latelang tsa sechaba:

const std ::khoele const std :: khoele const std :: khoele const std :: khoele const std :: khoele const std :: khoele const std :: khoele const std : :

BAUD_RATE_7200 = “7200” BAUD_RATE_9600 = “9600” BAUD_RATE_14400 = “14400” BAUD_RATE_19200 = “19200” BAUD_RATE_38400 = “38400” BAUD_56000 BAUD_56000 =57600 BAUD_57600 115200” BAUD_RATE_115200 = “128000” BAUD_RATE_128000 = “256000” BAUD_RATE_256000 = “XNUMX”

8.42 Sebopeho sa SerialParity

Fumana mona likhetho tsa hau tsa serial parity le litšobotsi tse latelang tsa sechaba:

const std :: khoele const std :: khoele const std :: khoele const std :: khoele const std :: khoele

NONE = “none” ODD = “odd” EVEN = “esita le” TŠOAO = “tšoaea” SEBAKA = “sebaka”

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

58

9 Lilaesense

9 Lilaesense

Lihlooho tsa sebopeho sa NanoLib API le mohlalaample khoutu ea mohloli li na le tumello ea Nanotec Electronic GmbH & Co. KG tlas'a Creative Commons Attribution 3.0 Unported License (CC BY). Likarolo tsa laebrari tse fanoeng ka mokhoa oa binary (lilaebrari tsa puisano tsa mantlha le tsa fieldbus) li na le tumello tlas'a Creative Commons AttributionNoDerivatives 4.0 International License (CC BY ND).

Creative Commons
Kakaretso e latelang e ka baloang ke motho e ke ke ea nka sebaka sa(li)laesense ka boyona. U ka fumana laesense e amehang ho creativecommons.org mme e hokahane ka tlase. U lokolohile ho:

CC BY 3.0
Kabelo: Bona hantle. Adapt: ​​Remix, fetola, 'me u hahe holim'a
thepa bakeng sa morero ofe kapa ofe, esita le oa khoebo.

CC BY-ND 4.0
Arolelana: Kopitsa le ho aba litaba bocha ka mokhoa ofe kapa ofe.

Mofani oa laesense a ke ke a hlakola litokoloho tse kaholimo ha feela o mamela lipehelo tse latelang tsa laesense:

CC BY 3.0

CC BY-ND 4.0

Attribution: U tlameha ho fana ka mokitlane o loketseng, Attribution: Sheba ka ho le letšehali. Empa: Fana ka sehokelo ho sena

fana ka sehokelo sa laesense, 'me u bontše hore na

laesense e nngwe.

ho ile ha etsoa liphetoho. U ka etsa joalo ka eng kapa eng

Ha ho na lintho tse tsoang ho tsona: Haeba u kopanya, fetola, kapa u haha

mokhoa o utloahalang, empa eseng ka tsela efe kapa efe e fanang ka maikutlo

holim'a boitsebiso boo, u ka 'na ua se ke ua aba

e fana ka tumello ea hore mofani oa laesense a u lumelle kapa tšebeliso ea hau.

thepa e fetotsoeng.

Ha ho lithibelo tse ling: U kanna oa se sebelise Ha ho lithibelo tse ling: Sheba ka ho le letšehali. dipehelo tsa molao kapa mehato ya thekenoloji eo ka molao

thibela ba bang ho etsa eng kapa eng eo laesense

ditumello.

Tlhokomeliso: Ha ua tlameha ho ikamahanya le laesense bakeng sa likarolo tsa thepa sebakeng sa sechaba kapa moo ts'ebeliso ea hau e lumelletsoeng ke mokhelo kapa lithibelo tse amehang.
Tlhokomeliso: Ha ho liwaranti tse fanoeng. Laesense e kanna ea se u fe litumello tsohle tse hlokahalang bakeng sa ts'ebeliso eo u e rerileng. Bakeng sa mohlalaample, litokelo tse ling tse kang phatlalatso, lekunutu, kapa litokelo tsa boitšoaro li ka fokotsa tsela eo u sebelisang boitsebiso boo ka eona.

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

59

Khatiso, mabitso, mefuta

©2024 Nanotec Electronic GmbH & Co.KGKapellenstr.685622 FeldkirchenGermanyTel.+49(0) 89 900 686-0Fax+49(0)89 900 686-50 info@nanotec.dewww.nanotec.com Litokelo tsohle li sirelelitsoe. Phoso, ho se phethise, ho fetoha ha tekheniki kapa litaba ho khoneha ntle le tsebiso. Li-brand/lihlahisoa tse qotsitsoeng ke matšoao a beng ba tsona 'me li lokela ho tšoaroa joalo. Phetolelo ea pele.

Tokomane 1.4.2 2024.12 1.4.1 2024.10 1.4.0 2024.09 1.3.3 2024.07
1.3.2 2024.05 1.3.1 2024.04 1.3.0 2024.02
1.2.2 2022.09 1.2.1 2022.08 1.2.0 2022.08

+ E kentsoe> E Fetotsoe # E tsitsitse> Sebetsa hape ea ex e fanoengamples.
+ NanoLib Modbus: Mochini o ekelitsoeng oa ho notlela sesebelisoa bakeng sa Modbus VCP. # NanoLib Core: Cheko ea boemo bo tsitsitseng ba khokahano. Khoutu ea # NanoLib: Ho tlosoa ha litšupiso tsa lisebelisoa tsa libese.
+ NanoLib-CANopen: Tšehetso ea Peak PCAN-USB adaptara (IPEH-002021/002022).
> NanoLib Core: Sebopeho se fetotsoeng sa ho rema lifate (LogLevel e nkeloe sebaka ke LogModule). # NanoLib Logger: Karohano lipakeng tsa mantlha le li-module e lokisitsoe. # Modbus TCP: Nchafatso e tsitsitseng ea firmware bakeng sa FW4. # EtherCAT: Lenaneo le tsitsitseng la NanoJ bakeng sa Core5. # EtherCAT: Nchafatso ea firmware e tsitsitseng bakeng sa Core5.
# Modbus RTU: Litaba tse tsitsitseng tsa nako ka litheko tse tlase tsa baud nakong ea ntlafatso ea firmware. # RESTful: Kenya lenaneo le tsitsitseng la NanoJ.
# NanoLib Modules Sampler: Ho bala ka nepo sampe etelletseng pele boleng ba boolean.
+ Tšehetso ea Java 11 bakeng sa li-platform tsohle. + Python 3.11 / 3.12 tšehetso bakeng sa li-platform tsohle. + Sebopeho se secha sa ho rema lifate (sheba mohlalaamplets). + Litanka tsa callback bakeng sa NanoLib Logger. > Nchafatsa logger ho mofuta oa 1.12.0. > NanoLib Modules Sampler: Tšehetso hona joale bakeng sa firmware ea Nanotec controller v24xx. > NanoLib Modules Sampler: Phetoho ea sebopeho se sebelisoang bakeng sa samptlhophiso ea ler. > NanoLib Modules Sampler: Mokhoa o tsoelang pele o tšoana le ho se fele; boemo ba trigger bo hlahlojoa hang; palo ea samptse ling li tlameha ho ba 0. > NanoLib Modules Sampler: Ntho ea pele e tloaelehileng bakeng sa khoele e bokellang data ka mokhoa oa firmware. > NanoLib Modules Sampler: Algorithm e ngotsoeng bocha ho bona phetoho lipakeng tsa boemo ba Ready & Running. # NanoLib Core: Ha ho sa na Tlolo ea Phihlelo (0xC0000005) ha u koala lisebelisoa tse 2 kapa ho feta u sebelisa lisebelisoa tse tšoanang tsa libese. # NanoLib Core: Ha ho sa na Phoso ea Karolo ea ho hokela adaptara ea PEAK tlasa Linux. # NanoLib Modules Sampler: Nepahetse sampho bala litekanyetso tsa led ka mokhoa oa firmware. # NanoLib Modules Sampler: Tlhophiso e nepahetseng ea 502X:04. # NanoLib Modules Sampler: Ho kopanya ho nepahetseng ha li-buffer le likanale. # NanoLib-Canopen: Keketseho ea nako ea CAN bakeng sa ho tiea le ho skena ka nepo ka li-baudrates tse tlase. # NanoLib-Modbus: Algorithm ea ho lemoha VCP bakeng sa lisebelisoa tse khethehileng (USB-DA-IO).
+ Tšehetso ea EtherCAT.
+ Hlokomela ka litlhophiso tsa projeke ea VS ho Lokisa projeke ea hau.
+ fumanaDeviceHardwareGroup (). + fumanaProfinetDCP (isServiceAvailable). + fumanaProfinetDCP (validateProfinetDeviceIp). + autoAssignObjectDictionary (). + fumanaXmlFileLebitso (). + const std:: khoele & xmlFilePath in addObjectDictionary (). + fumanaSamplerInterface ().

Sehlahisoa 1.3.0 1.2.1 1.2.0 1.1.3
1.1.2 1.1.1 1.1.0
1.0.1 (B349) 1.0.0 (B344) 1.0.0 (B341)

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

60

10 Hatisa, mabitso, mefuta

Tokomane
1.1.2 2022.03 1.1.1 2021.11 1.1.0 2021.06 1.0.1 2021.06 1.0.0 2021.05

+ E kentsoe> E Fetotse # E tsitsitseng + rebootDevice (). + Khoutu ea phoso ResourceUnailable for getDeviceBooloaderVersion (), ~VendorId (), ~HardwareVersion (), ~SerialNumber, le ~Uid. > firmwareUploadFromFile joale kenyaFirmwareFromFile (). > firmwareUpload () joale kenyaFirmware (). > bootloaderUploadFromFile () joale uploadBooloaderFromFile (). > bootloaderUpload () joale uploadBootloader (). > bootloaderFirmwareUploadFromFile () ho kenyaBootloaderFirmwareFromFile (). > bootloaderFirmwareUpload () joale uploadBooloaderFirmware (). > nanojUploadFromFile () joale kenyaNanoJFromFile (). > nanojUpload () joale uploadNanoJ (). > objectDictionaryLibrary () now getObjectDictionaryLibrary (). > String_String_Map hona joale StringStringMap. > NanoLib-Common: ts'ebetso e potlakileng ea lenaneAvailableBusHardware le openBusHardwareWithProtocol e nang le adaptara ea Ixxat. > NanoLib-CANopen: litlhophiso tsa kamehla tse sebelisitsoeng (1000k baudrate, Ixxat bese nomoro 0) haeba likhetho tsa lisebelisoa tsa libese li se na letho. > NanoLib-RESTful: tumello ea admin e felile bakeng sa puisano le li-bootloader tsa Ethernet tlasa Windows haeba npcap / winpcap driver e fumaneha. # NanoLib-CANopen: lisebelisoa tsa libese joale li bula ntle le ho senyeha ka likhetho tse se nang letho. # NanoLib-E Tloaelehileng: OpenBusHardwareWithProtocol () e se nang memori e lutlang hona joale.
+ Tšehetso ea Linux ARM64. + Polokelo ea boima ba USB / REST / Profine DCP tšehetso. + hlahlobaConnectionState (). + fumanaDeviceBooloaderVersion (). + ResultProfinetDevices. + NlcErrorCode (e nkeloe sebaka ke NanotecExceptions). + NanoLib Modbus: VCP / USB hub e kopantsoeng le USB. > Ho hlahlojoa ha Modbus TCP ho khutlisa liphetho. < Modbus TCP latency ea puisano e lula e le teng.
+ More ObjectEntryDataType (e rarahaneng le profile- itseng). + IOError e khutla haeba connectDevice () le scanDevices () e sa fumane letho. + Ke 100 ms feela ea nako ea nako ea CanOpen / Modbus.
+ Ts'ehetso ea Modbus (hammoho le USB Hub ka VCP). + Khaolo Ho iketsetsa projeke ea hau ea Linux. + ExtraHardwareSpecifier ho BusHardwareId (). + extraId_ le extraStringId_ ho DeviceId ().
+ behaBusState (). + fumanaDeviceBooloaderBuildId (). + fumanaDeviceFirmwareBuildId (). + fumanaDeviceHardwareVersion (). # Li-bugfixes.
Khatiso.

Sehlahisoa
0.8.0 0.7.1 0.7.0 0.5.1 0.5.1

Phetolelo: doc 1.4.2 / NanoLib 1.3.0

61

Litokomane / Lisebelisoa

Nanotic NanoLib C++ Programming [pdf] Bukana ea Mosebelisi
NanoLib C Programming, C Programming, Programming

Litšupiso

Tlohela maikutlo

Aterese ea hau ea lengolo-tsoibila e ke ke ea phatlalatsoa. Libaka tse hlokahalang li tšoailoe *