Nanotic-LOGO

Nanotic NanoLib C++ Papatonotanga

Nanotic-NanoLib-C++-Whakatakaro-HUNGA

Nga korero hua

Whakatakotoranga

  • Ingoa Hua: NanoLib
  • Papatonotanga Reo: C++
  • Putanga Hua: 1.3.0
  • Putanga Manual Kaiwhakamahi: 1.4.2

Ko te whare pukapuka NanoLib i hangaia mo te rorohiko whakahaere kaupapa mo nga kaiwhakahaere Nanotec. Ka whakaratohia he atanga kaiwhakamahi, nga mahi matua, me nga whare pukapuka korero hei whakahaere i te whanaketanga o nga tono whakahaere.

Nga Tohutohu Whakamahi Hua

  • I mua i to tiimata:
    • Me whakarite kia tutuki to punaha ki nga whakaritenga taputapu i tohua i roto i te pukapuka. Ko te hunga whakarongo mo tenei hua ko nga kaiwhakawhanake e titiro ana ki te hanga i nga punaha whakahaere mo nga kaiwhakahaere Nanotec.
  • Tīmatatanga:
    • Hei timata ki te whakamahi NanoLib, whai i enei mahi:
    • Me timata ma te kawemai i a NanoLib ki to kaupapa.
    • Whakaritehia o tautuhinga kaupapa ina hiahiatia.
    • Hangaia to kaupapa ki te whakauru i nga mahi NanoLib.
  • Waihanga Kaupapa:
    • Ka taea e koe te hanga kaupapa mo nga taiao Windows me Linux. A pee i nga tohutohu motuhake e whakaratohia ana i roto i te pukapuka mo ia turanga.
  • Karaehe / Mahi Tohutoro:
    • Tirohia te pukapuka a te kaiwhakamahi mo tetahi aratohu taipitopito mo nga karaehe me nga mahi e waatea ana i NanoLib mo te rorohiko whakahaere kaupapa.

FAQ

  • Q: He aha te kaupapa o NanoLib?
    • A: He whare pukapuka a NanoLib mo te rorohiko whakahaere kaupapa mo nga kaiwhakahaere Nanotec, e whakarato ana i nga mahi whakahirahira me nga kaha korero.
  • Q: Me pehea taku tiimata me NanoLib?
    • A: Me timata ma te kawemai i te NanoLib ki to kaupapa, te whirihora i nga tautuhinga kaupapa, me te hanga i to kaupapa ki te whakamahi i nga ahuatanga NanoLib.

“`

Pukapuka Kaiwhakamahi NanoLib
C++

Whai mana me te putanga hua 1.3.0

Putanga Pukapuka Kaiwhakamahi: 1.4.2

Te whainga tuhinga me nga tikanga

Ko tenei tuhinga e whakaatu ana i te tatūnga me te whakamahinga o te whare pukapuka NanoLib, kei roto hoki he tohutoro ki nga karaehe me nga mahi katoa mo te whakamaarama i a koe ake punaha whakahaere mo nga kaiwhakahaere Nanotec. Ka whakamahia e matou nga momo momotuhi e whai ake nei:
Ko nga kupu tararo he tohu tohutoro whakawhiti, honongaitua ranei.
Examp1: Mo nga tohutohu tika mo te NanoLibAccessor, tirohia te Tatūnga. Exampte 2: Tāutahia te taraiwa Ixxat me te hono i te urutau CAN-ki-USB. Ko te tikanga o te kupu tuhi: He mea whakaingoatia tenei, he ara tahua / mea, he ripa / file ingoa ranei (mehemea e tika ana) he korero reo ke.
Exampte 1: Tīpakohia File > Hou > Tuhinga Patea. Whakatuwherahia te ripa Utauta ka kowhiria te Korero. Exampte 2: Ka wehewehe tenei tuhinga i nga kaiwhakamahi (= Nutzer; usuario; utente; utilisateur; utente etc.) mai i:
– Kaiwhakamahi tuatoru (= Drittnutzer; tercero usuario; terceiro utente; tiers utilisateur; terzo utente etc.). – Kaiwhakamahi mutunga (= Endnutzer; utente finale; utente final; utilisateur final; utente finale etc.).
Ka tohuhia e te kaikawe nga poraka waehere, nga whakahau hotaka ranei. Examp1: Ma te Bash, karangahia te sudo make install ki te kape i nga taonga tiritahi; ka karanga ldconfig. Examp2: Whakamahia te mahi NanoLibAccessor e whai ake nei hei huri i te taumata takiuru i NanoLib:
// ***** C++ rereke *****
karekau te setLoggingLevel(Kaupae Takiuru);
Ko te kuputuhi maia e whakanui ana i nga kupu takitahi e tino hira ana. Ko etahi atu, ko nga tohu tangi taiapa e whakanui ana i te hiranga nui(!).
Exampte 1: Tiakina koe, etahi atu me o taputapu. Whaia a maatau korero mo te haumarutanga e tika ana mo nga hua Nanotec katoa.
Exampte 2: Mo to whakamarumaru ake, whaia hoki nga korero haumaru e pa ana ki tenei hua motuhake. Ko te kupumahi ki te paotahi te tikanga he paohia ma te kiore tuarua ki te whakatuwhera i te tahua horopaki etc.
Exampte 1: Pāwhiri tahi i runga i te file, tīpakohia te whakaingoa anō, ka whakaingoa anō i te file. Exampte 2: Hei tirotiro i nga taonga, pawhiria tahi i te file ka tohua nga Taonga.

Putanga: doc 1.4.2 / NanoLib 1.3.0

4

I mua i to tiimata

I mua i to tiimata ki te whakamahi i te NanoLib, me whakarite to PC me te whakamohio ki a koe mo te whakamahinga me nga herenga whare pukapuka.
2.1 Nga whakaritenga o te punaha me te taputapu

Nanotic-NanoLib-C++-Whakapapataka-FIG- (1)
NOTICE He kino te mahi mai i te mahi 32-bit, kua mutu ranei te punaha! Whakamahia, me te pupuri tonu, he punaha 64-bit. Kia mau ki nga whakakorenga OEM me nga ~ tohutohu.

Ko te NanoLib 1.3.0 e tautoko ana i nga hua Nanotec katoa me CANopen, Modbus RTU (he USB ano hoki i runga i te tauranga rorohiko mariko), Modbus TCP, EtherCat, me Profinet. Mo nga NanoLibs tawhito: Tirohia te changelog i te tohu. I to tupono noa: te whakamahi i nga punaha tuku iho. Tuhipoka: Whaia nga tohutohu OEM whaimana ki te tautuhi i te torohūtanga kia iti rawa mena ka raru koe i te wa e whakamahi ana koe i te urutau USB-a-FTDI.

Nga Whakaritenga (Me whakahau te punaha moka-64)
Windows 10, 11 ranei w/ Visual Studio 2019 putanga 16.8 i muri mai ranei me te Windows SDK 10.0.20348.0 (putanga 2104) i muri mai ranei
C++ redistributables 2017 teitei ake ranei CANopen: Ixxat VCI or PCAN taraiwa taketake (kwhiria) EtherCat module / Profinet DCP: Npcap or WinPcap RESTful module: Npcap, WinPcap, whakaaetanga kaiwhakahaere ranei ki
te whakawhitiwhiti korero me nga bootloaders Ethernet
Linux me te Ubuntu 20.04 LTS ki te 24 (x64 me te arm64 katoa)
Pane Kernel me te putea libpopt-dev Profinet DCP: CAP_NET_ADMIN me CAP_NET_RAW kaha-
hononga CANopen: Ixxat ECI taraiwa, Peak PCAN-USB urutau EtherCat: CAP_NET_ADMIN, CAP_NET_RAW me
Nga kaha CAP_SYS_NICE RESTful: CAP_NET_ADMIN te kaha ki te whakawhitiwhiti korero me te Eth-
ernet bootloaders (e taunaki ana hoki: CAP_NET_RAW)

Te reo, urutau pahi mara, taura
C++ GCC 7 teitei ake ranei (Linux)
EtherCAT: Itarangi taura VCP / USB hub: inaianei rite USB USB rokiroki papatipu: USB taura REST: Itarangi taura CANopen: Ixxat USB-ki-CAN V2; Na-
notec ZK-USB-CAN-1, Peak PCANUSB adapter Kaore he tautoko Ixxat mo Ubuntu i te ringa64
Modbus RTU: Nanotec ZK-USB-RS485-1, urutau rite ranei; Taura USB i runga i te tauranga rorohiko mariko (VCP)
Modbus TCP: taura Itarangi kia rite ki te papaarangi hua

2.2 Ko te whakamahi me te hunga whakarongo
Ko te NanoLib he whare pukapuka kaupapa me te waahanga rorohiko mo te whakahaere, me te whakawhitiwhiti korero me nga kaiwhakahaere Nanotec i roto i te whānuitanga o nga tono ahumahi me nga kaiwhakatakoto kaupapa mohio anake.
Na te mea kaore e taea e nga taputapu (PC) me te punaha whakahaere, kaore a NanoLib mo te whakamahi i nga tono e hiahia ana ki nga nekehanga maha-tuaka tukutahi, he maamaa ranei te waa.
Kaua rawa e taea e koe te whakauru i te NanoLib hei waahanga haumaru ki tetahi hua, punaha ranei. I runga i te tuku ki nga kaiwhakamahi mutunga, me taapiri e koe nga panui whakatupato me nga tohutohu mo te whakamahi haumaru me te mahi haumaru ki ia hua me tetahi waahanga hanga Nanotec. Me tuku tika nga panui whakatupato a Nanotec ki te kaiwhakamahi mutunga.
2.3 Te whānuitanga o te tuku me te whakamana
Ka tae mai a NanoLib hei *.zip kōpaki mai i ta maatau tango webpae mo EMEA / APAC, AMERIKA ranei. Pupurihia, wetewetehia to tango i mua i te tatūnga. Kei roto i te kete NanoLib:

Putanga: doc 1.4.2 / NanoLib 1.3.0

5

2 I mua i to tiimata

Pane atanga hei waehere puna (API)

Ko nga mahi matua hei whare pukapuka i roto i te whakatakotoranga rua: nano-

Whare Pukapuka e whakahaere ana i te whakawhitiwhiti korero: nanolibm_ lib.dll

[yourfieldbus].dll etc.

Exampte kaupapa: Example.sln (Whakaata Ataata

kaupapa) me example.cpp (matua file)

Mo te whānuitanga o te whakamana, tirohia a) a maatau tikanga me nga tikanga mo EMEA / APAC, AMERIKA ranei me b) nga tikanga raihana katoa. Tuhipoka: Kaore te Nanotec e tika mo te he, he kino ranei te kounga, te whakahaere, te whakauru, te mahi, te whakamahi me te tiaki i nga taputapu tuatoru! Mo te haumaru, whai tonu i nga tohutohu OEM whaimana.

Putanga: doc 1.4.2 / NanoLib 1.3.0

6

Ko te hoahoanga NanoLib

Ko te hanganga rorohiko a NanoLib ka taea e koe te whakarite i nga mahi motika motika / fieldbus huri noa i te matua kua oti te hanga. Kei a NanoLib nga waahanga e whai ake nei:

Atanga Kaiwhakamahi (API)

NanoLib matua

Atanga me nga karaehe kaiawhina e Wharepukapuka e

Whare Pukapuka Whakawhitiwhiti Ko nga whare pukapuka motuhake a Fieldbus

uru ki a koe ki te whakatinana a to kaiwhakahaere i te taumahinga API mahi atanga i waenga i te NanoLib

OD (papakupu ahanoa)

te taunekeneke me nga whare pukapuka pahi.

taputapu matua me te pahi.

i runga i te mahinga matua NanoLib-

tikanga.

3.1 Atanga Kaiwhakamahi

Ko te atanga kaiwhakamahi he atanga pane files ka taea e koe te whakamahi ki te uru ki nga tawhā kaiwhakahaere. Ko nga karaehe atanga kaiwhakamahi e whakaahuatia ana i roto i nga tohutoro Karaehe / mahi ka taea e koe:
Tūhono ki te pūmārō e rua (fieldbus whāurutau) me te pūrere pūmana. Uru ki te OD o te taputapu, ki te panui/tuhi i nga tawhā kaiwhakahaere.

3.2 NanoLib matua

Ko te matua NanoLib ka tae mai me te whare pukapuka kawemai nanolib.lib. Ka whakatinanahia te mahinga atanga kaiwhakamahi me te kawenga mo:
Te uta me te whakahaere i nga whare pukapuka korero. Te whakarato i nga mahi atanga kaiwhakamahi i roto i te NanoLibAccessor. Ko tenei waahi urunga korero ka wehe-
ka whaina he huinga mahi ka taea e koe te whakahaere i runga i te NanoLib matua me nga whare pukapuka korero.

3.3 Whare Pukapuka korero

I tua atu i te nanotec.services.nanolib.dll (he whai hua mo to Mono & Drive Studio whiriwhiri), ka tukuna e NanoLib nga whare pukapuka korero e whai ake nei:

nanolibm_canopen.dll nanolibm_modbus.dll

nanolibm_ethercat.dll nanolibm_restful-api.dll

nanolibm_usbmmsc.dll nanolibm_profinet.dll

Ka whakatakotohia e nga whare pukapuka katoa he paparanga tangohanga taputapu i waenga i te matua me te kaiwhakahaere. Ka utaina e te matua i te tiimatanga mai i te kōpaki kaupapa kua tohua me te whakamahi ki te whakarite korero ki te kaiwhakahaere ma te kawa e rite ana.

Putanga: doc 1.4.2 / NanoLib 1.3.0

7

Te timatanga

Pānuihia me pehea te whakarite NanoLib mo to punaha whakahaere me pehea te hono i nga taputapu ina hiahiatia.
4.1 Whakaritehia to punaha
I mua i te whakauru i nga taraiwa urutau, me whakarite to PC ki te taha o te punaha whakahaere. Hei whakarite i te PC ki te taha o to Windows OS, whakauruhia a MS Visual Studio me nga toronga C++. Hei whakauru i te hanga me te gcc na Linux Bash, waeahia te sudo apt install build-essentials. Whakahohehia nga kaha CAP_NET_ADMIN, CAP_NET_RAW, me CAP_SYS_NICE mo te tono e whakamahi ana i te NanoLib: 1. Karangatia sudo setcap 'cap_net_admin,cap_net_raw,cap_sys_nice+eip'
ingoa>. 2. Na anake, tāuta koutou atekōkiri whāurutau.
4.2 Tāutahia te taraiwa urutau Ixxat mo Windows
I muri noa i te whakaurunga o te taraiwa, ka taea e koe te whakamahi i te urutau USB-ki-CAN V2 a Ixxat. Pānuihia te pukapuka hua o nga puku USB, ki te ako mena / me pehea te whakahohe i te comport mariko (VCP). 1. Tikiake me te tāuta i te taraiwa VCI 4 a Ixxat mo Windows mai www.ixxat.com. 2. Honoa te USB-ki-CAN V2 whāurutau kiato a Ixxat ki te PC mā te USB. 3. Na te Kaiwhakahaere Pūrere: Tirohia mena kua whakauruhia/mohiotia te taraiwa me te urutau.
4.3 Tāutahia te atekōkiri pūurutau Peak mo Windows
I muri noa i te whakaurunga o te taraiwa, ka taea e koe te whakamahi i te urutau PCAN-USB a Peak. Pānuihia te pukapuka hua o nga puku USB, ki te ako mena / me pehea te whakahohe i te comport mariko (VCP). 1. Tikiake me te tāuta i te tatūnga atekōkiri pūrere Windows (= mōkihi tāutanga me ngā atekōkiri pūrere, taputapu, me
API) mai http://www.peak-system.com. 2. Tūhono te pūurutau PCAN-USB o Peak ki te PC mā te USB. 3. Na te Kaiwhakahaere Pūrere: Tirohia mena kua whakauruhia/mohiotia te taraiwa me te urutau.
4.4 Tāutahia te taraiwa urutau Ixxat mo Linux
I muri noa i te whakaurunga o te taraiwa, ka taea e koe te whakamahi i te urutau USB-ki-CAN V2 a Ixxat. Tuhipoka: Ko etahi atu taapiri tautoko e hiahia ana ki o whakaaetanga ma te sudo chmod +777/dev/ttyACM* (* nama taputapu). Pānuihia te pukapuka hua o nga puku USB, ki te ako mena / me pehea te whakahohe i te comport mariko (VCP). 1. Tāutahia te pūmanawa e hiahiatia ana mo te taraiwa ECI me te tono demo:
sudo apt-tiki whakahou apt-tiki tāuta libusb-1.0-0-dev libusb-0.1-4 libc6 libstdc++6 libgcc1 hangahanga
2. Tangohia te taraiwa ECI-for-Linux mai i www.ixxat.com. Wewetehia mā:
wetewetehia eci_driver_linux_amd64.zip
3. Tāutahia te taraiwa mā:
cd /EciLinux_amd/src/KernelModule sudo hanga tāuta-usb
4. Tirohia mo te whakaurunga taraiwa angitu ma te whakahiato me te tiimata i te tono demo:
cd /EciLinux_amd/src/EciDemos/ sudo hanga cd /EciLinux_amd/bin/release/ ./LinuxEciDemo

Putanga: doc 1.4.2 / NanoLib 1.3.0

8

4 Te timatanga
4.5 Tāutahia te taraiwa pūurutau Peak mo Linux
I muri noa i te whakaurunga o te taraiwa, ka taea e koe te whakamahi i te urutau PCAN-USB a Peak. Tuhipoka: Ko etahi atu taapiri tautoko e hiahia ana ki o whakaaetanga ma te sudo chmod +777/dev/ttyACM* (* nama taputapu). Pānuihia te pukapuka hua o nga puku USB, ki te ako mena / me pehea te whakahohe i te comport mariko (VCP). 1. Tirohia mēnā he pane kākano tō Linux: ls /usr/src/linux-headers-`uname -r`. Ki te kore, tāuta
ratou: sudo apt-get install linux-headers-`uname -r` 2. Inaianei anake, whakauruhia te paatete libpopt-dev: sudo apt-get install libpopt-dev 3. Tangohia te kete taraiwa e hiahiatia ana (peak-linux-driver-xxx.tar.gz) mai i www.peak-system.com. 4. Ki te wetewete, whakamahia: tar xzf peak-linux-driver-xxx.tar.gz 5. I roto i te kōpaki kua wetewetehia: Whakahiatohia me te whakauru i nga taraiwa, whare pukapuka turanga PCAN, me etahi atu: hanga katoa
sudo make install 6. Hei tirotiro i te mahi, mono te urutau PCAN-USB ki roto.
a) Tirohia te kōwae kernel:
lsmod | grep pcan b)… me te whare pukapuka tiritahi:
ls -l /usr/lib/libpcan*
Tuhipoka: Mena ka puta nga raru USB3, whakamahia he tauranga USB2.
4.6 Honoa to taputapu
Kia taea ai e koe te whakahaere kaupapa NanoLib, honoa he kaiwhakahaere Nanotec hototahi ki te PC ma te whakamahi i to urutau. 1. Ma te taura tika, honoa to urutau ki te kaiwhakahaere. 2. Honoa te urutau ki te PC kia rite ki te pepa raraunga urutau. 3. Whakawerahia te kaiwhakahaere ma te whakamahi i te hiko hiko tika. 4. Mena e hiahiatia ana, whakarereke i nga tautuhinga korero a te kaiwhakahaere Nanotec kia rite ki te tohutohu i roto i tana pukapuka hua.
4.7 Utaina NanoLib
Mo te tiimata tuatahi me nga kaupapa tere me te ngawari, ka taea e koe (engari kaua) te whakamahi i to maatau o muaampte kaupapa. 1. Kei runga i to rohe: Tikiake NanoLib mai i to maatau webpae mo EMEA / APAC, AMERIKA ranei. 2. Wewetehia te kete files / kōpaki me te whiriwhiri i tetahi waahanga: Mo nga kaupapa tere me te ngawari: Tirohia te Timata o muaampte kaupapa. Mo te whakaritenga matatau ki Windows: Tirohia te Waihanga i to ake kaupapa Windows. Mo te whakaritenga matatau ki Linux: Tirohia te Waihanga i to ake kaupapa Linux.

Putanga: doc 1.4.2 / NanoLib 1.3.0

9

Ka timata te exampte kaupapa

Na te NanoLib kua utaina tika, ko te exampKo te kaupapa e whakaatu ana ki a koe ma te whakamahi NanoLib me te kaiwhakahaere Nanotec. Tuhipoka: Mo ia taahiraa, korero i roto i te ex kua whakaratohiaampte waehere whakamarama nga mahi e whakamahia ana. Ko te exampKo te kaupapa ko: te `*_functions_example.*' files, kei roto nga whakatinanatanga mo te atanga NanoLib e mahi ana i te `*_callback_example.*' files, kei roto nga whakatinanatanga mo nga momo hokiwaea (matawai, raraunga me te
takiuru) te `menu_*.*' file, kei roto te arorau tahua me te waehere te Example.* file, koinei te kaupapa matua, te hanga i te tahua me te arawhiti i nga tawhā whakamahia katoa te Sampler_example.* file, kei roto te example whakatinanatanga mo sampte whakamahi. Ka kitea e koe etahi atu exampme etahi whakahau motini mo nga momo momo mahi, i roto i te Papa Matauranga i nanotec.com. Ka taea te whakamahi katoa ki Windows, Linux ranei.
I Windows me Visual Studio 1. Whakatuwherahia te Example.sln file. 2. Whakatuwheratia te example.cpp. 3. Whakahiato me te whakahaere i te example waehere.
I te Linux ma te Bash 1. Wewetehia te puna file, whakatere ki te kōpaki me nga ihirangi wetewete. Ko te matua file mo te exampko te
example.cpp. 2. I roto i te bash, karanga:
a. "sudo make install" ki te kape i nga taonga tiritahi me te karanga ldconfig. b. "whakamahia katoa" ki te hanga i te whakamatautau ka taea te whakahaere. 3. Kei roto i te kōpaki ipu he ex ka taea te whakahaereample file. Ma te bash: Haere ki te kōpaki putanga me te pato ./example. Mena karekau he hapa, kua tika te whakauru o o taonga tiritahi, kua reri to whare pukapuka mo te whakamahi. Mena ka panui te hapa ./example: hapa i te wa e utaina ana nga whare pukapuka tiritahi: libnanolib.so: kaore e taea te whakatuwhera i te ahanoa tiri file: Karekau he pera file whaiaronga ranei, i rahua te whakaurunga o nga taonga tiritahi. I tenei keehi, whai i nga mahi e whai ake nei. 4. Waihangatia he kōpaki hōu i roto i /usr/local/lib (he mana whakahaere e hiahiatia ana). Ki roto i te bash, tuhia:
sudo mkdir /usr/local/lib/nanotec
5. Tāruatia ngā taonga tiritahi katoa mai i te kōtui filekōpaki lib:
tāuta ./lib/*.so /usr/local/lib/nanotec/
6. Tirohia te ihirangi o te kōpaki ūnga me:
ls -al /usr/local/lib/nanotec/
Me whakarārangihia te ahanoa tiritahi files mai i te kōpaki lib. 7. Whakahaerehia te ldconfig ki tenei kōpaki:
sudo ldconfig /usr/local/lib/nanotec/
Ko te exampka whakatinanahia hei tono CLI me te whakarato i te atanga tahua. Ko nga taurunga tahua he horopaki i runga i te horopaki, ka whakahohehia, ka monoa ranei, i runga i te ahuatanga o te horopaki. Ka whakawhiwhia koe ki te kowhiri me te whakahaere i nga momo mahi whare pukapuka e whai ana i nga rerenga mahi mo te whakahaere i te kaiwhakahaere: 1. Tirohia te PC mo nga taputapu hono (whakauru) ka whakarārangihia. 2. Whakaritea he hononga ki tetahi urutau. 3. Matawaihia te pahi mo nga taputapu whakahaere hono. 4. Tūhono ki tētahi pūrere.

Putanga: doc 1.4.2 / NanoLib 1.3.0

10

5 Ka timata te exampte kaupapa
5. Whakamatauhia tetahi, neke atu ranei o nga mahi o te whare pukapuka: Panui/tuhi mai/ki te papakupu ahanoa a te kaiwhakahaere, whakahou i te firmware, tuku me te whakahaere i tetahi kaupapa NanoJ, kia rere te motuka me te whakatangi, whirihora me te whakamahi i te takiuru/sampler
6. Katia te hononga, tuatahi ki te taputapu, ka ki te urutau.

Putanga: doc 1.4.2 / NanoLib 1.3.0

11

Te hanga i to ake kaupapa Windows

Waihanga, whakahiato me te whakahaere i to ake kaupapa Windows hei whakamahi i te NanoLib.
6.1 Kawemai NanoLib
Kawemai te pane NanoLib files me nga whare pukapuka ma MS Visual Studio.
1. Whakatuwheratia te Studio Visual. 2. Ma te Waihanga kaupapa hou > Console App C++ > Panuku: Tīpakohia he momo kaupapa. 3. Whakaingoatia to kaupapa (i konei: NanolibTest) hei hanga i tetahi kōpaki kaupapa ki te Solution Explorer. 4. Tīpakohia Mutu. 5. Whakatuwheratia nga matapihi file kaihōpara me te whakatere ki te kōpaki kaupapa hou i hangaia. 6. Waihangahia nga kōpaki hou e rua, inc me te lib. 7. Whakatūwhera te kōpaki mōkihi NanoLib. 8. Mai i reira: Tāruatia te pane files mai i te kōpaki whakauru ki to kōpaki kaupapa inc me te .lib me te .dll katoa
files ki to kōpaki kaupapa hou lib. 9. Tirohia to kōpaki kaupapa mo te hanganga tika, hei tauiraample:

Nanotic-NanoLib-C++-Whakapapataka-FIG- (2)ect kōpaki mo te hanganga tika:
. 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.vcxproj NanolibTest.vcxproj.filters NanolibTest.vlibcxT NanolibTest.vlibcx
6.2 Whirihorahia to kaupapa
Whakamahia te Solution Explorer i MS Visual Studio ki te whakarite kaupapa NanoLib. Tuhipoka: Mo te mahi NanoLib tika, tohua te whirihoranga tuku (kaore i te patuiro!) i nga tautuhinga kaupapa Visual C++; katahi ka hanga me te hono i te kaupapa ki nga wa whakahaere VC o C++ redistributables [2022].
1. I roto i te Solution Explorer: Haere ki to kōpaki kaupapa (konei: NanolibTest). 2. Pāwhiri tahi i te kōpaki hei whakatuwhera i te tahua horopaki. 3. Tīpakohia Ngā Āhuatanga. 4. Whakahohehia nga whirihoranga Katoa me nga papaaho katoa. 5. Tīpakohia C/C++ ka haere ki Tāpiri Whaiaronga Whaiaronga. 6. Kōkuhu: $(ProjectDir)Nanolib/includes;%(AdditionalIncludeDirectories) 7. Tīpakohia te Kaihono ka haere ki nga Whaiaronga Whare Pukapuka Tāpiri. 8. Kōkuhu: $(ProjectDir)Nanolib;%(AdditionalLibraryDirectories) 9. Whakaroahia te Hononga ka kowhiri i te Whakauru. 10.Haere ki etahi atu Tiakitanga me te whakauru: nanolib.lib;%(AdditionalDependencies) 11.Whakaū ma te OK.

Putanga: doc 1.4.2 / NanoLib 1.3.0

12

6 Te hanga i to ake kaupapa Windows
12. Haere ki te Whirihoranga > C++ > Reo > Paerewa Reo > ISO C++17 Paerewa ka whakatakoto i te paerewa reo ki C++17 (/std:c++17).
6.3 Hangaia to kaupapa
Hanga to kaupapa NanoLib ki MS Visual Studio. 1. Whakatuwheratia te *.cpp matua file (i konei: nanolib_example.cpp) me te whakatika i te waehere, ki te hiahiatia. 2. Tīpakohia Hanga > Kaiwhakahaere Whirihoranga. 3. Hurihia nga turanga otinga Active ki te x64. 4. Whakau ma te Kati. 5. Tīpakohia Hanga > Hanga otinga. 6. Kaore he hapa? Tirohia mehemea kei te purongo tika to whakaputanga whakahiato:
1>—— Kua timata te horoi: Kaupapa: NanolibTest, Whirihoranga: Debug x64 —–========== Ma: 1 i angitu, 0 i rahua, 0 i peke ==========

Putanga: doc 1.4.2 / NanoLib 1.3.0

13

7 Te hanga i to ake kaupapa Linux
7 Te hanga i to ake kaupapa Linux
Waihanga, whakahiato me te whakahaere i to ake kaupapa Linux hei whakamahi i te NanoLib. 1. I roto i te kete whakaurunga NanoLib kua wetekina: Tuwhera /nanotec_nanolib. 2. Kimihia nga taonga tiritahi katoa i te tar.gz file. 3. Tīpakohia tetahi kōwhiringa: Tāutahia ia pukapuka me te Hangafile ma te ringaringa ranei.
7.1 Tāutahia ngā taonga tiritahi ki a Makefile
Whakamahia te Hangafile me te Linux Bash ki te whakauru-aunoa i nga taunoa katoa *.so files. 1. Via Bash: Haere ki te kōpaki kei roto te hangafile. 2. Tāruatia ngā ahanoa tiri mā:
sudo make install 3. Whakaū mā:
ldconfig
7.2 Whakauruhia nga taonga tiritahi ma te ringaringa
Whakamahia he Bash ki te whakauru katoa *.so files o NanoLib ā-ringa. 1. Ma te Bash: Waihangahia he kōpaki hōu ki roto /usr/local/lib. 2. Ka hiahiatia nga mana whakahaere! Momo:
sudo mkdir /usr/local/lib/nanotec 3. Hurihia ki te kōpaki mōkihi tāutanga kua wetekina. 4. Tāruahia ngā ahanoa tiri katoa mai i te kōpaki lib mā:
tāuta ./nanotec_nanolib/lib/*.so /usr/local/lib/nanotec/ 5. Tirohia te ihirangi o te kōpaki ūnga mā:
ls -al /usr/local/lib/nanotec/ 6. Tirohia mēnā kua whakarārangitia ngā taonga tiritahi katoa mai i te kōpaki lib. 7. Whakahaerehia te ldconfig ki tenei kōpaki ma te:
sudo ldconfig /usr/local/lib/nanotec/
7.3 Waihangahia to kaupapa
Me o taonga tiritahi kua whakauruhia: Waihangahia he kaupapa hou mo to Linux NanoLib. 1. Ma te Bash: Waihangahia he kōpaki kaupapa hou (i konei: NanoLibTest) mā:
mkdir NanoLibTest cd NanoLibTest
2. Tāruatia te pane files ki te kōpaki whakauru (i konei: inc) mā: mkdir inc cp / FILE IS>/nanotec_nanolib/inc/*.hpp inc
3. Waihangahia he matua file (NanoLibTest.cpp) mā: #include “accessor_factory.hpp” #include

Putanga: doc 1.4.2 / NanoLib 1.3.0

14

7 Te hanga i to ake kaupapa Linux
int matua(){nlc::NanoLibAccessor *whakauru = getNanoLibAccessor();
nlc::ResultBusHwIds hua = uru->listAvailableBusHardware();
if(hua.heHaError()) {std::cout << result.getError() << std::endl; }
atu{ std::cout << “Angitu” << std::endl; }
muku te uru; hoki 0; }
4. Tirohia to kōpaki kaupapa mo te hanganga tika:

Nanotic-NanoLib-C++-Whakapapataka-FIG- (3)
. NanoLibTest
inc accessor_factory.hpp bus_hardware_id.hpp … od_index.hpp result.hpp NanoLibTest.cpp
7.4 Whakahiato me te whakamatautau i to kaupapa
Whakaritehia to Linux NanoLib kia rite mo te whakamahi ma te Bash.
1. Via Bash: Whakahiatohia te matua file mā:
g++ -Wall -Wextra -pedantic -I./inc -c NanoLibTest.cpp -o NanoLibTest
2. Honoa te kaitakawaenga ma te:
g++ -Wall -Wextra -pedantic -I./inc -o whakamātautau NanoLibTest.o L/usr/local/lib/nanotec -lnanolib -ldl
3. Whakahaerehia te kaupapa whakamatautau ma te:
./whakamatautau
4. Tirohia mehemea kei te purongo to Bash:
angitu

Putanga: doc 1.4.2 / NanoLib 1.3.0

15

8 Tohutoro akomanga / mahi

8 Tohutoro akomanga / mahi

Kimihia i konei te rarangi o nga karaehe atanga kaiwhakamahi a NanoLib me o raatau mahi mema. Kei roto i te whakaahuatanga angamaheni o te mahi he whakataki poto, te whakamaramatanga mahi me te tawhā / rarangi whakahoki:

ExampleFunction () He korero poto ki a koe he aha te mahi a te mahi.
mariko kore nlc::NanoLibAccessor::ExampMahi (Param_a const & param_a, Param_b const & param_B)

Tawhā param_a param_b
Whakahoki ResultVoid

He korero taapiri mena ka hiahiatia. He korero taapiri mena ka hiahiatia.

8.1 NanoLibAccessor

Ko te karaehe atanga i whakamahia hei urunga ki te NanoLib. He penei te ahua o tetahi rerenga mahi:
1. Me timata ma te matawai mo nga taputapu me NanoLibAccessor.listAvailableBusHardware (). 2. Tautuhia nga tautuhinga whakawhiti korero me BusHardwareOptions (). 3. Whakatuwherahia te hononga taputapu me NanoLibAccessor.openBusHardwareWithProtocol (). 4. Matawai te pahi mo nga taputapu hono me te NanoLibAccessor.scanDevices (). 5. Tāpirihia he taputapu me te NanoLibAccessor.addDevice (). 6. Hono atu ki te taputapu me te NanoLibAccessor.connectDevice (). 7. Ka mutu te mahi, momotuhia te taputapu ki te NanoLibAccessor.disconnectDevice (). 8. Tangohia te taputapu me te NanoLibAccessor.removeDevice (). 9. Katia te hononga taputapu ki NanoLibAccessor.closeBusHardware ().
Kei a NanoLibAccessor nga mahi mema a te iwi e whai ake nei:

listAvailableBusHardware () Whakamahia tenei mahi ki te whakararangi i nga taputapu papaahi e waatea ana.
mariko ResultBusHwIds nlc::NanoLibAccessor::listAvailableBusHardware ()

Whakahoki ResultBusHwIds

Ka tukuna he rarangi ID paahi whenua.

openBusHardwareWithProtocol () Whakamahia tenei mahi hei hono i nga taputapu pahi.
mariko ResultVoid nlc::NanoLibAccessor::openBusHardwareWithProtocol (BusHardwareId const & busHwId, BusHardwareOptions const & busHwOpt)

Tawhā busHwId busHwOpt
Whakahoki ResultVoid

Ka whakapūtā te pahi mara hei whakatuwhera. Ka tohu i nga whiringa whakatuwhera i te pahi mara. Ka whakaū kua rere he mahi kore.

isBusHardwareOpen () Whakamahia tenei mahi ki te tirotiro mena kei te tuwhera to hononga taputapu marabus.
mariko ResultVoid nlc::NanoLibAccessor::openBusHardwareWithProtocol (const BusHardwareId & busHwId, const BusHardwareOptions & busHwOpt)

Putanga: doc 1.4.2 / NanoLib 1.3.0

16

8 Tohutoro akomanga / mahi

Tawhā BusHardwareId Ka hoki pono
teka

Ka tautuhia ia pahi mara hei whakatuwhera. Kei te tuwhera nga taputapu. Kua katia nga taputapu.

getProtocolSpecificAccessor () Whakamahia tenei mahi ki te tiki i te ahanoa whakauru kawa motuhake.
mariko ResultVoid nlc::NanoLibAccessor::getProtocolSpecificAccessor (BusHardwareId const & busHwId)

Tawhā busHwId Whakahoki HuaKaore

Ka whakapūtā te pahi āpure hei tiki i te kaiuru. Ka whakaū kua rere he mahi kore.

getProfinetDCP () Whakamahia tenei mahi hei whakahoki tohutoro ki te atanga Profinet DCP.
mariko ProfinetDCP & getProfinetDCP ()

Ka whakahoki mai a ProfinetDCP

whiwhiSamplerInterface () Whakamahia tenei mahi ki te tiki tohutoro ki te sampler atanga.
mariko SamplerAtanga & whiwhiSamplerAtanga ()

Ka hoki mai a SamplerAtanga

E tohu ana ki te sampte akomanga atanga.

setBusState () Whakamahia tenei mahi ki te tautuhi i te ahua o te kawa-pahi.
mariko ResultVoid nlc::NanoLibAccessor::setBusState (const BusHardwareId & busHwId, const std::string & state)

Tawhā busHwId āhua
Whakahoki ResultVoid

Ka whakapūtā te pahi mara hei whakatuwhera. Tautapahia te ahua o te pahi-motuhake hei uara aho. Ka whakaū kua rere he mahinga kore.

scanDevices () Whakamahia tenei mahi hei matawai mo nga taputapu kei te whatunga.
mariko ResultDeviceIds nlc::NanoLibAccessor::scanDevices (const BusHardwareId & busHwId, NlcScanBusCallback* waea hoki)

Tawhā busHwId waea hoki
Whakahoki ResultDeviceIds IOError

Ka tautuhi i te pahi mara hei matawai. NlcScanBusCallback te ahunga whakamua. Ka tukuna he huinga ID taputapu. He whakamohio kaore i kitea he taputapu.

Putanga: doc 1.4.2 / NanoLib 1.3.0

17

8 Tohutoro akomanga / mahi

tāpiriPūrere ()
Whakamahia tenei mahi ki te taapiri i tetahi taputapu pahi e whakaahuatia ana e te deviceId ki te rarangi taputapu o roto o NanoLib, me te whakahoki mai i te deviceHandle mo taua mea.
mariko ResultDeviceHandle nlc::NanoLibAccessor::addDevice (DeviceId const & deviceId)

Tawhā deviceId Whakahoki ResultDeviceHandle

Ka whakapūtā te pūrere hei tāpiri ki te rārangi. Ka tukuna he kakau taputapu.

connectDevice () Whakamahia tenei mahi hei hono i tetahi taputapu ma te deviceHandle.
mariko ResultVoid nlc::NanoLibAccessor::connectDevice (DeviceHandle const deviceHandle)

Tawhā deviceHandle Whakahoki ResultVoid
IOHapa

Ka tautuhi he aha te taputapu pahi e hono ana a NanoLib. Ka whakaū kua rere he mahinga kore. He whakamohio kaore i kitea he taputapu.

getDeviceName () Whakamahia tenei mahi hei tiki i te ingoa o tetahi taputapu ma te deviceHandle.
mariko ResultString nlc::NanoLibAccessor::getDeviceName (DeviceHandle const deviceHandle)

Tawhā deviceHandle Whakahoki ResultString

Ka whakapūtā he aha te taputapu pahi ka whiwhi a NanoLib i te ingoa. Ka tuku ingoa taputapu hei aho.

getDeviceProductCode () Whakamahia tenei mahi ki te tiki waehere hua o tetahi taputapu ma te deviceHandle.
mariko ResultInt nlc::NanoLibAccessor::getDeviceProductCode (DeviceHandle const deviceHandle)

Tawhā deviceHandle Returns ResultInt

Ka tautuhi he aha te taputapu pahi ka whiwhi a NanoLib i te waehere hua. Ka tukuna nga waehere hua hei tauoti.

getDeviceVendorId () Whakamahia tenei mahi hei tiki i te ID kaihoko taputapu ma te deviceHandle.
mariko ResultInt nlc::NanoLibAccessor::getDeviceVendorId (DeviceHandle const deviceHandle)

Tawhā deviceHandle Returns ResultInt
RauemiKoreWātea

Tautuhi he aha te taputapu pahi ka whiwhi a NanoLib i te ID kaihoko. Ka tukuna nga ID kaihoko hei tauoti. He whakamohio kaore he raraunga i kitea.

Putanga: doc 1.4.2 / NanoLib 1.3.0

18

8 Tohutoro akomanga / mahi

getDeviceId () Whakamahia tenei mahi ki te tiki ID o tetahi taputapu mai i te rarangi o roto NanoLib.
mariko ResultDeviceId nlc::NanoLibAccessor::getDeviceId (DeviceHandle const deviceHandle)

Tawhā deviceHandle Whakahoki ResultDeviceId

Ka tautuhi he aha te taputapu pahi ka whiwhi a NanoLib i te ID taputapu. Ka tukuna he ID taputapu.

getDeviceIds () Whakamahia tenei mahi ki te tiki ID taputapu katoa mai i te rarangi o roto o NanoLib.
mariko ResultDeviceIds nlc::NanoLibAccessor::getDeviceIds ()

Whakahoki Hua PūrereId

Ka tukuna he rarangi ID taputapu.

getDeviceUid () Whakamahia tenei mahi ki te tiki ID ahurei o tetahi taputapu (96 bit / 12 paita) ma te deviceHandle.
mariko ResultArrayByte nlc::NanoLibAccessor::getDeviceUid (DeviceHandle const deviceHandle)

Tawhā deviceHandle Whakahoki ResultArrayByte
RauemiKoreWātea

Ka tautuhi he aha te taputapu pahi ka whiwhi a NanoLib i te ID ahurei. Ka tuku TT ahurei hei huinga paita. He whakamohio kaore he raraunga i kitea.

getDeviceSerialNumber () Whakamahia tenei mahi ki te tiki tau rangatū o te taputapu ma te deviceHandle.
mariko ResultString NanolibAccessor::getDeviceSerialNumber (DeviceHandle const deviceHandle)

Tawhā deviceHandle Whakahoki ResultString
RauemiKoreWātea

Ka tautuhi he aha te taputapu pahi ka whiwhi a NanoLib i te tau rangatū. Ka tuku tau rangatū hei aho. He whakamohio kaore he raraunga i kitea.

getDeviceHardwareGroup () Whakamahia tenei mahi hei tiki i te roopu taputapu taputapu pahi ma te deviceHandle.
mariko ResultDeviceId nlc::NanoLibAccessor::getDeviceHardwareGroup (DeviceHandle const deviceHandle)

Tawhā deviceHandle Returns ResultInt

Ka tautuhi he aha te taputapu pahi ka whiwhi a NanoLib i te roopu taputapu.
Ka tuku i nga roopu taputapu hei tauoti.

getDeviceHardwareVersion () Whakamahia tenei mahi ki te tiki i te putanga taputapu o te taputapu pahi ma te deviceHandle.
mariko ResultDeviceId nlc::NanoLibAccessor::getDeviceHardwareVersion (DeviceHandle const deviceHandle)

Putanga: doc 1.4.2 / NanoLib 1.3.0

19

8 Tohutoro akomanga / mahi

Tawhā deviceHandle

Ka hoki mai

ResultString RauemiKoreWātea

Ka tautuhi he aha te taputapu pahi ka whiwhi a NanoLib i te putanga taputapu. Ka tuku ingoa taputapu hei aho. He whakamohio kaore he raraunga i kitea.

getDeviceFirmwareBuildId () Whakamahia tenei mahi ki te tiki i te ID hanga firmware o te taputapu pahi ma te deviceHandle.
mariko ResultDeviceId nlc::NanoLibAccessor::getDeviceFirmwareBuildId (DeviceHandle const deviceHandle)

Tawhā deviceHandle Whakahoki ResultString

Ka whakapūtā he aha te taputapu pahi ka whiwhi a NanoLib i te ID hanga maru.
Ka tuku ingoa taputapu hei aho.

getDeviceBootloaderVersion () Whakamahia tenei mahi ki te tiki i te putanga utauta o te taputapu pahi ma te deviceHandle.
mariko ResultInt nlc::NanoLibAccessor::getDeviceBootloaderVersion (DeviceHandle const deviceHandle)

Tawhā deviceHandle

Ka hoki mai

ResultInt ResourceKoreWātea

Ka whakapūtā he aha te taputapu pahi ka whiwhi a NanoLib i te putanga bootloader. Ka tukuna nga putanga bootloader hei tauoti. He whakamohio kaore he raraunga i kitea.

getDeviceBootloaderBuildId () Whakamahia tenei mahi ki te tiki i te ID hanga bootloader o te taputapu pahi ma te deviceHandle.
mariko ResultDeviceId nlc::NanoLibAccessor:: (DeviceHandle const deviceHandle)

Tawhā deviceHandle Whakahoki ResultString

Ka tohua he aha te taputapu pahi ka whiwhi a NanoLib i te ID hanga bootloader.
Ka tuku ingoa taputapu hei aho.

rebootDevice () Whakamahia tenei mahi hei whakaara ano i te taputapu ma te deviceHandle.
mariko ResultVoid nlc::NanoLibAccessor::rebootDevice (const DeviceHandle deviceHandle)

Tawhā deviceHandle Whakahoki ResultVoid

Ka whakapūtā te pahi āpure hei whakaara anō. Ka whakaū kua rere he mahinga kore.

getDeviceState () Whakamahia tenei mahi ki te tiki i te ahua o te taputapu-kawa-motuhake.
mariko ResultString nlc::NanoLibAccessor::getDeviceState (DeviceHandle const deviceHandle)

Tawhā deviceHandle

Ka tautuhia he aha te taputapu pahi ka riro i a NanoLib te kawanatanga.

Putanga: doc 1.4.2 / NanoLib 1.3.0

20

8 Tohutoro akomanga / mahi

Whakahoki ResultString

Ka tuku ingoa taputapu hei aho.

setDeviceState () Whakamahia tenei mahi ki te tautuhi i te ahua o te taputapu-kawa-motuhake.
mariko ResultVoid nlc::NanoLibAccessor::setDeviceState (const DeviceHandle deviceHandle, const std::string & state)

Tawhā deviceHandle āhua
Whakahoki ResultVoid

Ka whakapūtā he aha te taputapu pahi i tautuhia e NanoLib te ahua mo. Tautapahia te ahua o te pahi-motuhake hei uara aho. Ka whakaū kua rere he mahinga kore.

getConnectionState ()
Whakamahia tenei mahi ki te tiki i te ahua hononga whakamutunga o tetahi taputapu e mohiotia ana e te deviceHandle (= Momotu, Honoa, ConnectedBootloader)
mariko ResultConnectionState nlc::NanoLibAccessor::getConnectionState (DeviceHandle const deviceHandle)

Tawhā deviceHandle Whakahoki ResultConnectionState

Ka tautuhi he aha te taputapu pahi ka whiwhi a NanoLib i te ahua hononga.
Ka tukuna he ahua hononga (= Momotu, Honoa, ConnectedBootloader).

takinaConnectionState ()
Mena kaore i Momotuhia te ahua whakamutunga: Whakamahia tenei mahi ki te tirotiro me te whakahou pea i te ahuatanga hononga o tetahi taputapu ma te deviceHandle me te whakamatautau i etahi mahi motuhake.
mariko ResultConnectionState nlc::NanoLibAccessor::checkConnectionState (DeviceHandle const deviceHandle)

Tawhā deviceHandle Whakahoki ResultConnectionState

Ka tohua he aha te taputapu pahi ka tirohia e NanoLib te ahua hononga.
Ka tukuna he ahua hononga (= kaore i Momotu).

assignObjectDictionary () Whakamahia tenei mahi a-ringa hei tautapa i tetahi papakupu ahanoa (OD) ki te deviceHandle i a koe ake.
mariko ResultObjectDictionary nlc::NanoLibAccessor::assignObjectDictionary (DeviceHandle const deviceHandle, ObjectDictionary const & objectDictionary)

Tawhā deviceHandle objectDictionary
Whakahoki ResultObjectDictionary

Ka tautuhi he aha te taputapu pahi ka hoatu e NanoLib te OD. He whakaatu i nga ahuatanga o te papakupu ahanoa.

AutoAssignObjectDictionary ()
Whakamahia tenei mahi aunoa kia tukuna e NanoLib he papakupu ahanoa (OD) ki te deviceHandle. I te kimi me te uta i tetahi OD tika, ka tukuna aunoa e NanoLib ki te taputapu. Tuhipoka: Mena kua utaina he OD hototahi ki te whare pukapuka ahanoa, ka whakamahia aunoa e NanoLib me te kore e matawai i te whaiaronga kua tukuna.
mariko ResultObjectDictionary nlc::NanoLibAccessor::AutoAssignObjectDictionary (DeviceHandle const deviceHandle, const std::string & dictionariesLocationPath)

Putanga: doc 1.4.2 / NanoLib 1.3.0

21

8 Tohutoro akomanga / mahi

Tawhā deviceHandle

Ka hoki mai

papakupuLocationPath ResultObjectDictionary

Ka whakatauhia mo te aha te taputapu pahi ka matawai aunoa a NanoLib mo nga OD tika. Ka tautuhi i te ara ki te whaiaronga OD. He whakaatu i nga ahuatanga o te papakupu ahanoa.

getAssignedObjectDictionary ()
Whakamahia tenei mahi kia tautapahia te papakupu ahanoa ki tetahi taputapu ma te taputapuHandle.
mariko ResultObjectDictionary nlc::NanoLibAccessor::getAssignedObjectDictionary (DeviceHandle const device
Kakau)

Tawhā deviceHandle Whakahoki ResultObjectDictionary

Ka tohua he aha te taputapu pahi ka whiwhi a NanoLib i te OD kua whakaritea. He whakaatu i nga ahuatanga o te papakupu ahanoa.

getObjectDictionaryLibrary () Ka whakahokia e tenei mahi he tohutoro OdLibrary.
mariko OdLibrary& nlc::NanoLibAccessor::getObjectDictionaryLibrary ()

Whakahokia te OdLibrary&

Ka whakatuwhera i te whare pukapuka OD katoa me ona papakupu ahanoa.

setLoggingLevel () Whakamahia tenei mahi ki te tautuhi i nga korero mo te raarangi (me te raarangi file rahi). Ko te taumata taunoa he Info.
mariko kore nlc::NanoLibAccessor::setLoggingLevel (Kaupae Takiuru)

Taumata tawhā

Ka taea nga korero taipitopito e whai ake nei:

0 = Rapu 1 = Patuiro 2 = Nga korero 3 = Whakatupato 4 = Hapa 5 = Tino 6 = Weto

Te taumata iti rawa (raupapa nui file); ka tuhia nga korero e taea ana, me te tiimata / mutu te rorohiko. Rakau korero patuiro (= nga hua mo te wa poto, nga ihirangi kua tukuna, kua riro mai ranei, me etahi atu.) Te taumata taunoa; rangitaki karere korero. Ka tuhia nga raru i puta engari kaore e aukati i te algorithm o naianei. Rakau he raru nui ka mutu te algorithm. Te taumata teitei (raupapa iti file); ka whakaweto i te takiuru; karekau he takiuru atu. Karekau he takiuru.

setLoggingCallback ()
Whakamahia tenei mahi ki te tautuhi i te atatohu waea whakahoki takiuru me te kōwae rangitaki (= whare pukapuka) mo taua waea whakahoki (kaore ma te kaitautapa ake).
mariko kore nlc::NanoLibAccessor::setLoggingCallback (NlcLoggingCallback* waea hoki, const nlc::LogModule & LogModule)

Tawhā *waewae rangitakiModule

Ka tautuhi i te atatohu hokiwaea. Whakatangihia te waea whakahoki (kaore i te kairakau!) ki to whare pukapuka.

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

Whakahohe ai i te waea hoki mo te matua o NanoLib anake. Whakahohe ai i te hokiwaea CANopen-anake. Whakahohe ai i te hokiwaea Modbus-anake. Whakahohe ai i te hokiwaea EtherCAT-anake.

Putanga: doc 1.4.2 / NanoLib 1.3.0

22

8 Tohutoro akomanga / mahi

4 = NanolibRest 5 = NanolibUSB

Whakahohe ai i te hokiwaea REST-anake. Whakahohe ai i te hokiwaea USB-anake.

unsetLoggingCallback () Whakamahia tenei mahi ki te whakakore i tetahi tohu tohu waea.
mariko kore nlc::NanoLibAccessor::unsetLoggingCallback ()

readNumber () Whakamahia tenei mahi ki te panui i tetahi uara tau mai i te papakupu ahanoa.
mariko ResultInt nlc::NanoLibAccessor::readNumber (const DeviceHandle deviceHandle, const OdIndex odIndex)

Tawhā deviceHandle odIndex
Returns ResultInt

Ka tautuhia he aha te taputapu pahi ka panuihia e NanoLib. Ka tautuhi i te taupū (iti-) hei panui mai. Ka tukuna he uara tau kaore ano kia whakamaoritia (ka taea te haina, te hainatanga, whakatika uara moka16.16).

readNumberArray () Whakamahia tenei mahi ki te panui i nga huinga tau mai i te papakupu ahanoa.
mariko ResultArrayInt nlc::NanoLibAccessor::readNumberArray (Const DeviceHandle deviceHandle, const uint16_t taupū)

Taupū taputapuKawe
Whakahoki ResultArrayInt

Ka tautuhia he aha te taputapu pahi ka panuihia e NanoLib. Taupū ahanoa huānga. Ka tukuna he huinga tauoti.

readBytes () Whakamahia tenei mahi ki te panui i nga paita noho noa (raraunga ahanoa rohe) mai i te papakupu ahanoa.
mariko ResultArrayByte nlc::NanoLibAccessor::readBytes (const DeviceHandle deviceHandle, const OdIndex odIndex)

Tawhā deviceHandle odIndex
Whakahokia ResultArrayByte

Ka tautuhia he aha te taputapu pahi ka panuihia e NanoLib. Ka tautuhi i te taupū (iti-) hei panui mai. Ka tukuna he huinga paita.

readString () Whakamahia tenei mahi ki te panui aho mai i te whaiaronga ahanoa.
mariko ResultString nlc::NanoLibAccessor::readString (Const DeviceHandle deviceHandle, const OdIndex odIndex)

Tawhā deviceHandle odIndex
Whakahoki ResultString

Ka tautuhia he aha te taputapu pahi ka panuihia e NanoLib. Ka tautuhi i te taupū (iti-) hei panui mai. Ka tuku ingoa taputapu hei aho.

Putanga: doc 1.4.2 / NanoLib 1.3.0

23

8 Tohutoro akomanga / mahi

writeNumber () Whakamahia tenei mahi hei tuhi uara tau ki te whaiaronga ahanoa.
mariko ResultVoid nlc::NanoLibAccessor::writeNumber (const DeviceHandle deviceHandle, int64_t uara, const OdIndex odIndex, unsigned int bitLength)

Tawhā deviceHandle uara odIndex bitLength
Whakahoki ResultVoid

Ka tautuhi he aha te taputapu pahi ka tuhia e NanoLib. Ko te uara kaore i whakamaoritia (ka taea te haina, te haina, whakatika 16.16). Ka tautuhi i te taupū (iti-) hei panui mai. Te roa i roto i te moka. Ka whakaū kua rere he mahi kore.

writeBytes () Whakamahia tenei mahi ki te tuhi i nga paita noho noa (raraunga ahanoa rohe) ki te whaiaronga ahanoa.
mariko ResultVoid nlc::NanoLibAccessor::writeBytes (const DeviceHandle deviceHandle, const std::vector & raraunga, const OdIndex odIndex)

Tawhā deviceHandle raraunga odIndex
Whakahoki ResultVoid

Ka tautuhi he aha te taputapu pahi ka tuhia e NanoLib. Paita vector / huānga. Ka tautuhi i te taupū (iti-) hei panui mai. Ka whakaū kua rere he mahi kore.

uploadFimware ()
Whakamahia tenei mahi ki te whakahōu i tō mārō pūmana.
mariko ResultVoid nlc::NanoLibAccessor::uploadFirmware (Const DeviceHandle deviceHandle, const std::vector & fwData, NlcDataTransferCallback* waea hoki)

Tawhā deviceHandle fwData NlcDataTransferCallback
Whakahoki ResultVoid

Ka tautuhi he aha te taputapu pahi e whakahōuhia ana e NanoLib. Huanga kei roto nga raraunga firmware. He kaiwhakataki ahunga whakamua raraunga. Ka whakaū kua rere he mahi kore.

uploadFirmwareFromFile ()
Whakamahia tenei mahi ki te whakahōu i tō mārō pūmana mā te tukuake file.
mariko ResultVoid nlc::NanoLibAccessor::uploadFirmwareFromFile (Const DeviceHandle deviceHandle, const std:: aho & tinoFileAra, NlcDataTransferCallback* waea hoki)

Tawhā deviceHandle tinoFileAra NlcDataTransferCallback
Whakahoki ResultVoid

Ka tautuhi he aha te taputapu pahi whakahōu a NanoLib. Ara ki file kei roto nga raraunga firmware (std::string). He kaiwhakataki ahunga whakamua raraunga. Ka whakaū kua rere he mahinga kore.

Putanga: doc 1.4.2 / NanoLib 1.3.0

24

8 Tohutoro akomanga / mahi

uploadBootloader ()
Whakamahia tenei mahi ki te whakahōu i tō pūmau pūmau.
mariko ResultVoid nlc::NanoLibAccessor::uploadBootloader (const DeviceHandle deviceHandle, const std::vector & btRaraunga, NlcDataTransferCallback* waea hoki)

Tawhā deviceHandle btData NlcDataTransferCallback
Whakahoki ResultVoid

Ka tautuhi he aha te taputapu pahi e whakahōuhia ana e NanoLib. Huanga kei roto nga raraunga bootloader. He kaiwhakataki ahunga whakamua raraunga. Ka whakaū kua rere he mahi kore.

uploadBootloaderFromFile ()
Whakamahia tenei mahi ki te whakahōu i tō pūmau pūmau pūmau mā te tuku ake i tana file.
mariko ResultVoid nlc::NanoLibAccessor::uploadBootloaderFromFile (Const DeviceHandle deviceHandle, const std::string & bootloaderAbsoluteFileAra, NlcDataTransferCallback* waea hoki)

Tawhā deviceHandle bootloaderAbsoluteFileAra NlcDataTransferCallback
Whakahoki ResultVoid

Ka tautuhi he aha te taputapu pahi whakahōu a NanoLib. Ara ki file kei roto nga raraunga bootloader (std::string). He kaiwhakataki ahunga whakamua raraunga. Ka whakaū kua rere he mahinga kore.

uploadBootloaderFirmware ()
Whakamahia tenei mahi ki te whakahōu i tō pūmau pūmana me te mārō.
mariko ResultVoid nlc::NanoLibAccessor::uploadBootloaderFirmware (const DeviceHandle deviceHandle, const std::vector & btData, const std::vector & fwData, NlcDataTransferCallback* waea hoki)

Tawhā deviceHandle btData fwData NlcDataTransferCallback
Whakahoki ResultVoid

Ka tautuhi he aha te taputapu pahi e whakahōuhia ana e NanoLib. Huanga kei roto nga raraunga bootloader. Huanga kei roto nga raraunga firmware. He kaiwhakataki ahunga whakamua raraunga. Ka whakaū kua rere he mahi kore.

uploadBootloaderFirmwareFromFile ()
Whakamahia tenei mahi ki te whakahōu i tō pūmana pūmau me te mārō mā te tukuake i te files.
mariko ResultVoid nlc::NanoLibAccessor::uploadBootloaderFirmwareFromFile (Const DeviceHandle deviceHandle, const std::string & bootloaderAbsoluteFileAra, const std:: aho & tinoFileAra, NlcDataTransferCallback* waea hoki)

Tawhā deviceHandle bootloaderAbsoluteFileAra tinoFileAra NlcDataTransferCallback
Whakahoki ResultVoid

Ka tautuhi he aha te taputapu pahi whakahōu a NanoLib. Ara ki file kei roto nga raraunga bootloader (std::string). Ara ki file kei roto nga raraunga firmware (uint8_t). He kaiwhakataki ahunga whakamua raraunga. Ka whakaū kua rere he mahinga kore.

Putanga: doc 1.4.2 / NanoLib 1.3.0

25

8 Tohutoro akomanga / mahi

uploadNanoJ ()
Whakamahia tenei mahi a te iwi ki te tuku ake i te kaupapa NanoJ ki to kaiwhakahaere.
mariko ResultVoid nlc::NanoLibAccessor::uploadNanoJ (DeviceHandle const deviceHandle, std::vector const & vmmData, NlcDataTransferCallback* waea hoki)

Tawhā deviceHandle vmmData NlcDataTransferCallback
Whakahoki ResultVoid

Ka tautuhi he aha te taputapu pahi ka tukuna e NanoLib. Huanga kei roto nga raraunga NanoJ. He kaiwhakataki ahunga whakamua raraunga. Ka whakaū kua rere he mahi kore.

uploadNanoJFromFile ()
Whakamahia tenei mahi a te iwi ki te tuku ake i te kaupapa NanoJ ki to kaiwhakahaere ma te tuku i te file.
mariko ResultVoid nlc::NanoLibAccessor::uploadNanoJFromFile (Const DeviceHandle deviceHandle, const std:: aho & tinoFileAra, NlcDataTransferCallback* waea hoki)

Tawhā deviceHandle tinoFileAra NlcDataTransferCallback
Whakahoki ResultVoid

Ka tautuhi he aha te taputapu pahi ka tukuna e NanoLib. Ara ki file kei roto nga raraunga NanoJ (std::string). He kaiwhakataki ahunga whakamua raraunga. Ka whakaū kua rere he mahinga kore.

disconnectDevice () Whakamahia tenei mahi hei momotu i to taputapu ma te deviceHandle.
mariko ResultVoid nlc::NanoLibAccessor::disconnectDevice (DeviceHandle const deviceHandle)

Tawhā deviceHandle Whakahoki ResultVoid

Ka tautuhi he aha te taputapu pahi ka momotuhia e NanoLib. Ka whakaū kua rere he mahinga kore.

removeDevice () Whakamahia tenei mahi ki te tango i to taputapu mai i te rarangi taputapu o roto o NanoLib.
mariko ResultVoid nlc::NanoLibAccessor::tango Pūrere (const DeviceHandle deviceHandle)

Tawhā deviceHandle Whakahoki ResultVoid

Ka tohua he aha te taputapu pahi ka whakakorehia e NanoLib. Ka whakaū kua rere he mahi kore.

katiBusHardware () Whakamahia tenei mahi ki te momotu mai i to taputapu pahi mara.
mariko ResultVoid nlc::NanoLibAccessor::closeBusHardware (BusHardwareId const & busHwId)

Tawhā busHwId Whakahoki HuaKaore

Ka tautuhi i te pahi mara hei momotu mai. Ka whakaū kua rere he mahi kore.

Putanga: doc 1.4.2 / NanoLib 1.3.0

26

8 Tohutoro akomanga / mahi

8.2 BusHardwareId
Whakamahia tenei akomanga ki te tautuhi i tetahi taputapu pahi ki tetahi, ki te wehe ranei i nga taputapu pahi rereke mai i a raatau. Ko tenei karaehe (kare he mahi kaiwhakatakoto kia kore e huri mai i te orokohanga) kei te pupuri korero mo:
Pūmārō (= ingoa whāurutau, whāurutau whatunga me ētahi atu) Kawa hei whakamahi (= Modbus TCP, CANopen me ētahi atu) Kaitautoko taputapu pahi (= ingoa tauranga rangatū, ingoa MAC Friendly
wāhitau etc.)

BusHardwareId () [1/3] Kaihanga ka hanga he ahanoa ID taputapu pahi hou.
nlc::BusHardwareId::BusHardwareId (std:: string const & busHardware_, std:: string const & protocol_, std:: string const & hardwareSpecifier_, std:: string const & name_)

Tawhā pahiHardware_ protocol_ hardwareSpecifier_ extraHardwareSpecifier_ name_

Momo taputapu (= ZK-USB-CAN-1 etc.). Kawa korero pahi (= CANopen etc.). Ko te tohu o te taputapu (= COM3 me etahi atu). Ko te taapiri taapiri mo te taputapu (me kii, korero mo te waahi USB). He ingoa hoa (= AdapterName (Port) etc. ).

BusHardwareId () [2/3] Kaihanga ka hanga he ahanoa ID taputapu pahi hou, me te kowhiringa mo te taapiri taputapu taapiri.
nlc::BusHardwareId::BusHardwareId (std:: string const & busHardware_, std:: string const & protocol_, std:: string const & hardwareSpecifier_, std:: string const & extraHardwareSpecifier_, std:: string const & name_)

Tawhā pahiHardware_ protocol_ hardwareSpecifier_ extraHardwareSpecifier_ name_

Momo taputapu (= ZK-USB-CAN-1 etc.). Kawa korero pahi (= CANopen etc.). Ko te tohu o te taputapu (= COM3 me etahi atu). Ko te taapiri taapiri mo te taputapu (me kii, korero mo te waahi USB). He ingoa hoa (= AdapterName (Port) etc. ).

BusHardwareId () [3/3] Kaihanga e kape ana i te busHardwareId e noho nei.
nlc::BusHardwareId::BusHardwareId (BusHardwareId const &)

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

Tawhā busHardwareId

Whakaingoatia te ID taputapu pahi hei kape mai.

he rite () Ka whakatairitehia he ID taputapu pahi hou ki nga mea o mua.
bool nlc::BusHardwareId::rite (BusHardwareId const me etahi atu) const

Tawhā atu Whakahoki pono

Ko tetahi atu mea o te akomanga kotahi. Mena he rite nga mea e rua ki nga uara katoa.

Putanga: doc 1.4.2 / NanoLib 1.3.0

27

8 Tohutoro akomanga / mahi

teka

Mena he rereke nga uara.

getBusHardware () Ka panui i te aho taputapu pahi.
std::string nlc::BusHardwareId::getBusHardware () const

Whakahoki aho

getHardwareSpecifier () Ka panui i te aho tauwhāiti o te taputapu pahi (= ingoa whatunga me etahi atu).
std::string nlc::BusHardwareId::getHardwareSpecifier () const

Whakahoki aho

getExtraHardwareSpecifier () Ka panui i te pahi i te aho tauwhāiti taputapu taapiri (= MAC address etc.).
std::string nlc::BusHardwareId::getExtraHardwareSpecifier () const

Whakahoki aho

getName () Ka panuihia te ingoa hoa o te taputapu pahi.
std::string nlc::BusHardwareId::getName () const

Whakahoki aho

getProtocol () Ka panui i te aho kawa pahi.
std::string nlc::BusHardwareId::getProtocol () const

Whakahoki aho

toString () Whakahokia te ID taputapu pahi hei aho.
std::string nlc::BusHardwareId::toString () const

Whakahoki aho
8.3 BusHardwareOptions
Kimihia i roto i tenei akomanga, i roto i te rarangi uara matua o nga aho, nga whiringa katoa hei whakatuwhera i tetahi taputapu pahi.

Putanga: doc 1.4.2 / NanoLib 1.3.0

28

8 Tohutoro akomanga / mahi

BusHardwareOptions () [1/2] Hangaia he ahanoa kōwhiringa taputapu pahi.
nlc::BusHardwareOptions::BusHardwareOptions () Whakamahia te mahi addOption () hei taapiri takirua uara-matua.

BusHardwareOptions () [2/2] Hangaia he ahanoa whiringa taputapu pahi hou me te mapi uara-matua kua takoto.
nlc::BusHardwareOptions::BusHardwareOptions (std::map const & kōwhiringa)

Kōwhiringa tawhā

He mapi me nga whiringa mo te taputapu pahi hei whakahaere.

addOption () Ka waihanga i etahi atu taviri me nga uara.
void nlc::BusHardwareOptions::addOption (std::string const & key, std::string const & value)

Tawhā uara matua

Example: BAUD_RATE_OPTIONS_NAME, tirohia te bus_hw_options_ taunoa
Example: BAUD_RATE_1000K, tirohia te bus_hw_options_defaults

he rite () Ka whakatairite i nga BusHardwareOptions ki nga mea o naianei.
bool nlc::BusHardwareOptions::rite (BusHardwareOptions const me etahi atu) const

Tawhā atu Whakahoki pono
teka

Ko tetahi atu mea o te akomanga kotahi. Mēnā he rite ngā kōwhiringa katoa ki tērā atu ahanoa. Mena he rereke nga taviri me nga uara o tetahi atu mea.

getOptions () Ka panui i nga takirua uara-matua kua tapiritia.
std::mapi nlc::BusHardwareOptions::getOptions () const

Whakahoki mapi aho

toString () Whakahokia nga taviri / uara katoa hei aho.
std::string nlc::BusHardwareId::toString () const

Whakahoki aho
8.4 BusHwOptionsDefault
Kei tenei karaehe whiringa whirihoranga taunoa nga huanga whanui e whai ake nei:

Putanga: doc 1.4.2 / NanoLib 1.3.0

29

8 Tohutoro akomanga / mahi

const CanBus const Serial const RESTfulBus const EtherCATBus

canBus = CanBus () rangatū = Rangatū () restfulBus = RESTfulBus() ethercatBus = EtherCATBus()

8.5 CanBaudRate

Hanganga kei roto CAN nga pahi pahi i roto i nga huanga whanui e whai ake nei:

const std::string const std::string const std::string const std::string const std::string const std::string const std::string const std::string const std::string const std::string

BAUD_RATE_1000K = “1000k” BAUD_RATE_800K = “800k” BAUD_RATE_500K = “500k” BAUD_RATE_250K = “250k” BAUD_RATE_125K = “125k” BAUD_RATE_100_100K BAUD_RATE_50_50K” = “20_20K” E_10K = “10k” BAUD_RATE_5K = “5k” BAUD_RATE_XNUMXK = “XNUMXk”

8.6 CanBus

Ko te karaehe whiringa whirihoranga taunoa me nga huanga whanui e whai ake nei:

const std::string const CanBaudRate const Ixxat

BAUD_RATE_OPTIONS_NAME = "ka taea te urutau te reeti baud" baudRate = CanBaudRate () ixxat = Ixxat ()

8.7 CanOpenNmtService

Mo te ratonga NMT, kei roto i tenei hanganga nga korero CANopen NMT hei uara aho i roto i nga huanga whanui e whai ake nei:

const std::string const std::string const std::string const std::string const std::string

TITIAKI = “TAMAITI” KAUPAPA = “KORE” PRE_OPERATIONAL = “PRE_OPERATIONAL” RESET = “RESET” RESET_COMMUNICATION = “RESET_COMMUNICATION”

8.8 CanOpenNmtState

Kei roto i tenei hanganga nga korero CANopen NMT hei uara aho i roto i nga huanga whanui e whai ake nei:

const std::string const std::string const std::string const std::string const std::string

WHAKATOKANGA = “TAHI” PRE_OPERATIONAL = “PRE_OPERATIONAL” OPERATIONAL = “OPERATIONAL” INITIALIZATION = “INITIALIZATION” UNKNOWN = “UNKNOWN”

8.9 Hanganga EtherCATBus

Kei roto i tenei hanganga nga whiringa whirihoranga korero EtherCAT i roto i nga huanga whanui e whai ake nei:

Putanga: doc 1.4.2 / NanoLib 1.3.0

30

8 Tohutoro akomanga / mahi

const std:: aho NETWORK_FIRMWARE_STATE_OP- Ko te ahua o te whatunga ka kiia hei aratau firmware. Ka whakaaetia

TION_NAME = “Wāhanga Pūmau Whatunga”

uara (taunoa = PRE_OPERATIONAL):

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

const std::string DEFAULT_NETWORK_FIRMWARE_ STATE = “PRE_OPERATIONAL”

const std:: aho EXCLUSIVE_LOCK_TIMEOUT_OP- Wā i roto i te mira hēkona ki te whiwhi raka motuhake i runga

TION_NAME = “Wā Maukati Tiritahi”

te whatunga (taunoa = 500 ms).

const unsigned int DEFAULT_EXCLUSIVE_LOCK_ TIMEOUT = “500”

const std:: aho SHARED_LOCK_TIMEOUT_OPTION_ Wā wā i roto i te mira hēkona kia whiwhi raka tiritahi

NAME = “Waimata Maukati Tirihia”

te whatunga (taunoa = 250 ms).

const unsigned int DEFAULT_SHARED_LOCK_TIMEOUT = “250”

const std::string READ_TIMEOUT_OPTION_NAME = Wā wā i roto i te mira hēkona mō te mahi pānui (taunoa

“Pānuitia te wāwā”

= 700 ms).

const unsigned int DEFAULT_READ_TIMEOUT = “700”

const std:: aho WRITE_TIMEOUT_OPTION_NAME = Wā wā i roto i te mira hēkona mō te mahi tuhi (taunoa

"Tuhia te Wā"

= 200 ms).

const unsigned int DEFAULT_WRITE_TIMEOUT = “200”

const std:: aho READ_WRITE_ATTEMPTS_OPTION_ Morahi nga nganatanga ki te panui, ki te tuhi ranei (nga uara kore-kore

Ingoa = "Panui/Tuhi Nga Nganatanga"

anake; taunoa = 5).

const unsigned int DEFAULT_READ_WRITE_ATTEMPTS = “5”

const std::string CHANGE_NETWORK_STATE_ATTEMPTS_OPTION_NAME = “Huri Nga Nganatanga Whenua Whatunga”

Te maha o nga nganatanga ki te whakarereke i te ahua whatunga (nga uara kore-kore anake; taunoa = 10).

const unsigned int DEFAULT_CHANGE_NETWORK_ STATE_ATTEMPTS = “10”

const std:: aho PDO_IO_ENABLED_OPTION_NAME Whakahohe, mono ranei te tukatuka PDO mo te mamati in- /

= “PDO IO Whakahohe”

putanga (“True” or “False” only; default = “True”).

const std::string DEFAULT_PDO_IO_ENABLED = “True”

8.10 Hanganga EtherCATState

Kei roto i tenei hanganga te kupu pononga / whatunga EtherCAT hei uara aho i roto i nga huanga whanui e whai ake nei. Tuhipoka: Ko PRE_OPERATIONAL te ahua taunoa kei te hiko; Kaore e taea e NanoLib te whakarato i te ahua "OPERATIONAL" pono i roto i te punaha whakahaere-kore:

const std::string const std::string const std::string const std::string const std::string const std::string

KORE = "KORE" KAUPAPA = "INIT" PRE_OPERATIONAL = "PRE_OPERATIONAL" BOOT = "BOOT" SAFE_OPERATIONAL = "SAFE_OPERATIONAL" OPERATIONAL = "OPERATIONAL"

Putanga: doc 1.4.2 / NanoLib 1.3.0

31

8 Tohutoro akomanga / mahi

8.11 Ixxat

Kei tenei hanganga nga korero katoa mo te Ixxat usb-to-can i roto i nga huanga whanui e whai ake nei:

const std:: aho

ADAPTER_BUS_NUMBER_OPTIONS_NAME = “tau pahi urutau ixxat”

const IxxatAdapterBusNumber adapterBusNumber = IxxatAdapterBusNumber ()

8.12 IxxatAdapterBusNumber

Kei tenei hanganga te nama pahi mo te Ixxat usb-to-can i roto i nga huanga whanui e whai ake nei:

const std::string const std::string const std::string const std::string

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

8.13 Peariki

Kei tenei hanganga nga korero katoa mo te Peak usb-to-can i roto i nga huanga whanui e whai ake nei:

const std:: aho

ADAPTER_BUS_NUMBER_OPTIONS_NAME = “tau pahi urutau teitei”

const PeakAdapterBusNumber adapterBusNumber = PeakAdapterBusNumber ()

8.14 PeakAdapterBusNumber

Kei tenei hanganga te nama pahi mo te Peak usb-to-can i roto i nga huanga whanui e whai ake nei:

const std::string const std::string const std::string const std::string const std::string const std::string const std::string const std::string const std::string const std::string const::string const const::string const std::string const std::string

BUS_NUMBER_1_DEFAULT = std::ki_ aho (PCAN_USBBUS1) BUS_NUMBER_2 = std::ki_ aho (PCAN_USBBUS2) BUS_NUMBER_3 = std::ki_ aho (PCAN_USBBUS3) BUS_NUMBER_4 = std::ki_ aho (PCAN_USBBUS4::ki_ aho: PCAN_USBBUS5) (PCAN_USBBUS5) BUS_NUMBER_6 = std::to_string (PCAN_USBBUS6) BUS_NUMBER_7 = std::to_string (PCAN_USBBUS7) BUS_NUMBER_8 = std::ki_string (PCAN_USBBUS8) BUS_NUMBER_9 = BUS_NUMBER_9 = std::ki_BBUS (10PCAN_USBBUS) std::ki_ aho (PCAN_USBBUS10) BUS_NUMBER_11 = std::ki_ aho (PCAN_USBBUS11) BUS_NUMBER_12 = std::ki_ aho (PCAN_USBBUS12) BUS_NUMBER_13 = std::ki_ aho_(PCAN_USBBUS13) = BUS_USBBUS14: BUS (PCAN_USBBUS14) BUS_NUMBER_15 = std::to_string (PCAN_USBBUS15) BUS_NUMBER_16 = std::to_string (PCAN_USBBUS16)

8.15 PūrereKawe
Ko tenei karaehe e tohu ana i te kakau mo te whakahaere i tetahi taputapu i runga i te pahi me nga mahi a te iwi whanui e whai ake nei.

DeviceHandle () DeviceHandle (uint32_t kakau)

Putanga: doc 1.4.2 / NanoLib 1.3.0

32

8 Tohutoro akomanga / mahi

he rite () Ka whakatairite i a ia ano ki tetahi kakau taputapu.
he rite te bool (DeviceHandle const other) const (uint32_t kakau)

toString () Whakahokia he tohu aho o te kakau taputapu.
std::string toString () const

tiki () Whakahokia te kakau taputapu.
uint32_t tiki () const

8.16 Id Pūrere
Whakamahia tenei karaehe (kaore e taea te whakarereke mai i te hanganga) ki te tautuhi me te wehewehe i nga taputapu kei runga pahi:

Pūmau pūurutau pūtautuhi

Kaitohu Pūrere

Whakaahuatanga

Ko te tikanga o nga uara ID taputapu / whakaahuatanga kei runga i te pahi. Mo te exampNa, ka taea e te pahi CAN te whakamahi i te ID tauoti.

DeviceId () [1/3] Ka hangaia he ahanoa ID taputapu hou.
nlc::DeviceId::DeviceId (BusHardwareId const & busHardwareId_, unsigned int deviceId_, std::string const & description_)

Tawhā busHardwareId_ deviceId_ description_

Kaitohu o te pahi. He taupū; i raro i te pahi (= CANopen node ID etc.). He whakaahuatanga (he putua pea); i raro i te pahi.

DeviceId () [2/3] Ka hangaia he ahanoa ID taputapu hou me nga whiringa ID roa.
nlc::DeviceId::DeviceId (BusHardwareId const & busHardwareId, unsigned int deviceId_, std::string const & description_ std::vector const & extraId_, std:: string const & extraStringId_)

Tawhā busHardwareId_ deviceId_ description_ extraId_ extraStringId_

Kaitohu o te pahi. He taupū; i raro i te pahi (= CANopen node ID etc.). He whakaahuatanga (he putua pea); i raro i te pahi. He ID taapiri (kei te noho kau); te tikanga kei runga i te pahi. TT aho taapiri (kei te noho kau); te tikanga kei runga i te pahi.

DeviceId () [3/3] Hangaia he kape o te ahanoa ID taputapu.
nlc::Id Pūrere::Id Pūrere (TuhingaId Pūrere &)

Putanga: doc 1.4.2 / NanoLib 1.3.0

33

8 Tohutoro akomanga / mahi

Tawhā pūrereId_

ID Pūrere hei kape mai.

e rite ana () Ka whakatairite i nga mea hou ki nga taonga o naianei.
bool nlc::DeviceId::rite (DeviceId const me etahi atu) const

Whakahokia te boolean

getBusHardwareId () Ka panuihia te ID taputapu pahi.
BusHardwareId nlc::DeviceId::getBusHardwareId () const

Whakahoki BusHardwareId

getDescription () Ka panuihia te whakaahuatanga taputapu (kaore pea i whakamahia).
std::string nlc::DeviceId::getDescription () const

Whakahoki aho

getDeviceId () Ka panui i te ID taputapu (kaore pea i whakamahia).
unsigned int nlc::DeviceId::getDeviceId () const

Ka whakahokia int kore haina

toString () Whakahokia te ahanoa hei aho.
std::string nlc::DeviceId::toString () const

Whakahoki aho

getExtraId () Ka panui i te ID taapiri o te taputapu (kaore pea e whakamahia).
const std::vector &getExtraId () const

Whakahokia te vector

He vector o nga taapiri taapiri (kei te noho kau); te tikanga kei runga i te pahi.

getExtraStringId () Ka panui i te taapiri aho ID o te taputapu (kaore pea e whakamahia).
std:: aho getExtraStringId () const

Putanga: doc 1.4.2 / NanoLib 1.3.0

34

8 Tohutoro akomanga / mahi

Whakahoki aho

Ko te ID aho taapiri (he putua pea); te tikanga kei runga i te pahi.

8.17 Kaihurihuri

Ka whakahokia e tenei karaehe to taumata rangitaki hei aho. static std::string toString (nlc::LogLevel logLevel)

8.18 TakiuruModuleConverter

Ka whakahokia e tenei karaehe to whare pukapuka-motuhake modulesetLoggingLevel () hei aho.

std pateko:: aho

toString (nlc::LogModule logModule)

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

8.19 Papakupu Ahanoa
Ko tenei karaehe e tohu ana i tetahi papakupu ahanoa o tetahi kaiwhakahaere me enei mahi mema mo te iwi whanui: getDeviceHandle ()
mariko ResultDeviceHandle getDeviceHandle () const Whakahoki ResultDeviceHandle

getObject () mariko ResultObjectSubEntry getObject (OdIndex const odIndex) Whakahokia ResultObjectSubEntry

getObjectEntry () mariko ResultObjectEntry getObjectEntry (uint16_t taupū)

Whakahoki ResultObjectEntry

He korero mo nga ahuatanga o tetahi mea.

tikiXmlFileIngoa () mariko ResultString getXmlFileIngoa () const

Whakahoki ResultString

Whakahokia te XML file ingoa hei aho.

readNumber () mariko ResultInt readNumber (OdIndex const odIndex) Whakahoki ResultInt
readNumberArray () virtual ResultArrayInt readNumberArray (uint16_t const index)

Putanga: doc 1.4.2 / NanoLib 1.3.0

35

8 Tohutoro akomanga / mahi
Whakahoki ResultArrayInt readString ()
mariko ResultString readString (OdIndex const odIndex) Whakahokia ResultString readBytes () mariko ResultArrayByte readBytes (OdIndex const odIndex) Whakahoki ResultArrayByte writeNumber () mariko ResultVoid writeNumber (OdIndex const const odIndex64, OdIndex const odIndex) writePaita () mariko ResultVoid writeBytes (OdIndex const OdIndex, std::vector
const & raraunga) Whakahoki ResultVoid Hononga Hononga OdIndex
8.20 Kaupapa Whakauru
Ko tenei karaehe e tohu ana i te urunga ahanoa o te papakupu ahanoa, e whai ake nei nga huanga tiaki pateko me nga mahi a nga mema whanui:
static nlc::ObjectSubEntry invalidObject
getName () Ka panui i te ingoa o te ahanoa hei aho.
virtual std::string getName () const
getPrivate () Ka taki mena he mea motuhake te ahanoa.
mariko bool getPrivate () const
getIndex () Ka panui i te wahitau o te taupū ahanoa.
mariko uint16_t getIndex () const

Putanga: doc 1.4.2 / NanoLib 1.3.0

36

8 Tohutoro akomanga / mahi

getDataType () Pānuihia te momo raraunga o te ahanoa.
mariko nlc::ObjectEntryDataType getDataType () const

getObjectCode () Ka panui te waehere ahanoa:

Null Deftype Defstruct Var Array Record

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

mariko nlc:: ObjectCode getObjectCode () const

getObjectSaveable () Ka taki mena ka taea te penapena te ahanoa me te waahanga (tirohia te pukapuka hua mo etahi atu taipitopito): TONO, WHAKAARO, DRIVE, MISC_CONFIG, MODBUS_RTU, NO, WHAKATARI, KAITIAKI, ETHERNET, CANOPEN, VERIFY1020, UNKNOWN_SAVEABLE_TYPE
mariko nlc::ObjectSaveable getObjectSaveable () const

getMaxSubIndex () Ka panuihia te maha o nga tohuroto e tautokohia ana e tenei ahanoa.
mariko uint8_t getMaxSubIndex () const

getSubEntry () mariko nlc::ObjectSubEntry & getSubEntry (uint8_t subIndex)
Tirohia hoki ObjectSubEntry.
8.21 ObjectSubEntry
Ko tenei karaehe e tohu ana i te urunga-iti ahanoa (subindex) o te papakupu ahanoa, a, kei a ia nga mahi mema a te iwi e whai ake nei:
getName () Ka panui i te ingoa o te ahanoa hei aho.
virtual std::string getName () const

getSubIndex () Ka panui i te wahitau o te taupae iti.
mariko uint8_t getSubIndex () const

Putanga: doc 1.4.2 / NanoLib 1.3.0

37

8 Tohutoro akomanga / mahi

getDataType () Pānuihia te momo raraunga o te ahanoa.
mariko nlc::ObjectEntryDataType getDataType () const

getSdoAccess () Ka taki mena ka uru te taupaeroto ma SDO:

Panui Anake

1

Tuhia Anake

2

PanuiTuhituhi

3

KarekauWahi

0

mariko nlc::ObjectSdoAccessAttribute getSdoAccess () const

getPdoAccess () Ka taki mena ka uru/mappable te taupaeroto ma PDO:

Tx

1

Rx

2

TxRx

3

Kao

0

mariko nlc::ObjectPdoAccessAttribute getPdoAccess () const

getBitLength () Ka taki i te roa taupūroto.
mariko uint32_t getBitLength () const

getDefaultValueAsNumeric () Ka panui i te uara taunoa o te taupaeroto mo nga momo raraunga tau.
mariko ResultInt getDefaultValueAsNumeric (std::string const & key) const

getDefaultValueAsString () Ka panui i te uara taunoa o te taupaeroto mo nga momo raraunga aho.
mariko ResultString getDefaultValueAsString (std::string const & kī) const

getDefaultValues ​​() Ka panui i nga uara taunoa o te taupū iti.
mariko std::map getDefaultValues ​​() const

Putanga: doc 1.4.2 / NanoLib 1.3.0

38

8 Tohutoro akomanga / mahi

readNumber () Ka panui i te uara tuturu o te taupū iti.
mariko ResultInt readNumber () const

readString () Ka panui i te uara o te aho o te taupū iti.
mariko ResultString readString () const

readBytes () Ka panui i te uara tuturu o te taupaeroto i roto i nga paita.
mariko ResultArrayByte readBytes () const

writeNumber () Tuhia he uara tau ki te taupū iti.
mariko ResultVoid writeNumber (const int64_t uara) const

writeBytes () Tuhia he uara i roto i te taupū-roto i roto i nga paita.
mariko ResultVoid writeBytes (std::vector const & raraunga) const

8.22 OdIndex
Whakamahia tenei karaehe (kare e huri mai i te orokohanga) ki te takai me te kimi tohu tohu whaiaronga ahanoa / tohu-iti. Ko te OD o tetahi taputapu he 65535 (0xFFFF) nga rarangi me te 255 (0xFF) nga pou; me nga aputa i waenga i nga rarangi korekore. Tirohia te paerewa CANopen me to pukapuka hua mo etahi atu korero.
OdIndex () Hangaia he ahanoa OdIndex hou.
nlc::OdIndex::OdIndex (uint16_t taupū, uint8_t subIndex)

Taupū tawhā taupū iti

Mai i te 0 ki te 65535 (0xFFFF) kei roto. Mai i te 0 ki te 255 (0xFF) kei roto.

getIndex () Ka panui i te taurangi (mai i te 0x0000 ki te 0xFFFF).
uint16_t nlc::OdIndex::getIndex () const

Ka hoki uint16_t

getSubindex () Ka panui i te taupū-iti (mai i te 0x00 ki te 0xFF)
uint8_t nlc::OdIndex::getSubIndex () const

Putanga: doc 1.4.2 / NanoLib 1.3.0

39

8 Tohutoro akomanga / mahi

Ka hoki uint8_t

toString () Whakahokia te taupū me te taupūroto hei aho. Ko te aho taunoa 0xIIII:0xSS e penei ana:

I = taupū mai i te 0x0000 ki te 0xFFFF

S = taupū-iti mai i te 0x00 ki te 0xFF

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

Whakahoki 0xIIII:0xSS

Whakaaturanga aho taunoa

8.23 OdLibrary
Whakamahia tenei atanga papatono hei hanga tauira o te akomanga ObjectDictionary mai i te XML. Ma te assignObjectDictionary, ka taea e koe te here i ia tauira ki tetahi taputapu motuhake na te mea he kaitautuhi ahurei i hangaia. Ko nga tauira ObjectDictionary i hangaia ka penapena ki te ahanoa OdLibrary kia uru atu ma te taupū. Ka utaina e te akomanga ODLibrary nga mea ObjectDictionary mai file te huinga ranei, ka penapena, ka whai i nga mahi mema a te iwi e whai ake nei:

getObjectDictionaryCount () mariko uint32_t getObjectDictionaryCount () const

getObjectDictionary () mariko ResultObjectDictionary getObjectDictionary (uint32_t odIndex)

Whakahoki ResultObjectDictionary

addObjectDictionaryFromFile ()
mariko ResultObjectDictionary addObjectDictionaryFromFile (std:: string const & absoluteXmlFileAra)

Whakahoki ResultObjectDictionary

addObjectDictionary ()
mariko ResultObjectDictionary addObjectDictionary (std::vector const & odXmlData, const std::string &xmlFileAra = std::string ())

Whakahoki ResultObjectDictionary
8.24 OdTypesHelper
I tua atu i nga mahi mema a te iwi e whai ake nei, kei roto i tenei akomanga nga momo raraunga ritenga. Tuhipoka: Hei taki i o momo raraunga ritenga, rapua te akomanga enum ObjectEntryDataType i roto od_types.hpp.

uintToObjectCode () Ka huri i nga tauoti kore haina ki te waehere ahanoa:

Null Deftype

0X00 0X05

Putanga: doc 1.4.2 / NanoLib 1.3.0

40

8 Tohutoro akomanga / mahi

Defstruct Var Array Record

0x06 0x07 0x08 0x09

ObjectCode pateko uintToObjectCode (kaore i hainatia int objectCode)

isNumericDataType () He whakamohio mehemea he tau te momo raraunga, ehara ranei.
heNumericDataType te putea pateko (ObjectEntryDataType DataType)

isDefstructIndex () He whakamohio mehemea he taupū hanganga whakamaramatanga, ehara ranei.
heDefstructIndex bool pateko (uint16_t typeNum)

isDeftypeIndex () He whakamohio mehemea he taupū momo whakamaarama te ahanoa, ehara ranei.
heDeftypeIndex bool pateko (uint16_t typeNum)

isComplexDataType () Ka whakamohio mehemea he uaua te momo raraunga, kaore ranei.
ko te PukaPatekoKo teMomoRaraungaRaraunga(ObjectEntryDataTypeDataType)

uintToObjectEntryDataType () Ka huri i nga tauoti kore haina ki te momo raraunga OD.
sstatic ObjectEntryDataType uintToObjectEntryDataType (uint16_t objectDataType)

objectEntryDataTypeToString () Ka huri i te momo raraunga OD ki te aho.
static std::string objectEntryDataTypeToString (ObjectEntryDataType odDataType)

stringToObjectEntryDatatype () Ka huri i te aho ki te momo raraunga OD mena ka taea. Ki te kore, ka whakahokia UNKNOWN_DATATYPE.
static ObjectEntryDataType stringToObjectEntryDatatype (std::string dataTypeString)

Putanga: doc 1.4.2 / NanoLib 1.3.0

41

8 Tohutoro akomanga / mahi

objectEntryDataTypeBitLength () He whakamohio mo te roa moka o tetahi momo raraunga urunga ahanoa.
uint32_t objectEntryDataTypeBitLength (ObjectEntryDataType const & DataType)

8.25 Hanganga RESTfulBus

Kei roto i tenei hanganga nga whiringa whirihoranga korero mo te atanga RESTful (i runga i te Ethernet). Kei roto nga huanga whanui e whai ake nei:

const std::string const unsigned long const std::string const unsigned long const std::string const unsigned long

CONNECT_TIMEOUT_OPTION_NAME = “Wā Tuhono Hononga Whakamutua” DEFAULT_CONNECT_TIMEOUT = 200 REQUEST_TIMEOUT_OPTION_NAME = “Wā Whakarerenga Tono” DEFAULT_REQUEST_TIMEOUT = 200 RESPONSE_TIMEOUT_OPTION_NAME = “Wā Whakahoki Whakautu” DEFAULT_REQUEST_TIMEOUT = 750TIMEOUT

8.26 ProfinetDCP
I raro i te Linux, me whai kaha te tono waea CAP_NET_ADMIN me CAP_NET_RAW. Hei whakahohe: sudo setcap 'cap_net_admin,cap_net_raw+eip' ./executable. I Windows, ka whakamahi te atanga ProfinetDCP i te WinPcap (kua whakamatauria me te putanga 4.1.3) me te Npcap ranei (kua whakamatauria me nga putanga 1.60 me 1.30). Ka rapua e ia te whare pukapuka wpcap.dll kua utaina i roto i te raupapa e whai ake nei (Tuhipoka: kaore he tautoko Win10Pcap inaianei):
1. Whaiaronga Nanolib.dll 2. Whaiaronga punaha Windows SystemRoot%System32 3. Whaiaronga whakaurunga Npcap SystemRoot%System32Npcap 4. Ara Taiao
Ko tenei karaehe e tohu ana i tetahi atanga Profinet DCP a kei a ia nga mahi mema a te iwi e whai ake nei:

getScanTimeout () He whakamohio i runga i tetahi taputapu karapa taima (taunoa = 2000 ms).
mariko uint32_t nlc::ProfinetDCP::getScanTimeout () const

setScanTimeout () Ka tautuhi i te waahi matawai taputapu (taunoa = 2000 ms).
mariko kore nlc::setScanTimeout (uint32_t timeoutMsec)

getResponseTimeout () He whakamohio i te wa paunga whakautu a te taputapu mo te tatūnga, te tautuhi me te mahi kimo (taunoa = 1000 ms).
mariko uint32_t nlc::ProfinetDCP::getResponseTimeout () const

setResponseTimeout () He whakamohio i runga i te waahi whakautu a te taputapu mo nga mahi tatūnga, tautuhi me te kimo (taunoa = 1000 ms).
mariko kore nlc::ProfinetDCP::setResponseTimeout (uint32_t timeoutMsec)

Putanga: doc 1.4.2 / NanoLib 1.3.0

42

8 Tohutoro akomanga / mahi

isServiceAvailable ()
Whakamahia tenei mahi ki te tirotiro i te waatea o te ratonga Profinet DCP.
Te mana urutau whatunga / te waatea Windows: WinPcap / Npcap te waatea Linux: CAP_NET_ADMIN / CAP_NET_RAW kaha
mariko ResultVoid nlc::ProfinetDCP::isServiceAvailable (const BusHardwareId & busHardwareId)

Tawhā BusHardwareId Ka hoki pono
teka

ID Pūmārō o te ratonga Profinet DCP hei tirotiro. Kei te waatea te ratonga. Kaore i te waatea te ratonga.

scanProfinetDevices () Whakamahia tenei mahi ki te matawai i te pahi taputapu mo te noho o nga taputapu Profinet.
mariko ResultProfinetDevices scanProfinetDevices (const BusHardwareId & busHardwareId)

Tawhā BusHardwareId Whakahoki ResultProfinetDevices

Ka tautuhia ia pahi mara hei whakatuwhera. Kei te tuwhera nga taputapu.

setupProfinetDevice () Ka whakarite i nga tautuhinga taputapu e whai ake nei:

Ingoa Pūrere

Wāhitau IP

Kopare whatunga

kuwaha taunoa

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

resetProfinetDevice () Ka aukati i te taputapu ka tautuhi ano ki nga taunoa wheketere.
mariko ResultVoid nlc::resetProfinetDevice (const BusHardwareId & busHardwareId, const ProfinetDevice & profinetDevice)

blinkProfinetDevice () Ka whakahau i te taputapu Profinet kia timata te kimo i tana LED Profinet.
mariko ResultVoid nlc::blinkProfinetDevice (const BusHardwareId & busHardwareId, const ProfinetDevice &profinetDevice)

validateProfinetDeviceIp () Whakamahia tenei mahi hei tirotiro i te wahitau IP o te taputapu.
mariko ResultVoid validateProfinetDeviceIp (const BusHardwareId &busHardwareId, const ProfinetDevice & profinetDevice)

Tawhā BusHardwareId ProfinetDevice

Ka whakapūtā te ID pūmārō hei taki. Ka tohua te taputapu Profinet hei whakamana.

Putanga: doc 1.4.2 / NanoLib 1.3.0

43

8 Tohutoro akomanga / mahi

Whakahoki ResultVoid

8.27 Hanganga ProfinetDevice

Kei nga raraunga taputapu Profinet nga huanga whanui e whai ake nei:

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

deviceName deviceVendor macAddress ipAddress netMask defaultGateway

Ka whakaratohia te wahitau MAC hei huānga ki te whakatakotoranga macAddress = {xx, xx, xx, xx, xx, xx}; engari ko te wahitau IP, te kanohi whatunga me te kuaha kua whakamaoritia katoa hei tau hex endian nui, penei:

Wāhitau IP: 192.168.0.2 kanohi Whatunga: 255.255.0.0 Gateway: 192.168.0.1

0xC0A80002 0xFFFF0000 0xC0A80001

8.28 Nga karaehe hua

Whakamahia nga uara whakahoki "kowhiringa" o enei karaehe ki te tirotiro mena kua angitu tetahi waea mahi, kaore ranei, me te kimi hoki i nga take kore. I te angitu, ka whakahoki teka te mahi hasError (). Ma te getResult (), ka taea e koe te panui i te uara hua mo ia momo (ResultInt etc.). Mena ka rahua te waea, ka panuihia e koe te take ma te getError ().

Nga huanga kua tiakina

aho NlcErrorCode uint32_t

errorString errorCode exErrorCode

Ano hoki, kei tenei karaehe nga mahi mema a te iwi e whai ake nei:

hasError () Ka panui i te angitu o te waea mahi.
bool nlc::Huatanga::hasError () const

Ka hoki mai

pono teka

Waea rahua. Whakamahia te getError () ki te panui i te uara. Waea angitu. Whakamahia te getResult () ki te panui i te uara.

getError () Ka panui i te take mena ka rahua te waea mahi.
const std::string nlc::Huatanga::getError () const

Whakahokia te aho const

Putanga: doc 1.4.2 / NanoLib 1.3.0

44

8 Tohutoro akomanga / mahi
hua () Ka awhina nga mahi e whai ake nei ki te tautuhi i nga hua tika:
Hua (std:: string const & errorString_)
Hua (NlcErrorCode const & errCode, std:: string const & errorString_)
Hua (NlcErrorCode const & errCode, const uint32_t exErrCode, std:: string const & errorString_)
Hua (Te hua me te hua)
getErrorCode () Pānuihia te NlcErrorCode.
NlcErrorCode getErrorCode () const
getExErrorCode () uint32_t getExErrorCode () const
8.28.1 HuaKaore
Ka tukuna e NanoLib tetahi tauira o tenei karaehe mena ka hoki kore te mahi. Ka whakawhiwhia e te karaehe nga mahi a te iwi me nga huanga kua parea mai i te karaehe hua, a, kei a ia nga mahi mema a te iwi e whai ake nei:
ResultVoid () Ko nga mahi e whai ake nei ka awhina ki te tautuhi i te hua kore tika:
ResultVoid (std::string const &errorString_)
ResultVoid (NlcErrorCode const & errCode, std:: string const & errorString_)
ResultVoid (NlcErrorCode const & errCode, const uint32_t exErrCode, std:: aho const & errorString_)
ResultVoid (Te hua me te hua)
8.28.2 HuaInt
Ka tukuna atu e NanoLib he tauira o tenei karaehe mena ka whakahokia e te taumahi he tauoti. Ka whakawhiwhia e te karaehe nga mahi a te iwi / huanga kua tiakina mai i te karaehe hua, a, kei a ia nga mahi mema a te iwi e whai ake nei:
getResult () Whakahokia ai te hua tauoti mena ka angitu tetahi waea mahi.
int64_t getResult () const
Ka hoki int64_t

Putanga: doc 1.4.2 / NanoLib 1.3.0

45

8 Tohutoro akomanga / mahi
ResultInt () Ka awhina nga mahi e whai ake nei ki te tautuhi i te hua tauoti tika:
ResultInt (int64_t hua_)
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 (Te hua me te hua)
8.28.3 ResultString
Ka tukuna atu e NanoLib he tauira o tenei karaehe mena ka whakahokia mai e te mahi he aho. Ka whakawhiwhia e te karaehe nga mahi a te iwi / huanga kua tiakina mai i te karaehe hua, a, kei a ia nga mahi mema a te iwi e whai ake nei:
getResult () Ka panui i te hua aho mena ka angitu tetahi waea mahi.
const std::string nlc::ResultString::getResult () const
Whakahokia te aho const
ResultString () Ka awhina nga mahi e whai ake nei ki te tautuhi i te hua aho tika:
ResultString (std:: string const & karere, bool hasError_)
ResultString (NlcErrorCode const & errCode, std:: string const & errorString_)
ResultString (NlcErrorCode const & errCode, const uint32_t exErrCode, std:: aho const & errorString_)
ResultString (Te hua me te hua)
8.28.4 HuaArrayPaita
Ka tukuna atu e NanoLib he tauira o tenei karaehe mena ka whakahokia e te mahi he huinga paita. Ka whakawhiwhia e te karaehe nga mahi a te iwi / huanga kua tiakina mai i te karaehe hua, a, kei a ia nga mahi mema a te iwi e whai ake nei:
getResult () Ka panui i te vector paita mena ka angitu te waea mahi.
const std::vector nlc::ResultArrayByte::getResult () const
Whakahokia te const vector

Putanga: doc 1.4.2 / NanoLib 1.3.0

46

8 Tohutoro akomanga / mahi
ResultArrayByte () Ko nga mahi e whai ake nei ka awhina ki te tautuhi i te hua o te huinga paita tika:
ResultArrayByte (std::vector const & hua_)
ResultArrayByte (std::string const & errorString_)
ResultArrayByte (NlcErrorCode const & errCode, std:: string const & hapa String_)
ResultArrayByte (NlcErrorCode const & errCode, const uint32_t exErrCode, std:: aho const & errorString_)
ResultArrayByte (Te huanga me te hua)
8.28.5 ResultArrayInt
Ka tukuna atu e NanoLib he tauira o tenei karaehe mena ka whakahokia e te mahi he huinga tauoti. Ka whakawhiwhia e te karaehe nga mahi a te iwi / huanga kua tiakina mai i te karaehe hua, a, kei a ia nga mahi mema a te iwi e whai ake nei:
getResult () Ka panuihia te vector tauoti mena ka angitu tetahi waea mahi.
const std::vector nlc::ResultArrayInt::getResult () const
Whakahokia te const vector
ResultArrayInt () Ko nga mahi e whai ake nei ka awhina ki te tautuhi i te huanga huinga tauoti tika:
ResultArrayInt (std::vector const & hua_)
ResultArrayInt (std::string const & errorString_)
ResultArrayInt (NlcErrorCode const & errCode, std:: string const & hapa String_)
ResultArrayInt (NlcErrorCode const & errCode, const uint32_t exErrCode, std:: aho const & errorString_)
ResultArrayInt (Te hua me te hua)
8.28.6 HuaBusHwIds
Ka tukuna e NanoLib tetahi tauira o tenei karaehe mena ka whakahokia mai e te mahinga he huinga ID taputapu pahi. Ka whakawhiwhia e te karaehe nga mahi a te iwi / huanga kua tiakina mai i te karaehe hua, a, kei a ia nga mahi mema a te iwi e whai ake nei:
getResult () Ka panuihia te vector pahi-maramara-ID mena ka angitu tetahi waea mahi.
const std::vector nlc::ResultBusHwIds::getResult () const
Tawhā const vector

Putanga: doc 1.4.2 / NanoLib 1.3.0

47

8 Tohutoro akomanga / mahi
ResultBusHwIds () Ko nga mahi e whai ake nei ka awhina ki te tautuhi i te hua tika-pahi-puoro-ID-huranga:
ResultBusHwIds (std::vector const & hua_)
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 (Te hua me te hua)
8.28.7 ResultDeviceId
Ka tukuna atu e NanoLib tetahi tauira o tenei karaehe mena ka whakahokia mai e te mahi he ID taputapu. Ka whakawhiwhia e te karaehe nga mahi a te iwi / huanga kua tiakina mai i te karaehe hua, a, kei a ia nga mahi mema a te iwi e whai ake nei:
getResult () Ka panuihia te vector ID taputapu mena ka angitu tetahi waea mahi.
DeviceId nlc::ResultDeviceId::getResult () const
Whakahokia te const vector
ResultDeviceId () Ka awhina nga mahi e whai ake nei ki te tautuhi i te huanga ID taputapu tika:
ResultDeviceId (DeviceId const & hua_)
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 (Te huanga me te hua)
8.28.8 Hua PūrereId
Ka tukuna atu e NanoLib tetahi tauira o tenei karaehe mena ka whakahokia mai e te mahi he huinga ID taputapu. Ka whakawhiwhia e te karaehe nga mahi a te iwi / huanga kua tiakina mai i te karaehe hua, a, kei a ia nga mahi mema a te iwi e whai ake nei:
getResult () Whakahokia te vector ID taputapu mena ka angitu tetahi waea mahi.
DeviceId nlc::ResultDeviceIds::getResult () const
Whakahokia te const vector

Putanga: doc 1.4.2 / NanoLib 1.3.0

48

8 Tohutoro akomanga / mahi
ResultDeviceIds () Ko nga mahi e whai ake nei ka awhina ki te tautuhi i te huanga huānga-TT-Hananga tika:
ResultDeviceIds (std::vector const & hua_)
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 (Te hua me te hua)
8.28.9 ResultDeviceHandle
Ka tukuna e NanoLib he tauira o tenei karaehe mena ka whakahokia e te mahi te uara o te kakau taputapu. Ka whakawhiwhia e te karaehe nga mahi a te iwi / huanga kua tiakina mai i te karaehe hua, a, kei a ia nga mahi mema a te iwi e whai ake nei:
getResult () Ka panuihia te kakau taputapu mena ka angitu tetahi waea mahi.
DeviceHandle nlc::ResultDeviceHandle::getResult () const
Whakahoki PūrereHandle
ResultDeviceHandle () Ka awhina nga mahi e whai ake nei ki te tautuhi i te hua o te kakau taputapu:
ResultDeviceHandle (DeviceHandle const & hua_)
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 (Te hua me te hua)
8.28.10 ResultObjectDictionary
Ka tukuna e NanoLib he tauira o tenei karaehe mena ka whakahokia e te mahi nga ihirangi o te papakupu ahanoa. Ka whakawhiwhia e te karaehe nga mahi a te iwi / huanga kua tiakina mai i te karaehe hua, a, kei a ia nga mahi mema a te iwi e whai ake nei:
getResult () Ka panuihia te vector ID taputapu mena ka angitu tetahi waea mahi.
const nlc::ObjectDictionary & nlc::ResultObjectDictionary::getResult () const

Putanga: doc 1.4.2 / NanoLib 1.3.0

49

8 Tohutoro akomanga / mahi

Ka hoki mai

const vector

ResultObjectDictionary () Ka awhina nga mahi e whai ake nei ki te tautuhi i te huanga o te papakupu ahanoa:
ResultObjectDictionary (nlc::ObjectDictionary const & hua_)

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 (Te hua me te hua)

8.28.11 ResultConnectionState
Ka tukuna atu e NanoLib tetahi tauira o tenei karaehe mena ka whakahokia mai e te mahi he korero whakaaro-hononga-motu. Ka whakawhiwhia e te karaehe nga mahi a te iwi / huanga kua tiakina mai i te karaehe hua, a, kei a ia nga mahi mema a te iwi e whai ake nei:
getResult () Ka panuihia te kakau taputapu mena ka angitu tetahi waea mahi.
DeviceConnectionStateInfo nlc::ResultConnectionState::getResult () const

Ka whakahoki mai i te DeviceConnectionStateInfo Kua hono / Momotu / ConnectedBootloader

ResultConnectionState () Ka awhina nga mahi e whai ake nei ki te tautuhi i te hua o te ahua hononga tika:
ResultConnectionState (DeviceConnectionStateInfo const & hua_)

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 (Te hua me te hua)

8.28.12 ResultObjectEntry
Ka tukuna e NanoLib he tauira o tenei karaehe mena ka whakahokia mai e te mahi he urunga ahanoa. Ka whakawhiwhia e te karaehe nga mahi a te iwi / huanga kua tiakina mai i te karaehe hua, a, kei a ia nga mahi mema a te iwi e whai ake nei:

Putanga: doc 1.4.2 / NanoLib 1.3.0

50

8 Tohutoro akomanga / mahi
getResult () Whakahokia te vector ID taputapu mena ka angitu tetahi waea mahi.
nlc:: ObjectEntry const& nlc::ResultObjectEntry::getResult () const
Whakahoki const ObjectEntry
ResultObjectEntry () Ka awhina nga mahi e whai ake nei ki te tautuhi i te hua whakaurunga ahanoa tika:
ResultObjectEntry (nlc::ObjectEntry const & hua_)
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 (Te hua me te hua)
8.28.13 ResultObjectSubEntry
Ka tukuna e NanoLib he tauira o tenei karaehe ki te whakahoki mai te mahi i tetahi urunga-iti ahanoa. Ka whakawhiwhia e te karaehe nga mahi a te iwi / huanga kua tiakina mai i te karaehe hua, a, kei a ia nga mahi mema a te iwi e whai ake nei:
getResult () Whakahokia te vector ID taputapu mena ka angitu tetahi waea mahi.
nlc::ObjectSubEntry const & nlc::ResultObjectSubEntry::getResult () const
Whakahoki const ObjectSubEntry
ResultObjectSubEntry () Ka awhina nga mahi e whai ake nei ki te tautuhi i te huanga whakaurunga-iti ahanoa:
ResultObjectSubEntry (nlc::ObjectEntry const & hua_)
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 (Te hua me te hua)
8.28.14 ResultProfinetDevices
Ka tukuna e NanoLib tetahi tauira o tenei akomanga mena ka whakahokia mai e te mahi he taputapu Profinet. Ka whakawhiwhia e te karaehe nga mahi a te iwi / huanga kua tiakina mai i te karaehe hua, a, kei a ia nga mahi mema a te iwi e whai ake nei:

Putanga: doc 1.4.2 / NanoLib 1.3.0

51

8 Tohutoro akomanga / mahi

getResult () Ka panuihia te vector taputapu Profinet mena ka angitu tetahi waea mahi.
const std::vector & getResult () const

ResultProfinetDevices () Ka awhina nga mahi e whai ake nei ki te tautuhi i nga taputapu Profinet tika.
ResultProfinetDevices (const std::vector me nga taputapu mohio)
ResultProfinetDevices (te hua me te hua)
ResultProfinetDevices (const std::string &errorText, NlcErrorCode errorCode = NlcErrorCode::GeneralError, uint32_t extendedErrorCode = 0)
8.28.15 HuaSampleDataArray
Ka tukuna atu e NanoLib tetahi tauira o tenei karaehe mena ka hoki mai te mahiampte raupapa raraunga. Ka whakawhiwhia e te karaehe nga mahi a te iwi / huanga kua tiakina mai i te karaehe hua, a, kei a ia nga mahi mema a te iwi e whai ake nei:
getResult () Ka panuihia te rarangi raraunga mena ka angitu tetahi waea mahi.
const std::vector <SampleData> & getResult () const

HuaSampleDataArray () Ka awhina nga mahi e whai ake nei ki te tautuhi i nga taputapu Profinet tika.
HuaSampleDataArray (const std::vector <SampleData> & raraungaArray)

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

HuaSampleDataArray (Const ResultSampleDataArray me etahi atu)

HuaSampleDataArray (te hua me te hua)

8.28.16 HuaSamplerState
Ka tukuna atu e NanoLib tetahi tauira o tenei karaehe mena ka hoki mai te mahiampler state.Ka whakawhiwhia e tenei karaehe nga mahi a te iwi / huanga kua parea mai i te karaehe hua, a, kei a ia nga mahi mema a te iwi e whai ake nei:

getResult () Ka panuitia te sampler state vector ki te i angitu te waea mahi.
SamplerState getResult () const

Ka hoki mai a SamplerState>

Kore whirihora / Whirihorahia / Riri / Rere / Oti / Rahua / Whakakore

Putanga: doc 1.4.2 / NanoLib 1.3.0

52

8 Tohutoro akomanga / mahi

HuaSamplerState () Ko nga mahi e whai ake nei ka awhina i te tautuhi i nga s tikaampte kawanatanga.
HuaSamplerState (const SamplerState āhua)

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

HuaSamplerState (Const ResultSamplerState me etahi atu)

HuaSamplerState (te hua me te hua)

8.29 NlcErrorCode

Ki te hee tetahi mea, ka whakaatuhia e nga karaehe hua tetahi o nga waehere hapa kua whakarārangihia i roto i tenei tatauranga.

Waehere Hapa Angitu GeneralError BusUnavailable CommunicationError ProtocolError
ODDoesNotExist ODIInvalidAccess ODTMomoKōrite Mahi I Moetia te MahiKaore i Tautokohia He Mahi Muhu
Te Uru Tohenga Muhu Kua Whakakahorehia te RauemiKaore i Kitea te RauemiKarekau i te waatea i waho o te pumahara Time OutHapa

C: Kāwai D: Whakaahuatanga R: Take C: Kore. D: Kaore he hapa. R: I tutuki pai te mahi.
C: Kaore i tohua. D: Hapa kore i tohua. R: Rahunga kaore e uru ki tetahi atu waahanga.
C: Pahi. D: Kaore i te waatea te pahi taputapu. R: Karekau he pahi, he tapahi, he koha ranei.
C: Whakawhitiwhiti. D: Ko te whakawhitiwhiti korero kaore i te pono. R: Raraunga ohorere, he CRC he, he anga, he hapa parerite, aha atu.
C: Kawa. D: Hapa kawa. R: Whakautu i muri i te whiringa kawa kaore i tautokohia, ka ripoatahia e te taputapu te kawa kaore i tautokohia, te hapa o te kawa (me kii, te moka tukutahi wahanga SDO), me etahi atu. moka tukutahi waahanga), me etahi atu.
C: Papakupu Ahanoa. D: Karekau he wahitau OD. R: Karekau he waahi pera i te papakupu ahanoa.
C: Papakupu Ahanoa. D: He muhu te uru ki te wahitau OD. R: Ngana ki te tuhi panui-anake, ki te panui ranei mai i te tuhi-anake, wahitau.
C: Papakupu Ahanoa. D: Momo kore ōrite. R: Ko te uara kaore i hurihia ki te momo kua tohua, me kii, hei ngana ki te whakatau i te aho hei tau.
C: Taupānga. D: Kua whakakorehia te tukanga. R: Tukatuka tapahia ma te tono tono. Ka hoki mai i runga i te aukati mahi ma te mahi waea hoki, penei, mai i te tirotiro pahi.
C: He mea noa. D: Karekau e tautokohia te tukanga. R: Kaore he tautoko pahi taputapu / taputapu.
C: He mea noa. D: He he te tukanga i te horopaki o naianei, he muhu ranei ki te tohenga o naianei. R: He nganatanga hono ano ki nga pahi / taputapu kua hono. He nganatanga momotu ki nga mea kua momotuhia. He nganatanga mahi bootloader i roto i te aratau firmware, he rereke ranei.
C: He mea noa. D: He muhu te tautohetohe. R: He arorau he, he wetereo ranei.
C: He mea noa. D: Ka whakakorehia te uru. R: Te kore o nga motika me nga kaha ki te mahi i te mahi i tonoa.
C: He mea noa. D: Ko nga mea kua tohua kaore i kitea. R: Pahi taputapu, kawa, taputapu, wahitau OD i runga i te taputapu, ranei file kaore i kitea.
C: He mea noa. D: Ko nga mea kua tohua kaore i kitea. R: he pukumahi, he koretake, he tapahi, he koha ranei.
C: He mea noa. D: He iti rawa te mahara. R: He iti rawa te mahara ki te whakahaere i tenei whakahau.
C: He mea noa. D: Kua pau te tukanga. R: Hoki mai i muri i te paunga o te taima. Ko te waahi he wa whakautu taputapu, he wa ki te whai urunga rauemi tiritiri, motuhake ranei, he wa ranei ki te huri i te pahi / taputapu ki te ahua tika.

Putanga: doc 1.4.2 / NanoLib 1.3.0

53

8 Tohutoro akomanga / mahi

8.30 NlcCallback
Ko tenei karaehe matua mo nga hokinga hoki e whai ake nei te mahi mema a te iwi: hokinga ()
mariko ResultVoid hokiwaea ()

Ka hoki mai

HuaKaore

8.31 NlcDataTransferCallback
Whakamahia tenei karaehe waea hoki mo nga whakawhitinga raraunga (whakahoutanga rorohiko, tukuake NanoJ me etahi atu). 1. Mo te tukunga firmware: Tautuhia he "akomanga-akomanga" e whakaroa ana i tenei me te tikanga waea whakahoki
whakatinanatanga. 2. Whakamahia nga tauira "co-class's" i roto i nga waea NanoLibAccessor.uploadFirmware (). Ko te akomanga matua ake e whai ake nei nga mahi mema a te iwi:

hokiwaea () mariko ResultVoid hokiwaea (nlc::DataTransferInfo info, int32_t data)

Ka hoki mai

HuaKaore

8.32 NlcScanBusCallback
Whakamahia tenei akomanga waea hoki mo te tirotiro pahi. 1. Tautuhia he "akoako-akomanga" e whakaroa ana i tenei me te whakatinanatanga tikanga waea hoki. 2. Whakamahia nga tauira "co-class's" i roto i nga waea NanoLibAccessor.scanDevices (). Ko te karaehe matua ano e whai ake nei nga mahi mema a te iwi.

waea hoki ()
mariko ResultVoid hokiwaea (nlc::BusScanInfo info, std::vector const me nga taputapu i kitea, int32_t raraunga)

Whakahoki ResultVoid
8.33 NlcLoggingCallback
Whakamahia tenei karaehe waea hoki mo te takiuru waea hoki. 1. Tautuhia he karaehe e whakaroa atu ana i tenei akomanga me te whakatinana tikanga waea hoki ritenga 2. Whakamahia he atatohu ki ona tauira hei whakarite i te hokinga mai na NanoLibAccessor >
setLoggingCallback (…).
mariko kore waea hoki (const std::string & payload_str, const std::string & formatted_str, const std::string & logger_name, const unsigned int log_level, const std::uint64_t time_ince_epoch, const size_t thread_id)

8.34 SamplerAtanga
Whakamahia tenei akomanga ki te whirihora, ki te timata me te whakamutu i te sampler, ranei ki te tiki sampraraunga arahina me te tiki riteampte mana o ler, te hapa whakamutunga ranei. Kei roto i te akomanga nga mahi a te iwi whanui.

Putanga: doc 1.4.2 / NanoLib 1.3.0

54

8 Tohutoro akomanga / mahi

whirihora () Whirihorahia heiampler
mariko ResultVoid nlc::SamplerInterface::whirihora (const DeviceHandle deviceHandle, const SamplerConfiguration & samplerConfiguration)

Tawhā [i roto i] taputapuKawe [i] samplerConfiguration
Whakahoki ResultVoid

Ka tautuhi he aha te taputapu hei whirihora i te sampmo te. Ka tautuhi i nga uara o nga huanga whirihoranga. Ka whakaū kua rere he mahinga kore.

getData () Ka whiwhi i te sampraraunga arahina.
Hua marikoSampleDataArray nlc::SamplerInterface::getData (const DeviceHandle deviceHandle)

Tawhā [i] deviceHandle Whakahoki HuaSampleDataArray

Ka tautuhi he aha te taputapu hei tiki i nga raraunga.
Ka tukuna nga sampraraunga arahina, e taea te he huānga kau ki te sampKei te hohe a lerNotify i te tiimatanga.

getLastError () Ka riro heiamphapa whakamutunga a ler.
mariko ResultVoid nlc::SamplerInterface::getLastError (const DeviceHandle deviceHandle)

Whakahoki ResultVoid

Ka whakaū kua rere he mahinga kore.

getState () Ka riro heiampte mana o ler.
Hua marikoSamplerState nlc::SamplerInterface::getState (const DeviceHandle deviceHandle)

Whakahoki HuaSamplerState

Ka tukuna nga sampte kawanatanga.

timata () Ka timata heiampler
mariko ResultVoid nlc::SamplerInterface::timata (const DeviceHandle deviceHandle, SamplerNotify* samplerNotify, int64_t applicationData)

Tawhā [i] taputapuKawe [i] SamplerNotify [i] applicationData
Whakahoki ResultVoid

Ka tautuhi he aha te taputapu hei timata i te sampmo te.
Ka tautuhi he aha nga korero ka taea te ripoata (ka taea te nullptr).
Kōwhiringa: Whakamuahia nga raraunga e pa ana ki te tono (he huinga 8-bit kua tautuhia e te kaiwhakamahi o te uara / ID taputapu / taurangi, he wa ra ranei, he tohu tohu taurangi / mahi, me etahi atu) ki te samplerNotify.
Ka whakaū kua rere he mahinga kore.

Putanga: doc 1.4.2 / NanoLib 1.3.0

55

8 Tohutoro akomanga / mahi

mutu () Ka tu heiampler
mariko ResultVoid nlc::SamplerInterface::stop (const DeviceHandle deviceHandle)

Tawhā [i] deviceHandle Whakahoki HuaKaore

Ka tautuhi he aha te taputapu hei aukati i te sampler mo. Ka whakaū kua rere he mahi kore.

8.35 SampLerConfiguration struct

Kei roto i tenei hanganga nga raraunga sampKo nga whiringa whirihoranga a ler (pateko kaore ranei).

Nga huanga a te iwi

std::vector TrackedAddresses

Tae atu ki te 12 nga wahitau OD kia samparahi.

uint32_t

putanga

He putanga o te hanganga.

uint32_t

roangaMirihekona

Sampte roanga o te ms, mai i te 1 ki te 65535

uint16_t

wāMirihekona

Sampling wā i roto i ms.

uint16_t

numberOfSamples

Sampiti te nui.

uint16_t

preTriggerNumberOfSamples

Sampte nui i mua i te keu.

poka

whakamahiSoftwareImplementation

Whakamahia te whakatinanatanga rorohiko.

poka

whakamahiNewFWSamplerImplementation Whakamahia te whakatinanatanga FW mo nga taputapu whai a

Putanga FW v24xx hou ake ranei.

SampLerMode

aratau

Pūnoa, tukurua, haere tonu sampling

SamplerTriggerCondition triggerCondition

Tīmatahia nga tikanga whakaoho: TC_FALSE = 0x00 TC_TRUE = 0x01 TC_SET = 0x10 TC_CLEAR = 0x11 TC_RISING_EDGE = 0x12 TC_FALLING_EDGE = 0x13 TC_BIT_TOGGLE_GREATER = 0x14 =_TCx0GREATER = 15x0 TC_LESS = 16x0 TC_LESS_OR_EQUAL = 17x0 TC_EQUAL = 18x0 TC_NOT_EQUAL = 19x0A TC_ONE_EDGE = 1x0B TC_MULTI_EDGE = 1x0C, Odaluedex, keuV

SamplerTrigger

SamplerTrigger

He keu hei timata heiampler?

Nga huanga a te iwi whanui
te rahi constexpr pateko_t SAMPLER_CONFIGURATION_VERSION = 0x01000000 constexpr pateko rahi_t MAX_TRACKED_ADDRESSES = 12
8.36 SamplerNotify
Whakamahia tenei akomanga ki te whakahohe sampLer whakamōhiotanga ka timata koe heiampler. Kei te karaehe nga mahi mema a te iwi e whai ake nei.

Putanga: doc 1.4.2 / NanoLib 1.3.0

56

8 Tohutoro akomanga / mahi

whakamōhio ()
Ka tukuna he urunga whakamohiotanga.
korekore mariko nlc::SamplerNotify::notify (const ResultVoid & lastError, const SamplerState samplerState, const std::vector <SampleData> & sampleDatas, int64_t applicationData)

Tawhā [i] LastHapa [i] samplerState
[i] sampleDatas [i] applicationData

Ka ripoata te hapa whakamutunga i puta i te wa sampling. Ka ripoata nga sampte mana i te wa whakamohiotanga: Kaore i whirihorahia / Whakaritea / Riri / Rere / Kua oti / Rahua / Whakakore. Ka ripoata nga sampte raupapa raraunga-arahi. Pūrongo raraunga tauwhāiti tono.

8.37 SampHanganga leData

Kei roto i tenei hanganga nga sampraraunga arahina.

uin64_t IterationNumber

Ka timata i te 0 ka piki noa i te aratau tukurua.

std::vector<SampledValues> Kei roto ia te huinga o sampuara arahina.

8.38 Samphanganga LedValue

Kei roto i tenei hanganga nga sampuara arahina.

in64_t uara uin64_t CollectTimeMsec

Kei roto te uara o tetahi wahitau OD kua aroturukihia.
Kei roto ko te wa kohikohi i roto i nga mitamano, e pa ana ki te sampte timatanga.

8.39 SampLerTrigger hanganga

Kei roto i tenei hanganga nga tautuhinga keu o te sampler

SampLerTriggerCondition huru
OdIndex uin32_t uara

Te huru keu: TC_FALSE = 0x00 TC_TRUE = 0x01 TC_SET = 0x10 TC_CLEAR = 0x11 TC_RISING_EDGE = 0x12 TC_FALLING_EDGE = 0x13 TC_BIT_TOGGLE = 0x14 = TC_GREATER = 0x15 = TC_GREATER 0x16 TC_LESS = 0x17 TC_LESS_OR_EQUAL = 0x18 TC_EQUAL = 0x19 TC_NOT_EQUAL = 0x1A TC_ONE_EDGE = 0x1B TC_MULTI_EDGE = 0x1C
Ko te OdIndex (wāhitau) o te keu.
Uara huru, tau moka ranei (mai i te moka kore).

8.40 Hanganga raupapa

Rapua i konei o whiringa korero rangatū me nga huanga whanui e whai ake nei:

const std::string const SerialBaudRate

BAUD_RATE_OPTIONS_NAME = “Reeti baud rangatū” baudRate =Hanganga RangatūBaudRate

Putanga: doc 1.4.2 / NanoLib 1.3.0

57

8 Tohutoro akomanga / mahi

const std::string const SerialParity

PARITY_OPTIONS_NAME = “raupapa rangatū” parerite = Rangaranga Parity

8.41 Hangarau SerialBaudRate

Rapua i konei to reeti korero rangatū me nga huanga whanui e whai ake nei:

const std::string const std::string const std::string const std::string const std::string const std::string const std::string const std::string const std::string const std::string

BAUD_RATE_7200 = “7200” BAUD_RATE_9600 = “9600” BAUD_RATE_14400 = “14400” BAUD_RATE_19200 = “19200” BAUD_RATE_38400 = “38400” BAUD_RATE_56000 56000” BAUD_RATE_57600 = “57600” BAUD_RATE_115200 = “115200” BAUD_RATE_128000 = “128000”

8.42 Hanganga RangatūParity

Kimihia i konei o whiringa taurite rangatū me nga huanga whanui e whai ake nei:

const std::string const std::string const std::string const std::string const std::string

KORE = "kore" ODD = "odd" EVEN = "even" MARK = "tohu" SPACE = "waahi"

Putanga: doc 1.4.2 / NanoLib 1.3.0

58

9 Raihana

9 Raihana

Nga pane atanga API NanoLib me te exampKo te waehere puna he raihana e Nanotec Electronic GmbH & Co. KG i raro i te Creative Commons Attribution 3.0 Unported License (CC BY). Ko nga waahanga whare pukapuka e whakaratohia ana i roto i te whakatakotoranga-rua (nga whare pukapuka matua me te fieldbus korero) he raihana i raro i te Creative Commons AttributionNoDerivatives 4.0 International License (CC BY ND).

Creative Commons
Ko te whakarāpopototanga ka taea e te tangata e whai ake nei ka kore e whakakapi i te(ng) raihana ake. Ka kitea e koe te raihana i creativecommons.org me te hono i raro. E waatea ana koe ki te:

CC NA 3.0
Tiri: Tirohia matau. Urutau: Remix, huri, me te hanga i runga i te
rauemi mo tetahi kaupapa, ahakoa mo te hokohoko.

CC BY-ND 4.0
Tiri: Tāruahia ka tohatoha ano i te rauemi ki tetahi momo reo, ahua ranei.

Kaore e taea e te kaituku raihana te whakakore i nga herekoretanga i runga ake nei mena ka whakarongo koe ki nga tikanga raihana e whai ake nei:

CC NA 3.0

CC BY-ND 4.0

Tohunga: Me tuku nama e tika ana, Tohunga: Tirohia te taha maui. Engari: Homai he hononga ki tenei

hoatu he hononga ki te raihana, ka tohu mena

atu raihana.

i mahia nga huringa. Ka taea e koe te mahi i roto i tetahi

Kore he pärönaki: Mena ka whakakotahi koe, ka huri, ka hanga ranei

tikanga tika, engari kaua rawa e kii

i runga i nga rauemi, kaore pea koe e tohatoha i te

ka tohu te kaiwhakawhiwhi raihana ki a koe me to whakamahi ranei.

rauemi whakarerekē.

Kaore he here taapiri: Kaore pea koe e tono Kare he here taapiri: Tirohia te taha maui. ture ture ranei mehua hangarau e ture

aukati i etahi atu ki te mahi i tetahi mea i te raihana

whakaaetanga.

Tuhipoka: Kaore koe e whai ki te whai raihana mo nga waahanga o te rauemi kei te rohe whanui, i te waahi ranei e whakaaetia ana to whakamahi e tetahi tuunga, herenga ranei.
Tuhipoka: Karekau he whakamana i hoatu. Kaore pea te raihana e hoatu ki a koe nga whakaaetanga katoa e tika ana kia whakamahia e koe. Mo te exampKo etahi atu motika penei i te panui, te muna, me te mana morare ka taea te whakaiti i to whakamahi i nga rawa.

Putanga: doc 1.4.2 / NanoLib 1.3.0

59

Tohu, whakapā, putanga

©2024 Nanotec Electronic GmbH & Co.KGKapellenstr.685622 FeldkirchenGermanyTel.+49(0) 89 900 686-0Waeatuhi+49(0)89 900 686-50 info@nanotec.dewww.nanotec.com Katoa nga mana. Ka taea te whakarereke i te hapa, te whakakore, te hangarau, te ihirangi me te kore panui. Ko nga waitohu/hua kua whakahuahia he tohu hokohoko na o ratou rangatira, me pera ano. Putanga taketake.

Tuhinga 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

+ Apitihia > Hurihia # Whakaritea > Mahi ano o te ex kua whakaratohiaamples.
+ NanoLib Modbus: Kua taapirihia te taputapu maukati mo te Modbus VCP. # NanoLib Core: Tirotiro ahua hononga pumau. # Waehere NanoLib: Kua whakatikahia te tango tohutoro taputapu pahi.
+ NanoLib-CANopen: Tautoko mo te Peak PCAN-USB adapter (IPEH-002021/002022).
> NanoLib Core: Hurihia te atanga waea whakahoki takiuru (Kua whakakapihia e LogModule). # NanoLib Logger: Kua whakatikahia te wehenga i waenga i te matua me nga waahanga. # Modbus TCP: Whakahoutanga firmware mo te FW4. # EtherCAT: Kua whakatika te tukunga kaupapa NanoJ mo Core5. # EtherCAT: Whakahoutanga firmware mo Core5.
# Modbus RTU: Kua whakatikahia nga take o te waa me te iti o nga reeti baud i te waa whakahou firmware. # RESTful: Kua whakatika te tukunga kaupapa NanoJ.
# NanoLib Kōwae Sampler: He panui tika o samparahina uara boolean.
+ Tautoko Java 11 mo nga papaaho katoa. + Tautoko Python 3.11/3.12 mo nga papaaho katoa. + Atanga waea waea hou (tirohia te exampiti). + Ka totohu hoki te waea mo te NanoLib Logger. > Whakahouhia te kairakau ki te putanga 1.12.0. > NanoLib Kōwae Sampler: Tautoko inaianei mo Nanotec pūmana mārō v24xx. > NanoLib Kōwae Sampler: Hurihia te hanganga i whakamahia mo sampte whirihoranga. > NanoLib Kōwae Sampler: Ko te aratau haere tonu he rite ki te mutunga; kotahi te tirotiro i te ahuatanga o te keu; te maha o sampme 0. > NanoLib Modules Sampler: Ko te kaupapa matua mo te miro e kohi raraunga i roto i te aratau firmware. > NanoLib Kōwae Sampler: Tuhituhi ano te hātepee hei kite i te whakawhiti i waenga i te ahua Riri me te Whakahaere. # NanoLib Core: Karekau he takahi uru atu (0xC0000005) ki te kati i te 2 neke atu ranei nga taputapu ma te whakamahi i te taputapu pahi kotahi. # NanoLib Core: Kore ake te he o te Wehewehenga i runga i te taapiri i te urutau PEAK i raro i te Linux. # NanoLib Kōwae Sampler: Tika sampte panui uara-arahi i roto i te aratau firmware. # NanoLib Kōwae Sampler: Tika whirihoranga o 502X:04. # NanoLib Kōwae Sampler: He tika te whakakotahitanga o nga parepare me nga hongere. # NanoLib-Canopen: Kua piki ake nga wa CAN mo te pakari me te matawai tika i nga reeti iti. # NanoLib-Modbus: VCP detection algorithm mo nga taputapu motuhake (USB-DA-IO).
+ Tautoko EtherCAT.
+ Kia mahara ki nga tautuhinga kaupapa VS i roto i te Whirihorahia to kaupapa.
+ tikiDeviceHardwareGroup (). + getProfinetDCP (kei te waatea te ratonga). + getProfinetDCP (whakamanaProfinetDeviceIp). + AutoAssignObjectDictionary (). + tikiXmlFileIngoa (). + const std::string & xmlFileAra i roto i te addObjectDictionary (). + whiwhiSamplerAtanga ().

Hua 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)

Putanga: doc 1.4.2 / NanoLib 1.3.0

60

10 Tohu, whakapā, putanga

Tuhinga
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

+ Apitihia > Hurihia # Whakatika + rebootDevice (). + Waehere hapa ResourceUnavailable mo getDeviceBootloaderVersion (), ~VendorId (), ~HardwareVersion (), ~SerialNumber, me ~Uid. > firmwareUploadFromFile inaianei tukuatuFirmwareFromFile (). > firmwareUpload () now uploadFirmware (). > bootloaderUploadFromFile () inaianei uploadBootloaderFromFile (). > bootloaderUpload () inaianei uploadBootloader (). > bootloaderFirmwareUploadFromFile () ki te uploadBootloaderFirmwareFromFile (). > bootloaderFirmwareUpload () inaianei uploadBootloaderFirmware (). > nanojUploadFromFile () inaianei uploadNanoJFromFile (). > nanojUpload () inaianei uploadNanoJ (). > objectDictionaryLibrary () inaianei tikiObjectDictionaryLibrary (). > String_String_Map inianei StringStringMap. > NanoLib-Common: he tere ake te mahi o listAvailableBusHardware me te OpenBusHardwareWithProtocol me te urutau Ixxat. > NanoLib-CANopen: ka whakamahia nga tautuhinga taunoa (1000k baudrate, Ixxat bus number 0) mena kei te waatea nga whiringa taputapu pahi. > NanoLib-RESTful: kua tawhito te whakaaetanga a te kaiwhakahaere mo te whakawhitiwhiti korero me nga kaitautauta Ethernet i raro i te Matapihi mena kei te waatea te taraiwa npcap / winpcap. # NanoLib-CANopen: ka tuwhera nga taputapu pahi inaianei me nga whiringa kore. # NanoLib-Common: openBusHardwareWithProtocol () karekau he reinga mahara inaianei.
+ Tautoko Linux ARM64. + Tautoko papatipu USB / REST / Profinet DCP. + takiConnectionState (). + tikiDeviceBootloaderVersion (). + ResultProfinetDevices. + NlcErrorCode (kua whakakapia NanotecExceptions). + NanoLib Modbus: VCP / USB hub whakakotahi ki USB. > Modbus TCP matawai ka whakahoki hua. < Kei te noho tonu te roanga korero a Modbus TCP.
+ Ētahi atu ObjectEntryDataType (matatini me te profile-motuhake). + IOError ka hoki mai mena ka kore e kitea e te ConnectDevice () me nga ScanDevices () tetahi. + 100 ms anake te waahi whakaingoa mo CanOpen / Modbus.
+ Tautoko Modbus (me te USB Hub ma te VCP). + Upoko Te hanga i to ake kaupapa Linux. + extraHardwareSpecifier ki BusHardwareId (). + extraId_ me extraStringId_ ki DeviceId ().
+ setBusState (). + tikiDeviceBootloaderBuildId (). + tikiDeviceFirmwareBuildId (). + tikiDeviceHardwareVersion (). # Whakatikanga bug.
Putanga.

Hua
0.8.0 0.7.1 0.7.0 0.5.1 0.5.1

Putanga: doc 1.4.2 / NanoLib 1.3.0

61

Tuhinga / Rauemi

Nanotic NanoLib C++ Papatonotanga [pdf] Pukapuka Kaiwhakamahi
NanoLib C Papatonotanga, C Papatonotanga, Papatonotanga

Tohutoro

Waiho he korero

Ka kore e whakaputaina to wahitau imeera. Kua tohua nga mara e hiahiatia ana *