Nanotic NanoLib C++ Programming
Produktaj Informoj
Specifoj
- Produkta Nomo: NanoLib
- Programado Language: C++
- Produkta Versio: 1.3.0
- Uzanta Manlibro Versio: 1.4.2
The NanoLib library is designed for programming control software for Nanotec controllers. It provides a user interface, core functionalities, and communication libraries to facilitate the development of control applications.
Produktaj Uzado-Instrukcioj
- Antaŭ ol Vi Komencu:
- Ensure that your system meets the hardware requirements specified in the manual. The intended audience for this product includes developers looking to create control software for Nanotec controllers.
- Komencante:
- To begin using NanoLib, follow these steps:
- Start by importing NanoLib into your project.
- Configure your project settings as needed.
- Build your project to incorporate NanoLib functionalities.
- Creating Projects:
- You can create projects for both Windows and Linux environments. Follow the specific instructions provided in the manual for each platform.
- Classes / Functions Reference:
- Refer to the user manual for a detailed guide on the classes and functions available in NanoLib for programming control software.
Oftaj Demandoj
- Q: What is the purpose of NanoLib?
- A: NanoLib is a library for programming control software for Nanotec controllers, providing essential functionalities and communication capabilities.
- Q: How can I get started with NanoLib?
- A: Begin by importing NanoLib into your project, configuring project settings, and building your project to utilize NanoLib features.
“`
Manlibro de uzanto NanoLib
C++
Valida kun produkta versio 1.3.0
Uzanta Manlibro Versio: 1.4.2
Dokumentu celon kaj konvenciojn
Ĉi tiu dokumento priskribas la aranĝon kaj uzon de la biblioteko NanoLib kaj enhavas referencon al ĉiuj klasoj kaj funkcioj por programi vian propran kontrolprogramaron por Nanotec-regiloj. Ni uzas la jenajn tiparojn:
Substrekita teksto markas krucreferencon aŭ hiperligon.
Example 1: Por precizaj instrukcioj pri la NanoLibAccessor, vidu Agordo. Ekzample 2: Instalu la Ixxat-ŝoforon kaj konektu la CAN-al-USB-adaptilon. Kursiva teksto signifas: Ĉi tio estas nomita objekto, menuvojo / ero, langeto / file nomo aŭ (se necese) fremdlingva esprimo.
Example 1: Elektu File > Nova > Blanka Dokumento. Malfermu la langeton Ilo kaj elektu Komento. Ekzample 2: Ĉi tiu dokumento disigas uzantojn (= Nutzer; usuario; uzanto; utilisateur; uzanto ktp.) de:
– Tria uzanto (= Drittnutzer; tercero usuario; terzo utente; tiers utilisateur; terzo utente ktp.). – Fina uzanto (= Endnutzer; usuario final; utente final; utilisateur final; utente finale ktp.).
Kuriero markas kodblokojn aŭ programajn komandojn. Ekzample 1: Per Bash, voku sudo make install por kopii komunajn objektojn; poste voku ldconfig. Ekzample 2: Uzu la sekvan NanoLibAccessor-funkcion por ŝanĝi la registran nivelon en NanoLib:
// ***** C++-variaĵo *****
void setLoggingLevel(LogLevel-nivelo);
Grada teksto emfazas individuajn vortojn de kritika graveco. Alternative, interkrampitaj ekkriaj signoj emfazas la kritikan(!) gravecon.
Example 1: Protektu vin, aliajn kaj vian ekipaĵon. Sekvu niajn ĝeneralajn sekurecajn notojn, kiuj ĝenerale validas por ĉiuj Nanotec-produktoj.
Example 2: Por via propra protekto, ankaŭ sekvu specifajn sekurecajn notojn kiuj validas por ĉi tiu specifa produkto. La verbo kunklaki signifas klakon per malĉefa musklavo por malfermi kuntekstan menuon ktp.
Example 1: Kunklaku sur la file, elektu Alinomi, kaj renomu la file. Ekzample 2: Por kontroli la ecojn, kunklaku sur la file kaj elektu Proprietoj.
Versio: doc 1.4.2 / NanoLib 1.3.0
4
Antaŭ ol vi komencu
Antaŭ ol vi ekuzi NanoLib, pretigu vian komputilon kaj informu vin pri la celita uzo kaj la bibliotekaj limigoj.
2.1 Postuloj pri sistemo kaj aparataro
NOTICE Malfunction from 32-bit operation or discontinued system! Use, and consistently maintain, a 64-bit system. Observe OEM discontinuations and ~instructions.
NanoLib 1.3.0 supports all Nanotec products with CANopen, Modbus RTU (also USB on virtual com port), Modbus TCP, EtherCat, and Profinet. For older NanoLibs: See changelog in the imprint. At your risk only: legacy-system use. Note: Follow valid OEM instructions to set the latency as low as possible if you face problems when using an FTDI-based USB adapter.
Postuloj (64-bita sistemo deviga)
Windows 10 or 11 w/ Visual Studio 2019 version 16.8 or later and Windows SDK 10.0.20348.0 (version 2104) or later
C++ redistributables 2017 or higher CANopen: Ixxat VCI or PCAN basic driver (optional) EtherCat module / Profinet DCP: Npcap or WinPcap RESTful module: Npcap, WinPcap, or admin permission to
communicate w/ Ethernet bootloaders
Linux w/ Ubuntu 20.04 LTS to 24 (all x64 and arm64)
Kernel headers and libpopt-dev packet Profinet DCP: CAP_NET_ADMIN and CAP_NET_RAW abili-
ties CANopen: Ixxat ECI driver or Peak PCAN-USB adapter EtherCat: CAP_NET_ADMIN, CAP_NET_RAW and
CAP_SYS_NICE abilities RESTful: CAP_NET_ADMIN ability to communicate w/ Eth-
ernet bootloaders (also recommended: CAP_NET_RAW)
Language, fieldbus adapters, cables
C++ GCC 7 or higher (Linux)
EtherCAT: Ethernet cable VCP / USB hub: now uniform USB USB mass storage: USB cable REST: Ethernet cable CANopen: Ixxat USB-to-CAN V2; Na-
notec ZK-USB-CAN-1, Peak PCANUSB adapter No Ixxat support for Ubuntu on arm64
Modbus RTU: Nanotec ZK-USB-RS485-1 or equivalent adapter; USB cable on virtual com port (VCP)
Modbus TCP: Ethernet cable as per product datasheet
2.2 Intencita uzo kaj spektantaro
NanoLib estas programa biblioteko kaj programaro por la funkciado kaj komunikado kun Nanotec-regiloj en ampleksa gamo de industriaj aplikoj kaj nur por taŭge spertaj programistoj.
Due to real-time incapable hardware (PC) and operating system, NanoLib is not for use in applications that need synchronous multi-axis movement or are generally time-sensitive.
In no case may you integrate NanoLib as a safety component into a product or system. On delivery to end users, you must add corresponding warning notices and instructions for safe use and safe operation to each product with a Nanotec-manufactured component. You must pass all Nanotec-issued warning notices right to the end user.
2.3 Amplekso de livero kaj garantio
NanoLib venas kiel *.zip dosierujo de nia elŝuto webretejo por EMEA/APAC aŭ AMERIKO. Konvene konservu kaj malzimpu vian elŝuton antaŭ agordo. La pako NanoLib enhavas:
Versio: doc 1.4.2 / NanoLib 1.3.0
5
2 Antaŭ ol komenci
Interface headers as source code (API)
Core functions as libraries in binary format: nano-
Libraries that facilitate communication: nanolibm_ lib.dll
[yourfieldbus].dll etc.Example project: Example.sln (Visual Studio
project) and example.cpp (main file)
For scope of warranty, please observe a) our terms and conditions for either EMEA / APAC or AMERICA and b) all license terms. Note: Nanotec is not liable for faulty or undue quality, handling, installation, operation, use, and maintenance of third-party equipment! For due safety, always follow valid OEM instructions.
Versio: doc 1.4.2 / NanoLib 1.3.0
6
La NanoLib-arkitekturo
La modula programara strukturo de NanoLib ebligas al vi aranĝi libere agordeblajn motorregilojn/kampbusajn funkciojn ĉirkaŭ strikte antaŭkonstruita kerno. NanoLib enhavas la sekvajn modulojn:
Uzantinterfaco (API)
NanoLib-kerno
Interfaco kaj helpklasoj kiuj Bibliotekoj kiuj
Komunikaj bibliotekoj Fieldbus-specifaj bibliotekoj kiuj
aliru vin al la efektivigo de via regilo la API-funkcion fari interfacon inter NanoLib
OD (objekta vortaro)
interagi kun busbibliotekoj.
kerna kaj busa aparataro.
bazu sur la kernfunkcio de NanoLib
nacioj.
3.1 Uzantinterfaco
La uzantinterfaco konsistas el kapinterfaco files you can use to access the controller parameters. The user interface classes as described in the Classes / functions reference allow you to:
Connect to both the hardware (fieldbus adapter) and the controller device. Access the OD of the device, to read/write the controller parameters.
3.2 NanoLib-kerno
The NanoLib core comes with the import library nanolib.lib. It implements the user interface functionality and is responsible for:
Loading and managing the communication libraries. Providing the user interface functionalities in the NanoLibAccessor. This communication entry point de-
monpunas aron da operacioj, kiujn vi povas plenumi sur la kernaj kaj komunikaj bibliotekoj de NanoLib.
3.3 Komunikaj bibliotekoj
Krom nanotec.services.nanolib.dll (utila por via laŭvola Plug & Drive Studio), NanoLib ofertas la jenajn komunikajn bibliotekojn:
nanolibm_canopen.dll nanolibm_modbus.dll
nanolibm_ethercat.dll nanolibm_restful-api.dll
nanolibm_usbmmsc.dll nanolibm_profinet.dll
Ĉiuj bibliotekoj metas hardvarabstraktan tavolon inter kerno kaj regilo. La kerno ŝarĝas ilin ĉe ekfunkciigo de la elektita projekta dosierujo kaj uzas ilin por establi komunikadon kun la regilo per responda protokolo.
Versio: doc 1.4.2 / NanoLib 1.3.0
7
Komencante
Legu kiel agordi NanoLib por via operaciumo ĝuste kaj kiel konekti aparataron laŭbezone.
4.1 Preparu vian sistemon
Before installing the adapter drivers, do prepare your PC along the operating system first. To prepare the PC along your Windows OS, install MS Visual Studio with C++ extensions. To install make and gcc by Linux Bash, call sudo apt install build-essentials. Do then enable CAP_NET_ADMIN, CAP_NET_RAW, and CAP_SYS_NICE capabilities for the application that uses NanoLib: 1. Call sudo setcap ‘cap_net_admin,cap_net_raw,cap_sys_nice+eip’ <application_
nomo>. 2. Nur tiam, instalu viajn adaptilojn.
4.2 Install the Ixxat adapter driver for Windows
Only after due driver installation, you may use Ixxat’s USB-to-CAN V2 adapter. Read the USB drives’ product manual, to learn if / how to activate the virtual comport (VCP). 1. Download and install Ixxat’s VCI 4 driver for Windows from www.ixxat.com. 2. Connect Ixxat’s USB-to-CAN V2 compact adapter to the PC via USB. 3. By Device Manager: Check if both driver and adapter are duly installed/recognized.
4.3 Install the Peak adapter driver for Windows
Only after due driver installation, you may use Peak’s PCAN-USB adapter. Read the USB drives’ product manual, to learn if / how to activate the virtual comport (VCP). 1. Download and install the Windows device driver setup (= installation package w/ device drivers, tools, and
APIs) from http://www.peak-system.com. 2. Connect Peak’s PCAN-USB adapter to the PC via USB. 3. By Device Manager: Check if both driver and adapter are duly installed/recognized.
4.4 Install the Ixxat adapter driver for Linux
Only after due driver installation, you may use Ixxat’s USB-to-CAN V2 adapter. Note: Other supported adapters need your permissions by sudo chmod +777/dev/ttyACM* (* device number). Read the USB drives’ product manual, to learn if / how to activate the virtual comport (VCP). 1. Install the software needed for the ECI driver and demo application:
sudo apt-get update apt-get install libusb-1.0-0-dev libusb-0.1-4 libc6 libstdc++6 libgcc1 buildessential
2. Download the ECI-for-Linux driver from www.ixxat.com. Unzip it via:
unzip eci_driver_linux_amd64.zip
3. Install the driver via:
cd /EciLinux_amd/src/KernelModule sudo make install-usb
4. Check for successful driver installation by compiling and starting the demo application:
cd /EciLinux_amd/src/EciDemos/ sudo make cd /EciLinux_amd/bin/release/ ./LinuxEciDemo
Versio: doc 1.4.2 / NanoLib 1.3.0
8
4 Komencante
4.5 Install the Peak adapter driver for Linux
Only after due driver installation, you may use Peak’s PCAN-USB adapter. Note: Other supported adapters need your permissions by sudo chmod +777/dev/ttyACM* (* device number). Read the USB drives’ product manual, to learn if / how to activate the virtual comport (VCP). 1. Check if your Linux has kernel headers: ls /usr/src/linux-headers-`uname -r`. If not, install
them: sudo apt-get install linux-headers-`uname -r` 2. Only now, install the libpopt-dev packet: sudo apt-get install libpopt-dev 3. Download the needed driver package (peak-linux-driver-xxx.tar.gz) from www.peak-system.com. 4. To unpack it, use: tar xzf peak-linux-driver-xxx.tar.gz 5. In the unpacked folder: Compile and install the drivers, PCAN base library, etc.: make all
sudo make install 6. To check the function, plug the PCAN-USB adapter in.
a) Check the kernel module:
lsmod | grep pcan b) … and the shared library:
ls -l /usr/lib/libpcan*
Note: If USB3 problems occur, use a USB2 port.
4.6 Konektu vian aparataron
To be able to run a NanoLib project, connect a compatible Nanotec controller to the PC using your adapter. 1. By a suitable cable, connect your adapter to the controller. 2. Connect the adapter to the PC according to the adapter data sheet. 3. Power on the controller using a suitable power supply. 4. If needed, change the Nanotec controller’s communication settings as instructed in its product manual.
4.7 Ŝargi NanoLib
Por unua komenco kun rapidaj kaj facilaj bazaĵoj, vi povas (sed ne devas) uzi nian eksample projekto. 1. Depende de via regiono: Elŝutu NanoLib de nia webretejo por EMEA/APAC aŭ AMERIKO. 2. Malfermu la pakaĵon files / dosierujoj kaj elektu unu opcion: Por rapidaj kaj facilaj bazaĵoj: Vidu Komenci la eksample project. For advanced customizing in Windows: See Creating your own Windows project. For advanced customizing in Linux: See Creating your own Linux project.
Versio: doc 1.4.2 / NanoLib 1.3.0
9
Komencante la eksample projekto
Kun NanoLib laŭregule ŝarĝita, la eksampla projekto montras al vi la uzadon de NanoLib per Nanotec-regilo. Noto: Por ĉiu paŝo, komentoj en la provizita ekzampla kodo klarigas la uzatajn funkciojn. La eksample project consists of: the `*_functions_example.*’ files, which contain the implementations for the NanoLib interface functions the `*_callback_example.*’ files, which contain implementations for the various callbacks (scan, data and
logging) the `menu_*.*’ file, which contains the menu logic and code the Example.* file, which is the main program, creating the menu and initializing all used parameters the Sampler_example.* file, which contains the example implementation for sampler usage. You can find more examples, with some motion commands for various operation modes, in the Knowledge Base at nanotec.com. All are usable in Windows or Linux.
In Windows with Visual Studio 1. Open the Example.sln file. 2. Open the example.cpp. 3. Compile and run the example kodo.
In Linux via Bash 1. Unzip the source file, navigate to the folder with unzipped content. The main file por la eksample is
example.cpp. 2. In the bash, call:
a. “sudo make install” to copy the shared objects and call ldconfig. b. “make all” to build the test executable. 3. The bin folder contains an executable example file. By bash: Go to the output folder and type ./example. If no error occurs, your shared objects are now duly installed, and your library is ready for use. If the error reads ./example: error while loading shared libraries: libnanolib.so: cannot open shared object file: No such file or directory, the shared objects’ installation failed. In this case, follow the next steps. 4. Create a new folder within /usr/local/lib (admin rights needed). Into the bash, thus type:
sudo mkdir /usr/local/lib/nanotec
5. Copy all shared objects from the zip file’s lib folder:
install ./lib/*.so /usr/local/lib/nanotec/
6. Check the content of the target folder with:
ls -al /usr/local/lib/nanotec/
It should list the shared object files from the lib folder. 7. Run ldconfig on this folder:
sudo ldconfig /usr/local/lib/nanotec/
La eksample is implemented as a CLI application and provides a menu interface. The menu entries are context based and will be enabled or disabled, depending on the context state. They offer you the possibility to select and execute various library functions following the typical workflow for handling a controller: 1. Check the PC for connected hardware (adapters) and list them. 2. Establish connection to an adapter. 3. Scan the bus for connected controller devices. 4. Connect to a device.
Versio: doc 1.4.2 / NanoLib 1.3.0
10
5 Komencante la eksample projekto
5. Test one or more of the library functions: Read/write from/to the controller’s object dictionary, update the firmware, upload and run a NanoJ program, get the motor running and tune it, configure and use the logging/sampler.
6. Close the connection, first to the device, then to the adapter.
Versio: doc 1.4.2 / NanoLib 1.3.0
11
Creating your own Windows project
Create, compile and run your own Windows project to use NanoLib.
6.1 Import NanoLib
Import the NanoLib header files and libraries via MS Visual Studio.
1. Open Visual Studio. 2. Via Create new project > Console App C++ > Next: Select a project type. 3. Name your project (here: NanolibTest) to create a project folder in the Solution Explorer. 4. Select Finish. 5. Open the windows file explorer and navigate to the new created project folder. 6. Create two new folders, inc and lib. 7. Open the NanoLib package folder. 8. From there: Copy the header files from the include folder into your project folder inc and all .lib and .dll
files to your new project folder lib. 9. Check your project folder for due structure, for example:
ect folder for due structure:
. 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.vcxproj.user NanolibTest.sln
6.2 Configure your project
Use the Solution Explorer in MS Visual Studio to set up NanoLib projects. Note: For correct NanoLib operation, select the release (not debug!) configuration in Visual C++ project settings; then build and link the project with VC runtimes of C++ redistributables [2022].
1. In the Solution Explorer: Go to your project folder (here: NanolibTest). 2. Co-click the folder to open the context menu. 3. Select Properties. 4. Activate All configurations and All platforms. 5. Select C/C++ and go to Additional Include Directories. 6. Insert: $(ProjectDir)Nanolib/includes;%(AdditionalIncludeDirectories) 7. Select Linker and go to Additional Library Directories. 8. Insert: $(ProjectDir)Nanolib;%(AdditionalLibraryDirectories) 9. Extend Linker and select Input. 10.Go to Additional Dependencies and insert: nanolib.lib;%(AdditionalDependencies) 11.Confirm via OK.
Versio: doc 1.4.2 / NanoLib 1.3.0
12
6 Creating your own Windows project
12.Go to Configuration > C++ > Language > Language Standard > ISO C++17 Standard and set the language standard to C++17 (/std:c++17).
6.3 Build your project
Build your NanoLib project in MS Visual Studio. 1. Open the main *.cpp file (here: nanolib_example.cpp) and edit the code, if needs be. 2. Select Build > Configuration Manager. 3. Change Active solution platforms to x64. 4. Confirm via Close. 5. Select Build > Build solution. 6. No error? Check if your compile output duly reports:
1>—— Clean started: Project: NanolibTest, Configuration: Debug x64 —–========== Clean: 1 succeeded, 0 failed, 0 skipped ==========
Versio: doc 1.4.2 / NanoLib 1.3.0
13
7 Creating your own Linux project
7 Creating your own Linux project
Create, compile and run your own Linux project to use NanoLib. 1. In the unzipped NanoLib installation kit: Open <root>/nanotec_nanolib. 2. Find all shared objects in the tar.gz file. 3. Select one option: Install each lib either with a Makefile or by hand.
7.1 Install the shared objects with Makefile
Use Makefile with Linux Bash to auto-install all default *.so files. 1. Via Bash: Go to the folder containing the makefile. 2. Copy the shared objects via:
sudo make install 3. Confirm via:
ldconfig
7.2 Install the shared objects by hand
Use a Bash to install all *.so files of NanoLib manually. 1. Via Bash: Create a new folder within /usr/local/lib. 2. Admin rights needed! Type:
sudo mkdir /usr/local/lib/nanotec 3. Change to the unzipped installation package folder. 4. Copy all shared objects from the lib folder via:
install ./nanotec_nanolib/lib/*.so /usr/local/lib/nanotec/ 5. Check the content of the target folder via:
ls -al /usr/local/lib/nanotec/ 6. Check if all shared objects from the lib folder are listed. 7. Run ldconfig on this folder via:
sudo ldconfig /usr/local/lib/nanotec/
7.3 Create your project
With your shared objects installed: Create a new project for your Linux NanoLib. 1. Via Bash: Create a new project folder (here: NanoLibTest) via:
mkdir NanoLibTest cd NanoLibTest
2. Copy the header files to an include folder (here: inc) via: mkdir inc cp /<PLACE WHERE THE CONTENT OF THE ZIP FILE IS>/nanotec_nanolib/inc/*.hpp inc
3. Create a main file (NanoLibTest.cpp) via: #include “accessor_factory.hpp” #include <iostream>
Versio: doc 1.4.2 / NanoLib 1.3.0
14
7 Creating your own Linux project
int main(){ nlc::NanoLibAccessor *accessor = getNanoLibAccessor();
nlc::ResultBusHwIds result = accessor->listAvailableBusHardware();
if(result.hasError()) { std::cout << result.getError() << std::endl; }
else{ std::cout << “Success” << std::endl; }
delete accessor; return 0; }
4. Check your project folder for due structure:
. NanoLibTest
inc accessor_factory.hpp bus_hardware_id.hpp … od_index.hpp result.hpp NanoLibTest.cpp
7.4 Compile and test your project
Make your Linux NanoLib ready for use via Bash.
1. Via Bash: Compile the main file per:
g++ -Wall -Wextra -pedantic -I./inc -c NanoLibTest.cpp -o NanoLibTest
2. Link the executable together via:
g++ -Wall -Wextra -pedantic -I./inc -o test NanoLibTest.o L/usr/local/lib/nanotec -lnanolib -ldl
3. Run the test program via:
./test
4. Check if your Bash duly reports:
sukceson
Versio: doc 1.4.2 / NanoLib 1.3.0
15
8 Klasoj / funkcioj referenco
8 Klasoj / funkcioj referenco
Trovu ĉi tie liston de la uzantinterfacaj klasoj de NanoLib kaj iliaj membrofunkcioj. La tipa priskribo de funkcio inkluzivas mallongan enkondukon, la funkciodifinon kaj parametron/revenan liston:
ExampleFunction () Rakontas al vi mallonge, kion faras la funkcio.
virtual void nlc::NanoLibAccessor::ExampleFunction (Param_a const & param_a, Param_b const & param_B)
Parametroj param_a param_b
Revenas ResultVoid
Kroma komento se necese. Kroma komento se necese.
8.1 NanoLibAccessor
Interfacklaso uzata kiel enirpunkto al la NanoLib. Tipa laborfluo aspektas jene:
1. Komencu skanante aparataron per NanoLibAccessor.listAvailableBusHardware (). 2. Agordu la komunikajn agordojn per BusHardwareOptions (). 3. Malfermu la aparatan konekton kun NanoLibAccessor.openBusHardwareWithProtocol (). 4. Skanu la buson por konektitaj aparatoj kun NanoLibAccessor.scanDevices (). 5. Aldonu aparaton kun NanoLibAccessor.addDevice (). 6. Konektu al la aparato kun NanoLibAccessor.connectDevice (). 7. Fininte la operacion, malkonekti la aparaton per NanoLibAccessor.disconnectDevice (). 8. Forigu la aparaton per NanoLibAccessor.removeDevice (). 9. Fermu la aparatan konekton kun NanoLibAccessor.closeBusHardware ().
NanoLibAccessor havas la sekvajn publikajn membrofunkciojn:
listAvailableBusHardware () Uzu ĉi tiun funkcion por listigi disponeblajn kampbusajn aparataron.
virtual ResultBusHwIds nlc::NanoLibAccessor::listAvailableBusHardware ()
Revenas ResultBusHwIds
Liveras kampbusan ID-tabelon.
openBusHardwareWithProtocol () Uzu ĉi tiun funkcion por konekti busa aparataro.
virtual ResultVoid nlc::NanoLibAccessor::openBusHardwareWithProtocol (BusHardwareId const & busHwId, BusHardwareOptions const & busHwOpt)
Parametroj busHwId busHwOpt
Revenas ResultVoid
Specifas la kampbuson por malfermi. Specifas kampbusajn malfermopciojn. Konfirmas ke malplena funkcio funkciis.
isBusHardwareOpen () Uzu ĉi tiun funkcion por kontroli ĉu via kampbusa aparatara konekto estas malfermita.
virtual ResultVoid nlc::NanoLibAccessor::openBusHardwareWithProtocol (const BusHardwareId & busHwId, const BusHardwareOptions & busHwOpt)
Versio: doc 1.4.2 / NanoLib 1.3.0
16
8 Klasoj / funkcioj referenco
Parametroj BusHardwareId Redonas vera
malvera
Specifas ĉiun kampbuson por malfermi. Aparataro estas malfermita. Aparataro estas fermita.
getProtocolSpecificAccessor () Uzu ĉi tiun funkcion por akiri la protokol-specifan akcesorobjekton.
virtual ResultVoid nlc::NanoLibAccessor::getProtocolSpecificAccessor (BusHardwareId const & busHwId)
Parametroj busHwId Revenas ResultVoid
Specifas la kampbuson por akiri la akcesoraĵon. Konfirmas ke malplena funkcio funkciis.
getProfinetDCP () Uzu ĉi tiun funkcion por resendi referencon al Profinet DCP-interfaco.
virtual ProfinetDCP & getProfinetDCP ()
Revenas ProfinetDCP
ricevasSamplerInterface () Uzu ĉi tiun funkcion por ricevi referencon al la sampler interfaco.
virtual SamplerInterface & getSamplerInterfaco ()
Revenas SamplerInterfaco
Rilatas al la sampler interfaco klaso.
setBusState () Uzu ĉi tiun funkcion por agordi la bus-protokolo-specifan staton.
virtual ResultVoid nlc::NanoLibAccessor::setBusState (const BusHardwareId & busHwId, const std::string & state)
Parametroj busHwId stato
Revenas ResultVoid
Specifas la kampbuson por malfermi. Atribuas bus-specifan staton kiel ĉenvaloro. Konfirmas ke malplena funkcio funkciis.
scanDevices () Uzu ĉi tiun funkcion por serĉi aparatojn en la reto.
virtual ResultDeviceIds nlc::NanoLibAccessor::scanDevices (const BusHardwareId & busHwId, NlcScanBusCallback* callback)
Parametroj busHwId callback
Liveras ResultDeviceIds IOError
Specifas la kampbuson por skani. NlcScanBusCallback progreso spurilo. Liveras aparatan ID-tabelon. Informas ke aparato ne estas trovita.
Versio: doc 1.4.2 / NanoLib 1.3.0
17
8 Klasoj / funkcioj referenco
addDevice ()
Use this function to add a bus device described by deviceId to NanoLib’s internal device list, and to return deviceHandle for it.
virtual ResultDeviceHandle nlc::NanoLibAccessor::addDevice (DeviceId const & deviceId)
Parametroj deviceId Liveras ResultDeviceHandle
Specifas la aparaton por aldoni al la listo. Liveras aparato-tenilon.
connectDevice () Uzu ĉi tiun funkcion por konekti aparaton per deviceHandle.
virtual ResultVoid nlc::NanoLibAccessor::connectDevice (DeviceHandle const deviceHandle)
Parametroj deviceHandle Revenas ResultVoid
IOEraro
Specifas al kiu busa aparato NanoLib konektas. Konfirmas ke malplena funkcio funkciis. Informas ke aparato ne estas trovita.
getDeviceName () Uzu ĉi tiun funkcion por ricevi la nomon de aparato per deviceHandle.
virtual ResultString nlc::NanoLibAccessor::getDeviceName (DeviceHandle const deviceHandle)
Parametroj deviceHandle Redonas ResultString
Specifas por kiu busa aparato NanoLib ricevas la nomon. Liveras aparatnomojn kiel ŝnuro.
getDeviceProductCode () Uzu ĉi tiun funkcion por akiri la produktokodon de aparato per deviceHandle.
virtual ResultInt nlc::NanoLibAccessor::getDeviceProductCode (DeviceHandle const deviceHandle)
Parametroj deviceHandle Revenas ResultInt
Specifas por kiu busa aparato NanoLib ricevas la produktokodon. Liveras produktkodojn kiel entjero.
getDeviceVendorId () Uzu ĉi tiun funkcion por akiri la aparaton de vendisto ID per deviceHandle.
virtual ResultInt nlc::NanoLibAccessor::getDeviceVendorId (DeviceHandle const deviceHandle)
Parametroj deviceHandle Revenas ResultInt
RimedoNedisponebla
Specifas por kiu busa aparato NanoLib ricevas la vendistan ID por. Liveras identigilojn de vendisto kiel entjero. Informas ke neniu datumo estas trovita.
Versio: doc 1.4.2 / NanoLib 1.3.0
18
8 Klasoj / funkcioj referenco
getDeviceId () Uzu ĉi tiun funkcion por akiri specifan identigilon de aparato el la interna listo de NanoLib.
virtual ResultDeviceId nlc::NanoLibAccessor::getDeviceId (DeviceHandle const deviceHandle)
Parametroj deviceHandle Revenas ResultDeviceId
Specifas por kiu busa aparato NanoLib ricevas la aparato-ID por. Liveras aparaton ID.
getDeviceIds () Uzu ĉi tiun funkcion por akiri la ID de ĉiuj aparatoj el la interna listo de NanoLib.
virtual ResultDeviceIds nlc::NanoLibAccessor::getDeviceIds ()
Liveras ResultDeviceIds
Liveras aparaton ID-liston.
getDeviceUid () Uzu ĉi tiun funkcion por akiri la unikan identigilon de aparato (96 bitoj / 12 bajtoj) per deviceHandle.
virtual ResultArrayByte nlc::NanoLibAccessor::getDeviceUid (DeviceHandle const deviceHandle)
Parametroj deviceHandle Revenas ResultArrayByte
RimedoNedisponebla
Specifas por kiu busa aparato NanoLib ricevas la unikan identigilon. Liveras unikajn identigilojn kiel bajta tabelo. Informas ke neniu datumo estas trovita.
getDeviceSerialNumber () Uzu ĉi tiun funkcion por akiri la serian numeron de aparato per deviceHandle.
virtual ResultString NanolibAccessor::getDeviceSerialNumber (DeviceHandle const deviceHandle)
Parametroj deviceHandle Redonas ResultString
RimedoNedisponebla
Specifas por kiu busa aparato NanoLib ricevas la serian numeron. Liveras seriajn numerojn kiel ŝnuro. Informas ke neniu datumo estas trovita.
getDeviceHardwareGroup () Uzu ĉi tiun funkcion por akiri la aparataron de busa aparato per deviceHandle.
virtual ResultDeviceId nlc::NanoLibAccessor::getDeviceHardwareGroup (DeviceHandle const deviceHandle)
Parametroj deviceHandle Revenas ResultInt
Specifas por kiu busa aparato NanoLib ricevas la hardvargrupon.
Liveras hardvargrupojn kiel entjero.
getDeviceHardwareVersion () Uzu ĉi tiun funkcion por akiri la aparatan version de busaparato per deviceHandle.
virtual ResultDeviceId nlc::NanoLibAccessor::getDeviceHardwareVersion (DeviceHandle const deviceHandle)
Versio: doc 1.4.2 / NanoLib 1.3.0
19
8 Klasoj / funkcioj referenco
Parametroj deviceHandle
Revenoj
ResultString RimedoNedisponebla
Specifas por kiu busa aparato NanoLib ricevas la aparatan version. Liveras aparatnomojn kiel ŝnuro. Informas ke neniu datumo estas trovita.
getDeviceFirmwareBuildId () Uzu ĉi tiun funkcion por akiri la firmware-konstruan ID de busaparato per deviceHandle.
virtual ResultDeviceId nlc::NanoLibAccessor::getDeviceFirmwareBuildId (DeviceHandle const deviceHandle)
Parametroj deviceHandle Redonas ResultString
Specifas por kiu busa aparato NanoLib ricevas la firmware-konstruan ID por.
Liveras aparatnomojn kiel ŝnuro.
getDeviceBootloaderVersion () Uzu ĉi tiun funkcion por akiri la version de ekŝargilo de busaparato per deviceHandle.
virtual ResultInt nlc::NanoLibAccessor::getDeviceBootloaderVersion (DeviceHandle const deviceHandle)
Parametroj deviceHandle
Revenoj
ResultInt ResourceUnavailable
Specifas por kiu busa aparato NanoLib ricevas la version de ekŝargilo. Liveras startŝargilversiojn kiel entjero. Informas ke neniu datumo estas trovita.
getDeviceBootloaderBuildId () Uzu ĉi tiun funkcion por akiri la konstruan ID de ekŝargilo de busaparato per deviceHandle.
virtual ResultDeviceId nlc::NanoLibAccessor:: (DeviceHandle const deviceHandle)
Parametroj deviceHandle Redonas ResultString
Specifas por kiu busa aparato NanoLib ricevas la konstruan ID de ekŝargilo.
Liveras aparatnomojn kiel ŝnuro.
rebootDevice () Uzu ĉi tiun funkcion por rekomenci la aparaton per deviceHandle.
virtual ResultVoid nlc::NanoLibAccessor::rebootDevice (const DeviceHandle deviceHandle)
Parametroj deviceHandle Revenas ResultVoid
Specifas la kampbuson por rekomenci. Konfirmas ke malplena funkcio funkciis.
getDeviceState () Uzu ĉi tiun funkcion por akiri la specifan staton de aparato-protokolo.
virtual ResultString nlc::NanoLibAccessor::getDeviceState (DeviceHandle const deviceHandle)
Parametroj deviceHandle
Specifies what bus device NanoLib gets the state for.
Versio: doc 1.4.2 / NanoLib 1.3.0
20
8 Klasoj / funkcioj referenco
Revenas ResultString
Liveras aparatnomojn kiel ŝnuro.
setDeviceState () Uzu ĉi tiun funkcion por agordi la specifan staton de aparato-protokolo.
virtual ResultVoid nlc::NanoLibAccessor::setDeviceState (const DeviceHandle deviceHandle, const std::string & state)
Parametroj deviceHandle stato
Revenas ResultVoid
Specifas por kiu busa aparato NanoLib starigas la staton. Atribuas bus-specifan staton kiel ĉenvaloro. Konfirmas ke malplena funkcio funkciis.
getConnectionState ()
Use this function to get a specific device’s last known connection state by deviceHandle (= Disconnected, Connected, ConnectedBootloader)
virtual ResultConnectionState nlc::NanoLibAccessor::getConnectionState (DeviceHandle const deviceHandle)
Parametroj deviceHandle Redonas ResultConnectionState
Specifas por kiu busa aparato NanoLib ricevas la konektan staton.
Liveras konektan staton (= Malkonektita, Konektita, ConnectedBootloader).
checkConnectionState ()
Only if the last known state was not Disconnected: Use this function to check and possibly update a specific device’s connection state by deviceHandle and by testing several mode-specific operations.
virtual ResultConnectionState nlc::NanoLibAccessor::checkConnectionState (DeviceHandle const deviceHandle)
Parametroj deviceHandle Redonas ResultConnectionState
Specifas por kiu busa aparato NanoLib kontrolas la konektan staton.
Liveras konektan staton (= ne Malkonektita).
assignObjectDictionary () Uzu ĉi tiun manlibron por asigni objektovortaron (OD) al deviceHandle memstare.
virtual ResultObjectDictionary nlc::NanoLibAccessor::assignObjectDictionary (DeviceHandle const deviceHandle, ObjectDictionary const & objectDictionary)
Parametroj deviceHandle objektoVortaro
Liveras ResultObjectDictionary
Specifas al kiu busa aparato NanoLib asignas la OD. Montras la ecojn de objektovortaro.
autoAsignObjectVortaro ()
Uzu ĉi tiun aŭtomatismon por lasi NanoLib asigni objektovortaron (OD) al deviceHandle. Trovante kaj ŝarĝante taŭgan OD, NanoLib aŭtomate asignas ĝin al la aparato. Noto: Se kongrua OD jam estas ŝarĝita en la objektobiblioteko, NanoLib aŭtomate uzos ĝin sen skanado de la sendita dosierujo.
virtual ResultObjectDictionary nlc::NanoLibAccessor::autoAssignObjectDictionary (DeviceHandle const deviceHandle, const std::string & dictionariesLocationPath)
Versio: doc 1.4.2 / NanoLib 1.3.0
21
8 Klasoj / funkcioj referenco
Parametroj deviceHandle
Revenoj
vortarojLocationPath ResultObjectVortaro
Specifas por kiu busa aparato NanoLib aŭtomate skanos por taŭgaj OD-oj. Specifas la vojon al la OD-dosierujo. Montras la ecojn de objektovortaro.
getAssignedObjectDictionary ()
Use this function to get the object dictionary assigned to a device by deviceHandle.
virtual ResultObjectDictionary nlc::NanoLibAccessor::getAssignedObjectDictionary (DeviceHandle const device
Handle)
Parametroj deviceHandle Revenas ResultObjectDictionary
Specifas por kiu busa aparato NanoLib ricevas la asignitan OD. Montras la ecojn de objektovortaro.
getObjectDictionaryLibrary () Ĉi tiu funkcio liveras referencon al OdLibrary.
virtual OdLibrary& nlc::NanoLibAccessor::getObjectDictionaryLibrary ()
Revenas OdLibrary&
Malfermas la tutan OD-bibliotekon kaj ĝiajn objektovortarojn.
setLoggingLevel () Uzu ĉi tiun funkcion por agordi la bezonatan protokolo-detalon (kaj protokolo file grandeco). Defaŭlta nivelo estas Info.
virtual void nlc::NanoLibAccessor::setLoggingLevel (LogLevel level)
Nivelo de parametroj
La sekvaj protokolaj detaloj eblas:
0 = Spuro 1 = Sencimigi 2 = Informoj 3 = Averti 4 = Eraro 5 = Kritika 6 = Malŝaltita
Plej malalta nivelo (plej granda ŝtipo file); registras ajnan realigeblan detalon, plus programaro starto/haltigi. Ensalutas sencimigan informon (= provizoraj rezultoj, enhavo sendita aŭ ricevita, ktp.) Defaŭlta nivelo; registras informajn mesaĝojn. Registras problemojn kiuj okazis sed ne haltigos la nunan algoritmon. Registras nur severajn problemojn, kiuj haltigis la algoritmon. Plej alta nivelo (plej malgranda ŝtipo file); malŝaltas la ensaluti; tute ne plu ŝtipu. Tute neniu arbohakado.
setLoggingCallback ()
Use this function to set a logging callback pointer and log module (= library) for that callback (not for the logger itself).
virtual void nlc::NanoLibAccessor::setLoggingCallback (NlcLoggingCallback* callback, const nlc::LogModule & logModule)
Parameters *callback logModule
Sets a callback pointer. Tunes the callback (not logger!) to your library.
0 = NanolibCore 1 = NanolibCANopen 2 = NanolibModbus 3 = NanolibEtherCAT
Activates a callback for NanoLib’s core only. Activates a CANopen-only callback. Activates a Modbus-only callback. Activates an EtherCAT-only callback.
Versio: doc 1.4.2 / NanoLib 1.3.0
22
8 Klasoj / funkcioj referenco
4 = NanolibRest 5 = NanolibUSB
Activates a REST-only callback. Activates a USB-only callback.
unsetLoggingCallback () Uzu ĉi tiun funkcion por nuligi registran revokmontrilon.
virtual void nlc::NanoLibAccessor::unsetLoggingCallback ()
readNumber () Uzu ĉi tiun funkcion por legi nombran valoron el la objektovortaro.
virtual ResultInt nlc::NanoLibAccessor::readNumber (const DeviceHandle deviceHandle, const OdIndex odIndex)
Parametroj deviceHandle odIndex
Revenas ResultInt
Specifas de kiu busa aparato NanoLib legas. Specifas la (sub-) indekson por legi. Liveras neinterpretitan numeran valoron (povas esti subskribita, nesubskribita, fiksi 16.16 bitajn valorojn).
readNumberArray () Uzu ĉi tiun funkcion por legi nombrajn tabelojn el la objektovortaro.
virtual ResultArrayInt nlc::NanoLibAccessor::readNumberArray (const DeviceHandle deviceHandle, const uint16_t index)
Parametroj deviceHandle indekso
Liveras ResultArrayInt
Specifas de kiu busa aparato NanoLib legas. Tabelobjekta indekso. Liveras entjeran tabelon.
readBytes () Uzu ĉi tiun funkcion por legi arbitrajn bajtojn (domajnaj objektodatenoj) de la objektovortaro.
virtual ResultArrayByte nlc::NanoLibAccessor::readBytes (const DeviceHandle deviceHandle, const OdIndex odIndex)
Parametroj deviceHandle odIndex
Revenas ResultArrayByte
Specifas de kiu busa aparato NanoLib legas. Specifas la (sub-) indekson por legi. Liveras bajtan tabelon.
readString () Uzu ĉi tiun funkcion por legi ĉenojn el la objekta dosierujo.
virtual ResultString nlc::NanoLibAccessor::readString (const DeviceHandle deviceHandle, const OdIndex odIndex)
Parametroj deviceHandle odIndex
Revenas ResultString
Specifas de kiu busa aparato NanoLib legas. Specifas la (sub-) indekson por legi. Liveras aparatnomojn kiel ŝnuro.
Versio: doc 1.4.2 / NanoLib 1.3.0
23
8 Klasoj / funkcioj referenco
writeNumber () Uzu ĉi tiun funkcion por skribi nombrajn valorojn al la objekta dosierujo.
virtual ResultVoid nlc::NanoLibAccessor::writeNumber (const DeviceHandle deviceHandle, int64_t value, const OdIndex odIndex, unsigned int bitLength)
Parametroj deviceHandle valoro odIndex bitLength
Revenas ResultVoid
Specifas al kiu busa aparato NanoLib skribas. La neinterpretita valoro (povas esti subskribita, nesubskribita, ripari 16.16). Specifas la (sub-) indekson por legi. Longo en iom. Konfirmas ke malplena funkcio funkciis.
writeBytes () Uzu ĉi tiun funkcion por skribi arbitrajn bajtojn (domajnaj objektodatenoj) al la objekta dosierujo.
virtual ResultVoid nlc::NanoLibAccessor::writeBytes (const DeviceHandle deviceHandle, const std::vector <uint8_t> & data, const OdIndex odIndex)
Parametroj deviceHandle datumoj odIndex
Revenas ResultVoid
Specifas al kiu busa aparato NanoLib skribas. Bajta vektoro / tabelo. Specifas la (sub-) indekson por legi. Konfirmas ke malplena funkcio funkciis.
uploadFirmware ()
Use this function to update your controller firmware.
virtual ResultVoid nlc::NanoLibAccessor::uploadFirmware (const DeviceHandle deviceHandle, const std::vector <uint8_t> & fwData, NlcDataTransferCallback* callback)
Parametroj deviceHandle fwData NlcDataTransferCallback
Revenas ResultVoid
Specifas kian busaparaton NanoLib ĝisdatigas. Tabelo enhavante firmware-datenojn. Datumprogresspurilo. Konfirmas ke malplena funkcio funkciis.
alŝutiFirmwareDeFile ()
Use this function to update your controller firmware by uploading its file.
virtual ResultVoid nlc::NanoLibAccessor::uploadFirmwareFromFile (const DeviceHandle deviceHandle, const std::string & absoluteFilePath, NlcDataTransferCallback* callback)
Parametroj deviceHandle absolutaFileVojo NlcDataTransferCallback
Revenas ResultVoid
Specifas kian busaparaton NanoLib ĝisdatigas. Vojo al file containing firmware data (std::string). A data progress tracer. Confirms that a void function has run.
Versio: doc 1.4.2 / NanoLib 1.3.0
24
8 Klasoj / funkcioj referenco
uploadBootloader ()
Use this function to update your controller bootloader.
virtual ResultVoid nlc::NanoLibAccessor::uploadBootloader (const DeviceHandle deviceHandle, const std::vector <uint8_t> & btData, NlcDataTransferCallback* callback)
Parametroj deviceHandle btData NlcDataTransferCallback
Revenas ResultVoid
Specifas kian busaparaton NanoLib ĝisdatigas. Tabelo enhavanta datumojn de ekŝargilo. Datumprogresspurilo. Konfirmas ke malplena funkcio funkciis.
alŝutiBootloaderDeFile ()
Use this function to update your controller bootloader by uploading its file.
virtual ResultVoid nlc::NanoLibAccessor::uploadBootloaderFromFile (const DeviceHandle deviceHandle, const std::string & bootloaderAbsoluteFilePath, NlcDataTransferCallback* callback)
Parametroj deviceHandle bootloaderAbsoluteFileVojo NlcDataTransferCallback
Revenas ResultVoid
Specifas kian busaparaton NanoLib ĝisdatigas. Vojo al file containing bootloader data (std::string). A data progress tracer. Confirms that a void function has run.
uploadBootloaderFirmware ()
Use this function to update your controller bootloader and firmware.
virtual ResultVoid nlc::NanoLibAccessor::uploadBootloaderFirmware (const DeviceHandle deviceHandle, const std::vector <uint8_t> & btData, const std::vector <uint8_t> & fwData, NlcDataTransferCallback* callback)
Parametroj deviceHandle btData fwData NlcDataTransferCallback
Revenas ResultVoid
Specifas kian busaparaton NanoLib ĝisdatigas. Tabelo enhavanta datumojn de ekŝargilo. Tabelo enhavante firmware-datenojn. Datumprogresspurilo. Konfirmas ke malplena funkcio funkciis.
uploadBootloaderFirmwareDeFile ()
Uzu ĉi tiun funkcion por ĝisdatigi vian regilon ekŝargilon kaj firmvaro alŝutante la files.
virtual ResultVoid nlc::NanoLibAccessor::uploadBootloaderFirmwareFromFile (const DeviceHandle deviceHandle, const std::string & bootloaderAbsoluteFilePath, const std::string & absoluteFilePath, NlcDataTransferCallback* callback)
Parametroj deviceHandle bootloaderAbsoluteFileVojo absolutaFileVojo NlcDataTransferCallback
Revenas ResultVoid
Specifas kian busaparaton NanoLib ĝisdatigas. Vojo al file containing bootloader data (std::string). Path to file enhavante firmvardatenojn (uint8_t). Datumprogresspurilo. Konfirmas ke malplena funkcio funkciis.
Versio: doc 1.4.2 / NanoLib 1.3.0
25
8 Klasoj / funkcioj referenco
uploadNanoJ ()
Use this public function to updload the NanoJ program to your controller.
virtual ResultVoid nlc::NanoLibAccessor::uploadNanoJ (DeviceHandle const deviceHandle, std::vector <uint8_t> const & vmmData, NlcDataTransferCallback* callback)
Parametroj deviceHandle vmmData NlcDataTransferCallback
Revenas ResultVoid
Specifas al kiu busa aparato NanoLib alŝutas. Tabelo enhavante NanoJ-datenojn. Datumprogresspurilo. Konfirmas ke malplena funkcio funkciis.
alŝutiNanoJFromFile ()
Use this public function to updload the NanoJ program to your controller by uploading the file.
virtual ResultVoid nlc::NanoLibAccessor::uploadNanoJFromFile (const DeviceHandle deviceHandle, const std::string & absoluteFilePath, NlcDataTransferCallback* callback)
Parametroj deviceHandle absolutaFileVojo NlcDataTransferCallback
Revenas ResultVoid
Specifas al kiu busa aparato NanoLib alŝutas. Vojo al file containing NanoJ data (std::string). A data progress tracer. Confirms that a void function has run.
disconnectDevice () Uzu ĉi tiun funkcion por malkonekti vian aparaton per deviceHandle.
virtual ResultVoid nlc::NanoLibAccessor::disconnectDevice (DeviceHandle const deviceHandle)
Parametroj deviceHandle Revenas ResultVoid
Specifas de kiu busa aparato NanoLib malkonektas. Konfirmas ke malplena funkcio funkciis.
removeDevice () Uzu ĉi tiun funkcion por forigi vian aparaton el la interna aparato-listo de NanoLib.
virtual ResultVoid nlc::NanoLibAccessor::removeDevice (const DeviceHandle deviceHandle)
Parametroj deviceHandle Revenas ResultVoid
Specifas kian busaparaton NanoLib forigas. Konfirmas ke malplena funkcio funkciis.
closeBusHardware () Uzu ĉi tiun funkcion por malkonekti de via kampbusa aparataro.
virtual ResultVoid nlc::NanoLibAccessor::closeBusHardware (BusHardwareId const & busHwId)
Parametroj busHwId Revenas ResultVoid
Specifas la kampbuson por malkonekti. Konfirmas ke malplena funkcio funkciis.
Versio: doc 1.4.2 / NanoLib 1.3.0
26
8 Klasoj / funkcioj referenco
8.2 BusHardwareId
Uzu ĉi tiun klason por identigi busaparaton unu-al-unu aŭ por distingi malsaman busaparaton unu de la alia. Ĉi tiu klaso (sen setter-funkcioj por esti neŝanĝebla ekde kreado) ankaŭ enhavas informojn pri:
Aparataro (= adaptilonomo, retadaptilo ktp.) Protokolo por uzi (= Modbus TCP, CANopen ktp.) Busa aparataro-specifilo (= seria havennomo, MAC-amika nomo
adreso ktp.)
BusHardwareId () [1/3]
Constructor that creates a new bus hardware ID object.
nlc::BusHardwareId::BusHardwareId (std::string const & busHardware_, std::string const & protocol_, std::string const & hardwareSpecifier_, std::string const & name_)
Parametroj busHardware_ protokolo_ aparataroSpecifier_ ekstraHardwareSpecifier_ nomo_
Aparataro tipo (= ZK-USB-CAN-1 ktp.). Bus-komunika protokolo (= CANopen ktp.). La specifilo de aparataro (= COM3 ktp.). La ekstra specifilo de la aparataro (ekzemple, USB-lokaj informoj). Amika nomo (= AdapterName (Porto) ktp. ).
BusHardwareId () [2/3]
Constructor that creates a new bus hardware ID object, with the option for an extra hardware speicifier.
nlc::BusHardwareId::BusHardwareId (std::string const & busHardware_, std::string const & protocol_, std::string const & hardwareSpecifier_, std::string const & extraHardwareSpecifier_, std::string const & name_)
Parametroj busHardware_ protokolo_ aparataroSpecifier_ ekstraHardwareSpecifier_ nomo_
Aparataro tipo (= ZK-USB-CAN-1 ktp.). Bus-komunika protokolo (= CANopen ktp.). La specifilo de aparataro (= COM3 ktp.). La ekstra specifilo de la aparataro (ekzemple, USB-lokaj informoj). Amika nomo (= AdapterName (Porto) ktp. ).
BusHardwareId () [3/3] Konstruisto kiu kopias ekzistantan busHardwareId.
nlc::BusHardwareId::BusHardwareId (BusHardwareId konst &)
nlc::BusHardwareId::BusHardwareId (BusHardwareId konst &)
Parametroj busHardwareId
Nomas la busa aparataro ID por kopii.
equals () Kompparas novan busa aparataro ID al ekzistantaj.
bool nlc::BusHardwareId::equals (BusHardwareId const & other) const
Parametroj aliaj Donas vera
Another object of the same class. If both are equal in all values.
Versio: doc 1.4.2 / NanoLib 1.3.0
27
8 Klasoj / funkcioj referenco
malvera
If the values differ.
getBusHardware () Legas la busa aparataro ĉeno.
std::string nlc::BusHardwareId::getBusHardware () const
Redonas ĉenon
getHardwareSpecifier () Reads out the bus hardware’s specifier string (= network name etc.).
std::string nlc::BusHardwareId::getHardwareSpecifier () const
Redonas ĉenon
getExtraHardwareSpecifier () Reads out the bus extra hardware’s specifier string (= MAC address etc.).
std::string nlc::BusHardwareId::getExtraHardwareSpecifier () const
Redonas ĉenon
getName () Reads out the bus hardware’s friendly name.
std::string nlc::BusHardwareId::getName () const
Redonas ĉenon
getProtocol () Reads out the bus protocol string.
std::string nlc::BusHardwareId::getProtocol () const
Redonas ĉenon
toString () Returns the bus hardware ID as a string.
std::string nlc::BusHardwareId::toString () const
Redonas ĉenon
8.3 BusHardwareOpcioj
Find in this class, in a key-value list of strings, all options needed to open a bus hardware.
Versio: doc 1.4.2 / NanoLib 1.3.0
28
8 Klasoj / funkcioj referenco
BusHardwareOptions () [1/2] Constructs a new bus hardware option object.
nlc::BusHardwareOptions::BusHardwareOptions () Use the function addOption () to add key-value pairs.
BusHardwareOptions () [2/2] Konstruas novan busa aparataro opciobjekton kun la ŝlosilvalora mapo jam en loko.
nlc::BusHardwareOptions::BusHardwareOptions (std::map <std::string, std::string> const & options)
Opcioj de parametroj
Mapo kun opcioj por la busa aparataro por funkcii.
addOption () Kreas kromajn ŝlosilojn kaj valorojn.
void nlc::BusHardwareOptions::addOption (std::string const & key, std::string const & value)
Parametra ŝlosila valoro
Example: BAUD_RATE_OPTIONS_NAME, vidu bus_hw_options_ defaŭltojn
Example: BAUD_RATE_1000K, vidu bus_hw_options_defaults
egalas () Kompparas la BusHardwareOptions kun ekzistantaj.
bool nlc::BusHardwareOptions::equals (BusHardwareOptions const & other) const
Parametroj aliaj Donas vera
malvera
Alia objekto de la sama klaso. Se la alia objekto havas ĉiujn ekzakte samajn eblojn. Se la alia objekto havas malsamajn ŝlosilojn aŭ valorojn.
getOptions () Legas ĉiujn aldonitajn ŝlosilvalorajn parojn.
std::map <std::string, std::string> nlc::BusHardwareOptions::getOptions () const
Redonas ĉenmapon
toString () Resendas ĉiujn ŝlosilojn/valorojn kiel ĉenon.
std::string nlc::BusHardwareId::toString () const
Redonas ĉenon
8.4 BusHwOptionsDefault
Ĉi tiu defaŭlta agorda elektoklaso havas la jenajn publikajn atributojn:
Versio: doc 1.4.2 / NanoLib 1.3.0
29
8 Klasoj / funkcioj referenco
const CanBus const Seria const RESTfulBus const EtherCATBus
canBus = CanBus () serial = Seria () restfulBus = RESTfulBus () ethercatBus = EtherCATBus ()
8.5 CanBaudRate
Strukturo kiu enhavas CAN-busajn baŭdratojn en la sekvaj publikaj atributoj:
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_100K = “100k”_50 “BAUD_RATE_50k”_20 ATE_20K = "10k" BAUD_RATE_10K = "5k" BAUD_RATE_5K = "XNUMXk"
8.6 CanBus
Defaŭlta agorda elektoklaso kun la sekvaj publikaj atributoj:
const std::string const CanBaudRate const Ixxat
BAUD_RATE_OPTIONS_NAME = “povas adaptilo baudrapido” baudRate = CanBaudRate () ixxat = Ixxat ()
8.7 CanOpenNmtService
Por la NMT-servo, tiu strukturo enhavas la CANopen NMT-ŝtatojn kiel kordvaloroj en la sekvaj publikaj atributoj:
const std::string const std::string const std::string const std::string const std::string
START = "START" STOP = "HALSI" PRE_OPERACIONAL = "PRE_OPERACIONAL" RESET = "RESET" RESET_COMMUNICATION = "RESET_COMMUNICATION"
8.8 CanOpenNmtState
Ĉi tiu strukturo enhavas la CANopen NMT-ŝtatojn kiel kordvaloroj en la sekvaj publikaj atributoj:
const std::string const std::string const std::string const std::string const std::string
HALTITA = “HALTAS” PRE_FUNCIATIVA = “PRE_FUNCIATIVA” OPERATIONAL = “FUNCIATIVA” INICIAGO = “INICIALISMO” NEKONATA = “NEKONATA”
8.9 EtherCATBus-strukturo
Ĉi tiu strukturo enhavas la EtherCAT-komunikajn agordajn elektojn en la sekvaj publikaj atributoj:
Versio: doc 1.4.2 / NanoLib 1.3.0
30
8 Klasoj / funkcioj referenco
const std::string NETWORK_FIRMWARE_STATE_OP- Network state treated as firmware mode. Acceptable
TION_NAME = “Network Firmware State”
valoroj (defaŭlte = PRE_OPERATIONAL):
EtherCATState::PRE_OPERATIONAL EtherCATState::SAFE_OPERATIONAL EtherCATState::OPERATIONAL
const std::string DEFAULT_NETWORK_FIRMWARE_ STATE = “PRE_OPERATIONAL”
const std::string EXCLUSIVE_LOCK_TIMEOUT_OP- Timeout in milliseconds to acquire exclusive lock on
TION_NAME = “Shared Lock Timeout”
la reto (defaŭlte = 500 ms).
const unsigned int DEFAULT_EXCLUSIVE_LOCK_ TIMEOUT = “500”
const std::string SHARED_LOCK_TIMEOUT_OPTION_ Timeout in milliseconds to acquire shared lock on
NAME = “Shared Lock Timeout”
la reto (defaŭlte = 250 ms).
const unsigned int DEFAULT_SHARED_LOCK_TIMEOUT = “250”
const std::string READ_TIMEOUT_OPTION_NAME = Timeout in milliseconds for a read operation (default
“Read Timeout”
= 700 ms).
const unsigned int DEFAULT_READ_TIMEOUT = “700”
const std::string WRITE_TIMEOUT_OPTION_NAME = Timeout in milliseconds for a write operation (default
“Write Timeout”
= 200 ms).
const unsigned int DEFAULT_WRITE_TIMEOUT = “200”
const std::string READ_WRITE_ATTEMPTS_OPTION_ Maximum read or write attempts (non-zero values
NAME = “Read/Write Attempts”
nur; defaŭlta = 5).
const unsigned int DEFAULT_READ_WRITE_ATTEMPTS = “5”
const std::string CHANGE_NETWORK_STATE_ATTEMPTS_OPTION_NAME = “Change Network State Attempts”
Maksimuma nombro da provoj ŝanĝi la retan staton (nur ne-nulaj valoroj; defaŭlte = 10).
const unsigned int DEFAULT_CHANGE_NETWORK_ STATE_ATTEMPTS = “10”
const std::string PDO_IO_ENABLED_OPTION_NAME Enables or disables PDO processing for digital in- /
= “PDO IO Enabled”
eligoj ("Vera" aŭ "Malvera" nur; defaŭlte = "Vera").
const std::string DEFAULT_PDO_IO_ENABLED = “True”
8.10 EtherCATState-strukturo
Ĉi tiu strukturo enhavas la EtherCAT-sklavo/retajn ŝtatojn kiel kordvalorojn en la sekvaj publikaj atributoj. Noto: Defaŭlta stato ĉe ŝaltado estas PRE_OPERACIA; NanoLib povas provizi neniun fidindan "FUNKTIMAN" staton en ne-realtempa operaciumo:
const std::string const std::string const std::string const std::string const std::string const std::string
NONE = “NONE” INIT = “INIT” PRE_OPERATIONAL = “PRRE_OPERATIONAL” BOOT = “BOOT” SAFE_OPERATIONAL = “SAFE_OPERATIONAL” OPERATIVO = “OPERATIVA”
Versio: doc 1.4.2 / NanoLib 1.3.0
31
8 Klasoj / funkcioj referenco
8.11 Ixxat
This struct holds all information for the Ixxat usb-to-can in the following public attributes:
const std::string
ADAPTER_BUS_NUMBER_OPTIONS_NAME = "ixxat adaptila busnumero"
const IxxatAdapterBusNumber adapterBusNumber = IxxatAdapterBusNumber ()
8.12 IxxatAdapterBusNumber
This struct holds the bus number for the Ixxat usb-to-can in the following public attributes:
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 Pico
This struct holds all information for the Peak usb-to-can in the following public attributes:
const std::string
ADAPTER_BUS_NUMBER_OPTIONS_NAME = “peak adapter bus number”
const PeakAdapterBusNumber adapterBusNumber = PeakAdapterBusNumber ()
8.14 PeakAdapterBusNumber
This struct holds the bus number for the Peak usb-to-can in the following public attributes:
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 std::string const std::string const std::string const std::string const std::string const std::string
BUS_NUMBER_1_DEFAULT = std::to_string (PCAN_USBBUS1) BUS_NUMBER_2 = std::to_string (PCAN_USBBUS2) BUS_NUMBER_3 = std::to_string (PCAN_USBBUS3) BUS_NUMBER_4 = std::to_string (PCAN_USBBUS4) BUS_NUMBER_5 = std::to_string (PCAN_USBBUS5) BUS_NUMBER_6 = std::to_string (PCAN_USBBUS6) BUS_NUMBER_7 = std::to_string (PCAN_USBBUS7) BUS_NUMBER_8 = std::to_string (PCAN_USBBUS8) BUS_NUMBER_9 = std::to_string (PCAN_USBBUS9) BUS_NUMBER_10 = std::to_string (PCAN_USBBUS10) BUS_NUMBER_11 = std::to_string (PCAN_USBBUS11) BUS_NUMBER_12 = std::to_string (PCAN_USBBUS12) BUS_NUMBER_13 = std::to_string (PCAN_USBBUS13) BUS_NUMBER_14 = std::to_string (PCAN_USBBUS14) BUS_NUMBER_15 = std::to_string (PCAN_USBBUS15) BUS_NUMBER_16 = std::to_string (PCAN_USBBUS16)
8.15 Aparato-Tenilo
Ĉi tiu klaso reprezentas tenilon por kontroli aparaton sur buso kaj havas la sekvajn publikajn membrofunkciojn.
DeviceHandle () DeviceHandle (uint32_t handle)
Versio: doc 1.4.2 / NanoLib 1.3.0
32
8 Klasoj / funkcioj referenco
egalas () Kompparas sin al donita aparato tenilo.
bool equals (DeviceHandle const other) const (uint32_t handle)
toString () Liveras ĉenprezenton de la aparato-tenilo.
std::string toString () const
get () Returns the device handle.
uint32_t get () const
8.16 DeviceId
Uzu ĉi tiun klason (ne neŝanĝeblan ekde kreado) por identigi kaj distingi aparatojn sur buso:
Aparataro adaptilo identigilo
Aparato identigilo
Priskribo
La signifo de aparataj ID/priskribaj valoroj dependas de la buso. Por ekzample, CAN-buso povas uzi la entjeran ID.
DeviceId () [1/3] Konstruas novan aparaton ID-objekton.
nlc::DeviceId::DeviceId (BusHardwareId const & busHardwareId_, unsigned int deviceId_, std::string const & description_)
Parametroj busHardwareId_ deviceId_ description_
Identigilo de la buso. Indekso; subjekto al buso (= CANopen-nodo ID ktp.). Priskribo (povas esti malplena); subjekto al buso.
DeviceId () [2/3]
Constructs a new device ID object with extended ID options.
nlc::DeviceId::DeviceId (BusHardwareId const & busHardwareId, unsigned int deviceId_, std::string const & description_ std::vector <uint8_t> const & extraId_, std::string const & extraStringId_)
Parameters busHardwareId_ deviceId_ description_ extraId_ extraStringId_
Identifier of the bus. An index; subject to bus (= CANopen node ID etc.). A description (may be empty); subject to bus. An additional ID (may be empty); meaning depends on bus. Additional string ID (may be empty); meaning depends on bus.
DeviceId () [3/3] Konstruas kopion de aparato ID-objekto.
nlc::DeviceId::DeviceId (DeviceId const &)
Versio: doc 1.4.2 / NanoLib 1.3.0
33
8 Klasoj / funkcioj referenco
Parametroj deviceId_
Aparato ID por kopii.
egalas () Kompparas novajn al ekzistantaj objektoj.
bool nlc::DeviceId::equals (DeviceId const & other) const
Revenas bulean
getBusHardwareId () Legas la busa aparataro ID.
BusHardwareId nlc::DeviceId::getBusHardwareId () const
Revenas BusHardwareId
getDescription () Legas la aparatpriskribon (eble neuzata).
std::string nlc::DeviceId::getDescription () const
Redonas ĉenon
getDeviceId () Legas la aparaton ID (eble neuzata).
unsigned int nlc::DeviceId::getDeviceId () const
Liveras sensigna int
toString () Resendas la objekton kiel ĉenon.
std::string nlc::DeviceId::toString () const
Redonas ĉenon
getExtraId () Legas la kroman identigilon de la aparato (eble ne estas uzata).
const std::vector <uint8_t>&getExtraId () const
Returns vector<uint8_t>
Vektoro de la kromaj kromaj identigiloj (povas esti malplena); signifo dependas de la buso.
getExtraStringId () Legas la kroman ĉenidentigilon de la aparato (eble ne estas uzata).
std::string getExtraStringId () const
Versio: doc 1.4.2 / NanoLib 1.3.0
34
8 Klasoj / funkcioj referenco
Redonas ĉenon
La kroma ĉena ID (povas esti malplena); signifo dependas de la buso.
8.17 LogLevelConverter
This class returns your log level as a string. static std::string toString (nlc::LogLevel logLevel)
8.18 LogModuleConverter
This class returns your library-specific log modulesetLoggingLevel () as a string.
static std::string
toString (nlc::LogModule logModule)
static std::string toString (nlc::LogModule logModule)
8.19 Objekta Vortaro
Ĉi tiu klaso reprezentas objektovortaron de regilo kaj havas la sekvajn publikajn membrofunkciojn: getDeviceHandle ()
virtual ResultDeviceHandle getDeviceHandle () const Returns ResultDeviceHandle
getObject () virtual ResultObjectSubEntry getObject (OdIndex const odIndex) Returns ResultObjectSubEntry
getObjectEntry () virtual ResultObjectEntry getObjectEntry (uint16_t index)
Liveras ResultObjectEntry
Informas pri la propraĵoj de objekto.
getXmlFileName () virtual ResultString getXmlFileName () const
Revenas ResultString
Resendas la XML file nomo kiel ŝnuro.
readNumber () virtual ResultInt readNumber (OdIndex const odIndex) Returns ResultInt
readNumberArray () virtual ResultArrayInt readNumberArray (uint16_t const index)
Versio: doc 1.4.2 / NanoLib 1.3.0
35
8 Klasoj / funkcioj referenco
Liveras ResultArrayInt readString ()
virtual ResultString readString (OdIndex const odIndex) Returns ResultString readBytes () virtual ResultArrayByte readBytes (OdIndex const odIndex) Returns ResultArrayByte writeNumber () virtual ResultVoid writeNumber (OdIndex const odIndex, const int64_t value) Returns ResultVoid writeBytes () virtual ResultVoid writeBytes (OdIndex const OdIndex, std::vector <uint8_t>
const & data) Returns ResultVoid Related Links OdIndex
8.20 Objekteniro
This class represents an object entry of the object dictionary, has the following static protected attribute and public member functions:
static nlc::ObjectSubEntry invalidObject
getName () Legas la nomon de la objekto kiel ĉeno.
virtual std::string getName () const
getPrivate () Kontrolas ĉu la objekto estas privata.
virtual bool getPrivate () const
getIndex () Legas la adreson de la objekto indekso.
virtual uint16_t getIndex () const
Versio: doc 1.4.2 / NanoLib 1.3.0
36
8 Klasoj / funkcioj referenco
getDataType () Legas la datumtipo de la objekto.
virtual nlc::ObjectEntryDataType getDataType () const
getObjectCode () Legas la objektokodon:
Null Deftype Defstruct Var Array Record
0x00 0x05 0x06 0x07 0x08 0x09
virtual nlc::ObjectCode getObjectCode () const
getObjectSaveable () Kontrolas ĉu la objekto estas konservebla kaj ĝia kategorio (vidu produktan manlibron por pliaj detaloj): APPLICATION, COMMUNICATION, DRIVE, MISC_CONFIG, MODBUS_RTU, NO, TUNING, CUSTOMER, ETHERNET, CANOPEN, VERIFY1020, UNKNOWN_SAVEABLE_TYPE
virtual nlc::ObjectSaveable getObjectSaveable () const
getMaxSubIndex () Legas la nombron da subindeksoj subtenataj de ĉi tiu objekto.
virtual uint8_t getMaxSubIndex () const
getSubEntry () virtual nlc::ObjectSubEntry & getSubEntry (uint8_t subIndex)
Vidu ankaŭ ObjectSubEntry.
8.21 ObjectSubEntry
Ĉi tiu klaso reprezentas objektan subeniron (subindekson) de la objektovortaro kaj havas la sekvajn publikajn membrofunkciojn:
getName () Legas la nomon de la objekto kiel ĉeno.
virtual std::string getName () const
getSubIndex () Legas la adreson de la subindekso.
virtual uint8_t getSubIndex () const
Versio: doc 1.4.2 / NanoLib 1.3.0
37
8 Klasoj / funkcioj referenco
getDataType () Legas la datumtipo de la objekto.
virtual nlc::ObjectEntryDataType getDataType () const
getSdoAccess () Kontrolas ĉu la subindekso estas alirebla per SDO:
Nur Legado
1
Skribu Nur
2
ReadWrite
3
SenAliro
0
virtual nlc::ObjectSdoAccessAttribute getSdoAccess () const
getPdoAccess () Kontrolas ĉu la subindekso estas alirebla/mapebla per PDO:
Tx
1
Rx
2
TxRx
3
Ne
0
virtual nlc::ObjectPdoAccessAttribute getPdoAccess () const
getBitLength () Kontrolas la subindeksan longon.
virtual uint32_t getBitLength () const
getDefaultValueAsNumeric () Legas la defaŭltan valoron de la subindekso por nombraj datumtipoj.
virtual ResultInt getDefaultValueAsNumeric (std::string const & key) const
getDefaultValueAsString () Legas la defaŭltan valoron de la subindekso por ĉenaj datumtipoj.
virtual ResultString getDefaultValueAsString (std::string const & key) const
getDefaultValues () Legas la defaŭltajn valorojn de la subindekso.
virtual std::map <std::string, std::string> getDefaultValues () const
Versio: doc 1.4.2 / NanoLib 1.3.0
38
8 Klasoj / funkcioj referenco
readNumber () Legas la nombran realan valoron de la subindekso.
virtual ResultInt readNumber () const
readString () Legas la ĉenon realan valoron de la subindekso.
virtual ResultString readString () const
readBytes () Legas la realan valoron de la subindekso en bajtoj.
virtual ResultArrayByte readBytes () const
writeNumber () Skribas nombran valoron en la subindekso.
virtual ResultVoid writeNumber (const int64_t value) const
writeBytes () Skribas valoron en la subindekso en bajtoj.
virtual ResultVoid writeBytes (std::vector <uint8_t> const & data) const
8.22 OdIndekso
Uzu ĉi tiun klason (neŝanĝebla ekde kreado) por envolvi kaj lokalizi objektajn dosierujojn/sub-indeksojn. La OD de aparato havas ĝis 65535 (0xFFFF) vicojn kaj 255 (0xFF) kolumnojn; kun interspacoj inter la malkontinuaj vicoj. Vidu la CANopen-normon kaj vian produktan manlibron por pli da detaloj.
OdIndex () Konstruas novan OdIndex-objekton.
nlc::OdIndex::OdIndex (uint16_t index, uint8_t subIndex)
Subindekso de parametroj
De 0 ĝis 65535 (0xFFFF) inkl. De 0 ĝis 255 (0xFF) inkl.
getIndex () Legas la indekson (de 0x0000 ĝis 0xFFFF).
uint16_t nlc::OdIndex::getIndex () const
Returns uint16_t
getSubindex () Legas la subindekson (de 0x00 ĝis 0xFF)
uint8_t nlc::OdIndex::getSubIndex () const
Versio: doc 1.4.2 / NanoLib 1.3.0
39
8 Klasoj / funkcioj referenco
Returns uint8_t
toString () Liveras la indekson kaj subindekson kiel ĉeno. La defaŭlta ĉeno 0xIIII:0xSS legas jene:
I = indekso de 0x0000 ĝis 0xFFFF
S = sub-indekso de 0x00 ĝis 0xFF
std::string nlc::OdIndex::toString () konst
Donas 0xIIII:0xSS
Defaŭlta korda prezento
8.23 OdLibrary
Uzu ĉi tiun programan interfacon por krei okazojn de la klaso ObjectDictionary el XML. Per assignObjectDictionary, vi povas tiam ligi ĉiun okazon al specifa aparato pro unike kreita identigilo. ObjectDictionary-okazoj tiel kreitaj estas stokitaj en la objekto OdLibrary alirebla per indekso. La ODLibrary klaso ŝargas ObjectDictionary erojn de file aŭ tabelo, stokas ilin, kaj havas la sekvajn publikajn membrofunkciojn:
getObjectDictionaryCount () virtual uint32_t getObjectDictionaryCount () const
getObjectDictionary () virtual ResultObjectDictionary getObjectDictionary (uint32_t odIndex)
Liveras ResultObjectDictionary
aldoniObjektonVortaroDeFile ()
virtual ResultObjectDictionary addObjectDictionaryFromFile (std::string const & absoluteXmlFileVojo)
Liveras ResultObjectDictionary
addObjectDictionary ()
virtual ResultObjectDictionary addObjectDictionary (std::vector <uint8_t> const & odXmlData, const std::string &xmlFileVojo = std::string ())
Liveras ResultObjectDictionary
8.24 OdTypesHelper
In addition to the following public member functions, this class contains custom data types. Note: To check your custom data types, look for the enum class ObjectEntryDataType in od_types.hpp.
uintToObjectCode () Konvertas sensignajn entjerojn al objektokodo:
Null Deftype
0x00 0x05
Versio: doc 1.4.2 / NanoLib 1.3.0
40
8 Klasoj / funkcioj referenco
Defstruct Var Array Record
0x06 0x07 0x08 0x09
static ObjectCode uintToObjectCode (unsigned int objectCode)
isNumericDataType () Informas ĉu datumtipo estas nombra aŭ ne.
static bool isNumericDataType (ObjectEntryDataType dataType)
isDefstructIndex () Informas ĉu objekto estas difinstruktura indekso aŭ ne.
static bool isDefstructIndex (uint16_t typeNum)
isDeftypeIndex () Informas ĉu objekto estas difina tipo indekso aŭ ne.
static bool isDeftypeIndex (uint16_t typeNum)
isComplexDataType () Informas ĉu datumtipo estas kompleksa aŭ ne.
static bool isComplexDataType (ObjectEntryDataType dataType)
uintToObjectEntryDataType () Konvertas sensignajn entjerojn al OD-datumtipo.
sstatic ObjectEntryDataType uintToObjectEntryDataType (uint16_t objectDataType)
objectEntryDataTypeToString () Konvertas OD-datupon al ĉeno.
static std::string objectEntryDataTypeToString (ObjectEntryDataType odDataType)
stringToObjectEntryDatatype () Konvertas string al OD-datumtipo se eble. Alie, liveras UNKNOWN_DATATYPE.
static ObjectEntryDataType stringToObjectEntryDatatype (std::string dataTypeString)
Versio: doc 1.4.2 / NanoLib 1.3.0
41
8 Klasoj / funkcioj referenco
objectEntryDataTypeBitLength () Informas pri bita longo de objekto-eniga datumtipo.
static uint32_t objectEntryDataTypeBitLength (ObjectEntryDataType const & dataType)
8.25 RESTfulBus-strukturo
Ĉi tiu strukturo enhavas la komunikajn agordajn elektojn por la RESTful-interfaco (super Ethernet). Ĝi enhavas la sekvajn publikajn atributojn:
const std::string const unsigned long const std::string const unsigned long const std::string const unsigned long
CONNECT_TIMEOUT_OPTION_NAME = “Ripoza Konekto-Tempozo” DEFAULT_CONNECT_TIMEOUT = 200 REQUEST_TIMEOUT_OPTION_NAME = “Ripoza Peto-Tempozo” DEFAULT_REQUEST_TIMEOUT = 200 RESPONSE_TIMEOUT_OPTION_NAME = “RESTful Respondeca Tempo ekskludo” DEFAULT_750OUT_XNUMX RESPONSE
8.26 ProfinetDCP
Sub Linukso, la voka aplikaĵo bezonas kapablojn CAP_NET_ADMIN kaj CAP_NET_RAW. Por ebligi: sudo setcap 'cap_net_admin,cap_net_raw+eip' ./executable. En Vindozo, la ProfinetDCP-interfaco uzas WinPcap (provitan kun versio 4.1.3) aŭ Npcap (provitan kun versioj 1.60 kaj 1.30). Ĝi tiel serĉas la dinamike ŝarĝitan bibliotekon wpcap.dll en la sekva ordo (Noto: neniu nuna subteno de Win10Pcap):
1. Nanolib.dll-dosierujo 2. Vindoza sistemdosierujo SystemRoot%System32 3. Npcap-instala dosierujo SystemRoot%System32Npcap 4. Media vojo
Ĉi tiu klaso reprezentas Profinet DCP-interfacon kaj havas la sekvajn publikajn membrofunkciojn:
getScanTimeout () Informas pri skanado de aparato (defaŭlte = 2000 ms).
virtual uint32_t nlc::ProfinetDCP::getScanTimeout () const
setScanTimeout () Agordas la skanadon de aparato (defaŭlte = 2000 ms).
virtual void nlc::setScanTimeout (uint32_t timeoutMsec)
getResponseTimeout () Informas pri aparato-respondtempo por agordo, restarigo kaj palpebrumado (defaŭlte = 1000 ms).
virtual uint32_t nlc::ProfinetDCP::getResponseTimeout () const
setResponseTimeout () Informas pri aparato-respondtempo por agordaj, rekomencigitaj kaj palpebrumaj operacioj (defaŭlte = 1000 ms).
virtual void nlc::ProfinetDCP::setResponseTimeout (uint32_t timeoutMsec)
Versio: doc 1.4.2 / NanoLib 1.3.0
42
8 Klasoj / funkcioj referenco
estasServoDisponebla ()
Uzu ĉi tiun funkcion por kontroli la haveblecon de la servo de Profinet DCP.
Network adapter validity / availability Windows: WinPcap / Npcap availability Linux: CAP_NET_ADMIN / CAP_NET_RAW capabilities
virtual ResultVoid nlc::ProfinetDCP::isServiceAvailable (const BusHardwareId & busHardwareId)
Parametroj BusHardwareId Redonas vera
malvera
Aparataro ID de Profinet DCP-servo por kontroli. Servo disponeblas. Servo ne disponeblas.
scanProfinetDevices () Uzu ĉi tiun funkcion por skani la aparataron por la ĉeesto de Profinet-aparatoj.
virtual ResultProfinetDevices scanProfinetDevices (const BusHardwareId & busHardwareId)
Parametroj BusHardwareId Revenas ResultProfinetDevices
Specifas ĉiun kampbuson por malfermi. Aparataro estas malfermita.
setupProfinetDevice () Establas la sekvajn aparatajn agordojn:
Aparato nomo
IP-adreso
Reta masko
Defaŭlta enirejo
virtual ResultVoid nlc::setupProfinetDevice (const BusHardwareId & busHardwareId, const ProfinetDevice struct & profinetDevice, bool savePermanent)
resetProfinetDevice () Maldaŭrigas la aparaton kaj restarigas ĝin al la fabrikaj defaŭltoj.
virtual ResultVoid nlc::resetProfinetDevice (const BusHardwareId & busHardwareId, const ProfinetDevice & profinetDevice)
blinkProfinetDevice () Ordonas al la Profinet-aparato komenci palpebrumi sian Profinet-LED.
virtual ResultVoid nlc::blinkProfinetDevice (const BusHardwareId & busHardwareId, const ProfinetDevice &profinetDevice)
validateProfinetDeviceIp () Uzu ĉi tiun funkcion por kontroli la IP-adreson de la aparato.
virtual ResultVoid validateProfinetDeviceIp (const BusHardwareId &busHardwareId, const ProfinetDevice & profinetDevice)
Parametroj BusHardwareId ProfinetDevice
Specifas la aparataron ID por kontroli. Specifas la Profinet-aparaton por validigi.
Versio: doc 1.4.2 / NanoLib 1.3.0
43
8 Klasoj / funkcioj referenco
Revenas ResultVoid
8.27 ProfinetDevice-strukturo
La datumoj de la aparato de Profinet havas la jenajn publikajn atributojn:
std::string std::string std::array< uint8_t, 6 > uint32_t uint32_t uint32_t
deviceName deviceVendor macAddress ipAddress netMask defaultGateway
La MAC-adreso estas provizita kiel tabelo en formato macAddress = {xx, xx, xx, xx, xx, xx}; dum IP-adreso, reta masko kaj enirejo estas ĉiuj interpretitaj kiel big endian-heksaj nombroj, kiel ekzemple:
IP-adreso: 192.168.0.2 Reta masko: 255.255.0.0 Enirejo: 192.168.0.1
0xC0A80002 0xFFFF0000 0xC0A80001
8.28 Rezultaj klasoj
Uzu la "laŭvolajn" revenvalorojn de ĉi tiuj klasoj por kontroli ĉu funkciovoko havis sukceson aŭ ne, kaj ankaŭ lokalizi la malsukcesajn kialojn. Sukcese, la funkcio hasError () resendas malvera. Per getResult (), vi povas legi la rezultan valoron laŭ tipo (ResultInt ktp.). Se voko malsukcesas, vi legu la kialon per getError ().
Protektitaj atributoj
ĉeno NlcErrorCode uint32_t
errorString errorCode exErrorCode
Ankaŭ, ĉi tiu klaso havas la sekvajn publikajn membrofunkciojn:
hasError () Legas la sukceson de funkciovoko.
bool nlc::Result::hasError () const
Revenoj
vera malvera
Malsukcesa voko. Uzu getError () por legi la valoron. Sukcesa voko. Uzu getResult () por legi la valoron.
getError () Legas la kialon se funkcio-voko malsukcesas.
const std::string nlc::Result::getError () const
Liveras konstan ĉenon
Versio: doc 1.4.2 / NanoLib 1.3.0
44
8 Klasoj / funkcioj referenco
result () The following functions aid in defining the exact results:
Result (std::string const & errorString_)
Result (NlcErrorCode const & errCode, std::string const & errorString_)
Result (NlcErrorCode const & errCode, const uint32_t exErrCode, std::string const & errorString_)
Result (Result const & result)
getErrorCode () Legu la NlcErrorCode.
NlcErrorCode getErrorCode () const
getExErrorCode () uint32_t getExErrorCode () const
8.28.1 ResultVoid
NanoLib sendas al vi ekzemplon de ĉi tiu klaso se la funkcio resendas malplena. La klaso heredas la publikajn funkciojn kaj protektitajn atributojn de la rezultklaso kaj havas la sekvajn publikajn membrofunkciojn:
ResultVoid () La sekvaj funkcioj helpas difini la precizan malplenan rezulton:
ResultVoid (std::string const &errorString_)
ResultVoid (NlcErrorCode const & errCode, std::string const & errorString_)
ResultVoid (NlcErrorCode const & errCode, const uint32_t exErrCode, std:: string const & errorString_)
ResultVoid (Result const & result)
8.28.2 ResultInt
NanoLib sendas al vi ekzemplon de ĉi tiu klaso se la funkcio liveras entjeron. La klaso heredas la publikajn funkciojn/protektitajn atributojn de la rezultklaso kaj havas la sekvajn publikajn membrofunkciojn:
getResult () Liveras la entjeran rezulton se funkciovoko havis sukceson.
int64_t getResult () const
Returns int64_t
Versio: doc 1.4.2 / NanoLib 1.3.0
45
8 Klasoj / funkcioj referenco
ResultInt () La sekvaj funkcioj helpas difini la precizan entjerrezulton:
ResultInt (int64_t result_)
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 (Result const & result)
8.28.3 ResultString
NanoLib sendas al vi ekzemplon de ĉi tiu klaso se la funkcio resendas ĉenon. La klaso heredas la publikajn funkciojn/protektitajn atributojn de la rezultklaso kaj havas la sekvajn publikajn membrofunkciojn:
getResult () Legas la ĉenrezulton se funkciovoko havis sukceson.
const std::string nlc::ResultString::getResult () const
Liveras konstan ĉenon
ResultString () La sekvaj funkcioj helpas difini la ĝustan ĉenrezulton:
ResultString (std::string const & message, bool hasError_)
ResultString (NlcErrorCode const & errCode, std::string const & errorString_)
ResultString (NlcErrorCode const & errCode, const uint32_t exErrCode, std:: string const & errorString_)
ResultString (Result const & result)
8.28.4 ResultArrayByte
NanoLib sends you an instance of this class if the function returns a byte array. The class inherits the public functions / protected attributes from the result class and has the following public member functions:
getResult () Reads out the byte vector if a function call had success.
const std::vector <uint8_t> nlc::ResultArrayByte::getResult () const
Returns const vector<uint8_t>
Versio: doc 1.4.2 / NanoLib 1.3.0
46
8 Klasoj / funkcioj referenco
ResultArrayByte () La sekvaj funkcioj helpas difini la ĝustan bajtan tabelrezulton:
ResultArrayByte (std::vector <uint8_t> const & result_)
ResultArrayByte (std::string const & errorString_)
ResultArrayByte (NlcErrorCode const & errCode, std::string const & error String_)
ResultArrayByte (NlcErrorCode const & errCode, const uint32_t exErrCode, std:: string const & errorString_)
ResultArrayByte (Result const & result)
8.28.5 ResultArrayInt
NanoLib sends you an instance of this class if the function returns an integer array. The class inherits the public functions / protected attributes from the result class and has the following public member functions:
getResult () Reads out the integer vector if a function call had success.
const std::vector <int64_t> nlc::ResultArrayInt::getResult () const
Returns const vector<uint64_t>
ResultArrayInt () La sekvaj funkcioj helpas difini la precizan entjeran tabelrezulton:
ResultArrayInt (std::vector <int64_t> const & result_)
ResultArrayInt (std::string const & errorString_)
ResultArrayInt (NlcErrorCode const & errCode, std::string const & error String_)
ResultArrayInt (NlcErrorCode const & errCode, const uint32_t exErrCode, std:: string const & errorString_)
ResultArrayInt (Result const & result)
8.28.6 ResultBusHwIds
NanoLib sends you an instance of this class if the function returns a bus hardware ID array. The class inherits the public functions / protected attributes from the result class and has the following public member functions:
getResult () Reads out the bus-hardware-ID vector if a function call had success.
const std::vector <BusHardwareId> nlc::ResultBusHwIds::getResult () const
Parametroj konst vektora
Versio: doc 1.4.2 / NanoLib 1.3.0
47
8 Klasoj / funkcioj referenco
ResultBusHwIds () La sekvaj funkcioj helpas difini la precizan bus-hardware-ID-aran rezulton:
ResultBusHwIds (std::vector <BusHardwareId> const & result_)
ResultBusHwIds (std::string const & errorString_)
ResultBusHwIds (NlcErrorCode const & errCode, std::string const & errorString_)
ResultBusHwIds (NlcErrorCode const & errCode, const uint32_t exErrCode, std::string const & errorString_)
ResultBusHwIds (Result const & result)
8.28.7 ResultDeviceId
NanoLib sends you an instance of this class if the function returns a device ID. The class inherits the public functions / protected attributes from the result class and has the following public member functions:
getResult () Legas la aparatan ID-vektoron se funkciovoko sukcesis.
DeviceId nlc::ResultDeviceId::getResult () const
Revenas konstan vektoron
ResultDeviceId () La sekvaj funkcioj helpas difini la ĝustan aparaton ID-rezulton:
ResultDeviceId (DeviceId const & result_)
ResultDeviceId (std::string const & errorString_)
ResultDeviceId (NlcErrorCode const & errCode, std::string const & errorString_)
ResultDeviceId (NlcErrorCode const & errCode, const uint32_t exErrCode, std::string errorString_)
ResultDeviceId (Result const & result)
8.28.8 ResultDeviceIds
NanoLib sends you an instance of this class if the function returns a device ID array. The class inherits the public functions / protected attributes from the result class and has the following public member functions:
getResult () Returns the device ID vector if a function call had success.
DeviceId nlc::ResultDeviceIds::getResult () const
Revenas konstan vektoron
Versio: doc 1.4.2 / NanoLib 1.3.0
48
8 Klasoj / funkcioj referenco
ResultDeviceIds () La sekvaj funkcioj helpas difini la precizan rezulton de aparato-ID-tabelo:
ResultDeviceIds (std::vector <DeviceId> const & result_)
ResultDeviceIds (std::string const & errorString_)
ResultDeviceIds (NlcErrorCode const & errCode, std::string const & errorString_)
ResultDeviceIds (NlcErrorCode const & errCode, const uint32_t exErrCode, std::string const & errorString_)
ResultDeviceIds (Result const & result)
8.28.9 ResultDeviceHandle
NanoLib sends you an instance of this class if the function returns the value of a device handle. The class inherits the public functions / protected attributes from the result class and has the following public member functions:
getResult () Legas la aparatan tenilon se funkciovoko sukcesis.
DeviceHandle nlc::ResultDeviceHandle::getResult () const
Revenas DeviceHandle
ResultDeviceHandle () La sekvaj funkcioj helpas difini la ĝustan aparaton pritraktilo rezulton:
ResultDeviceHandle (DeviceHandle const & result_)
ResultDeviceHandle (std::string const & errorString_)
ResultDeviceHandle (NlcErrorCode const & errCode, std::string const & errorString_)
ResultDeviceHandle (NlcErrorCode const & errCode, const uint32_t exErrCode, std::string const & errorString_)
ResultDeviceHandle (Result const & result)
8.28.10 RezultoObjektoVortaro
NanoLib sendas al vi ekzemplon de ĉi tiu klaso se la funkcio resendas la enhavon de objektovortaro. La klaso heredas la publikajn funkciojn/protektitajn atributojn de la rezultklaso kaj havas la sekvajn publikajn membrofunkciojn:
getResult () Legas la aparatan ID-vektoron se funkciovoko sukcesis.
const nlc::ObjectDictionary & nlc::ResultObjectDictionary::getResult () const
Versio: doc 1.4.2 / NanoLib 1.3.0
49
8 Klasoj / funkcioj referenco
Revenoj
konst-vektoro
ResultObjectDictionary () La sekvaj funkcioj helpas difini la precizan objektvortaran rezulton:
ResultObjectDictionary (nlc::ObjectDictionary const & result_)
ResultObjectDictionary (std::string const & errorString_)
ResultObjectDictionary (NlcErrorCode const & errCode, std::string const & errorString_)
ResultObjectDictionary (NlcErrorCode const & errCode, const uint32_t exErrCode, std::string const & errorString_)
ResultObjectDictionary (Result const & result)
8.28.11 ResultConnectionState
NanoLib sendas al vi ekzemplon de ĉi tiu klaso se la funkcio liveras informojn pri aparato-konekto-ŝtato. La klaso heredas la publikajn funkciojn/protektitajn atributojn de la rezultklaso kaj havas la sekvajn publikajn membrofunkciojn:
getResult () Legas la aparatan tenilon se funkciovoko sukcesis.
DeviceConnectionStateInfo nlc::ResultConnectionState::getResult () const
Revenas DeviceConnectionStateInfo Konektita / Malkonektita / KonektitaBootloader
ResultConnectionState () La sekvaj funkcioj helpas difini la ĝustan konektan statorezulton:
ResultConnectionState (DeviceConnectionStateInfo const & result_)
ResultConnectionState (std::string const & errorString_)
ResultConnectionState (NlcErrorCode const & errCode, std::string const & errorString_)
ResultConnectionState (NlcErrorCode const & errCode, const uint32_t exErrCode, std::string const & errorString_)
ResultConnectionState (Result const & result)
8.28.12 ResultObjectEntry
NanoLib sends you an instance of this class if the function returns an object entry. The class inherits the public functions / protected attributes from the result class and has the following public member functions:
Versio: doc 1.4.2 / NanoLib 1.3.0
50
8 Klasoj / funkcioj referenco
getResult () Returns the device ID vector if a function call had success.
nlc::ObjectEntry const& nlc::ResultObjectEntry::getResult () const
Redonas const ObjectEntry
ResultObjectEntry () La sekvaj funkcioj helpas difini la precizan objekton enirrezulton:
ResultObjectEntry (nlc::ObjectEntry const & result_)
ResultObjectEntry (std::string const & errorString_)
ResultObjectEntry (NlcErrorCode const & errCode, std::string const & errorString_)
ResultObjectEntry (NlcErrorCode const & errCode, const uint32_t exErrCode, std::string const & errorString_)
ResultObjectEntry (Result const & result)
8.28.13 ResultObjectSubEntry
NanoLib sends you an instance of this class if the function returns an object sub-entry. The class inherits the public functions / protected attributes from the result class and has the following public member functions:
getResult () Returns the device ID vector if a function call had success.
nlc::ObjectSubEntry const & nlc::ResultObjectSubEntry::getResult () const
Redonas const ObjectSubEntry
ResultObjectSubEntry () La sekvaj funkcioj helpas difini la precizan objektan subendon rezulton:
ResultObjectSubEntry (nlc::ObjectEntry const & result_)
ResultObjectSubEntry (std::string const & errorString_)
ResultObjectSubEntry (NlcErrorCode const & errCode, std::string const & errorString_)
ResultObjectSubEntry (NlcErrorCode const & errCode, const uint32_t exErrCode, std::string const & errorString_)
ResultObjectSubEntry (Result const & result)
8.28.14 ResultProfinetDevices
NanoLib sendas al vi ekzemplon de ĉi tiu klaso se la funkcio resendas Profinet-aparaton. La klaso heredas la publikajn funkciojn/protektitajn atributojn de la rezultklaso kaj havas la sekvajn publikajn membrofunkciojn:
Versio: doc 1.4.2 / NanoLib 1.3.0
51
8 Klasoj / funkcioj referenco
getResult () Legas la Profinet-aparatan vektoron se funkciovoko sukcesis.
const std::vector <ProfinetDevice> & getResult () const
ResultProfinetDevices () La sekvaj funkcioj helpas difini la precizajn Profinet-aparatojn.
ResultProfinetDevices (const std::vector <ProfinetDevice> & profinetDevices)
ResultProfinetDevices (const Result & result)
ResultProfinetDevices (const std::string &errorText, NlcErrorCode errorCode = NlcErrorCode::GeneralError, uint32_t extendedErrorCode = 0)
8.28.15 RezultojampleDataArray
NanoLib sendas al vi ekzemplon de ĉi tiu klaso se la funkcio revenas kielample datuma tabelo. La klaso heredas la publikajn funkciojn/protektitajn atributojn de la rezultklaso kaj havas la sekvajn publikajn membrofunkciojn:
getResult () Legas la datuman tabelon se funkciovoko sukcesis.
const std::vector <SampleData> & getResult () const
RezultoampleDataArray () La sekvaj funkcioj helpas difini la precizajn Profinet-aparatojn.
RezultoampleDataArray (const std::vector <SampleData> & dataArray)
RezultoampleDataArray (const std::string &errorDesc, const NlcErrorCode errorCode = NlcErrorCode::GeneralError, const uint32_t extendedErrorCode = 0)
RezultoampleDataArray (const ResultSampleDataArray & other)
RezultoampleDataArray (const Result & result)
8.28.16 RezultojamplerState
NanoLib sendas al vi ekzemplon de ĉi tiu klaso se la funkcio revenas kielampler state.Ĉi tiu klaso heredas la publikajn funkciojn/protektitajn atributojn de la rezultklaso kaj havas la jenajn publikajn membrofunkciojn:
getResult () Legas la sampler ŝtatvektoro se funkciovoko havis sukceson.
SamplerState getResult () const
Revenas SamplerState>
Neagordita / Agordita / Preta / Funkcianta / Finita / Malsukcesa / Nuligite
Versio: doc 1.4.2 / NanoLib 1.3.0
52
8 Klasoj / funkcioj referenco
RezultoamplerState () La sekvaj funkcioj helpas difini la precizan sampler stato.
RezultoamplerState (const Samplerŝtata ŝtato)
RezultoamplerState (const std::string & errorDesc, const NlcErrorCode errorCode = NlcErrorCode::GeneralError, const uint32_t
extendedErrorCode = 0)
RezultoamplerState (const ResultSamplerState & other)
RezultoamplerState (const Result & result)
8.29 NlcErrorCode
Se io misfunkcias, la rezultklasoj raportas unu el la erarkodoj listigitaj en ĉi tiu listigo.
Error code Success GeneralError BusUnavailable CommunicationError ProtocolError
ODDoesNotExist ODInvalidAccess ODTypeMismatch OperationAborted OperationNotSupported InvalidOperation
NevalidajArgumentoj AliroMalpermesita RimedoNeTrovita RimedoUnavailable OutOfMemory TimeOutError
C: Kategorio D: Priskribo R: Kialo C: Neniu. D: Neniu eraro. R: La operacio sukcese finiĝis.
C: Nespecifita. D: Nespecifita eraro. R: Fiasko kiu konvenas al neniu alia kategorio.
C: Buso. D: Aparataro buso ne havebla. R: Buso neekzistanta, tranĉita aŭ difekto.
C: Komunikado. D: Komunikado nefidinda. R: Neatenditaj datumoj, malĝusta CRC, eraroj de kadro aŭ egaleco ktp.
C: Protokolo. D: Protokola eraro. R: Respondo post nesubtenata protokolo-opcio, nesubtenata protokolo pri aparata raporto, eraro en la protokolo (ekzemple, SDO-segmento-sinkroniga bito), ktp. R: Respondo aŭ aparato-raporto al nesubtenata protokolo (opcioj) aŭ al eraroj en protokolo (ekzemple, SDO). segmenta sinkroniga bito), ktp. R: Nesubtenata protokolo (opcioj) aŭ eraro en protokolo (ekzemple, SDO-segmento-sinkroniga bito), ktp.
C: Object dictionary. D: OD address inexistent. R: No such address in the object dictionary.
C: Objekta vortaro. D: Aliro al OD-adreso nevalida. R: Provu skribi nurlegeblan, aŭ legi el nurskribebla adreso.
C: Objekta vortaro. D: Tipo miskongruo. R: Valoro nekonvertita al specifita tipo, ekzemple, en provo trakti ĉenon kiel nombron.
C: Apliko. D: Procezo abortita. R: Procezo tranĉita per aplika peto. Revenas nur ĉe operacia interrompo per revokfunkcio, ekzemple, de bus-skanado.
C: Ofta. D: Procezo nesubtenata. R: Neniu aparatara buso/aparata subteno.
C: Ofta. D: Procezo malĝusta en nuna kunteksto, aŭ malvalida kun aktuala argumento. R: Rekonektoprovo al jam konektitaj busoj/aparatoj. Malkonekti provo al jam malkonektitaj. Provo de operacio de ekŝargilo en firmvarreĝimo aŭ inverse.
C: Ofta. D: Argumento nevalida. R: Malĝusta logiko aŭ sintakso.
C: Ofta. D: Aliro estas malpermesata. R: Manko de rajtoj aŭ kapabloj por plenumi la petitan operacion.
C: Ofta. D: Specifita ero ne trovita. R: Aparataro buso, protokolo, aparato, OD-adreso sur aparato, aŭ file ne estis trovita.
C: Ofta. D: Specifita ero ne trovita. R: okupata, neekzistanta, fortranĉita aŭ difekto.
C: Ofta. D: Nesufiĉa memoro. R: Tro malmulte da memoro por procesi ĉi tiun komandon.
C: Ofta. D: Procezo elĉerpita. R: Reveno post la eksvalidiĝo. Tempo povas esti tempo de responda aparato, tempo por akiri komunan aŭ ekskluzivan rimedan aliron, aŭ tempo por ŝanĝi la buson/aparaton al taŭga stato.
Versio: doc 1.4.2 / NanoLib 1.3.0
53
8 Klasoj / funkcioj referenco
8.30 NlcCallback
This parent class for callbacks has the following public member function: callback ()
virtual ResultVoid callback ()
Revenoj
ResultVoid
8.31 NlcDataTransferCallback
Use this callback class for data transfers (firmware update, NanoJ upload etc.). 1. For a firmware upload: Define a “co-class” extending this one with a custom callback method
implementation. 2. Use the “co-class’s” instances in NanoLibAccessor.uploadFirmware () calls. The main class itself has the following public member function:
callback () virtual ResultVoid callback (nlc::DataTransferInfo info, int32_t data)
Revenoj
ResultVoid
8.32 NlcScanBusCallback
Use this callback class for bus scanning. 1. Define a “co-class” extending this one with a custom callback method implementation. 2. Use the “co-class’s” instances in NanoLibAccessor.scanDevices () calls. The main class itself has the following public member function.
revoko ()
virtual ResultVoid callback (nlc::BusScanInfo info, std::vector <DeviceId> const & devicesFound, int32_t data)
Revenas ResultVoid
8.33 NlcLoggingCallback
Uzu ĉi tiun revokklason por registri revokojn. 1. Difinu klason, kiu etendas ĉi tiun klason per kutima revokmetoda efektivigo 2. Uzu montrilon al ĝiaj okazoj por agordi revokon per NanoLibAccessor >
setLoggingCallback (...).
virtual void callback (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_since_epoch, const size_t thread_id)
8.34 SamplerInterfaco
Uzu ĉi tiun klason por agordi, komenci kaj haltigi la sampler, aŭ akiri sampgvidis datumojn kaj alporti kielampstato de ler aŭ lasta eraro. La klaso havas la sekvajn publikajn membrofunkciojn.
Versio: doc 1.4.2 / NanoLib 1.3.0
54
8 Klasoj / funkcioj referenco
configure () Agordas kielampler.
virtual ResultVoid nlc::SamplerInterface::configure (const DeviceHandle deviceHandle, const SamplerConfiguration & samplerAgordo)
Parametroj [en] deviceHandle [en] samplerConfiguration
Revenas ResultVoid
Specifas kian aparaton agordi la sampler for. Specifas la valorojn de agordaj atributoj. Konfirmas ke malplena funkcio funkciis.
getData () Akiras la sampgviditaj datumoj.
virtual ResultSampleDataArray nlc::SamplerInterface::getData (const DeviceHandle deviceHandle)
Parametroj [en] deviceHandle ResultSampleDataArray
Specifas por kiu aparato akiri la datumojn.
Liveras la sampgvidis datumoj, kiuj povas esti malplena tabelo se samplerNotify estas aktiva je komenco.
getLastError () Akiras kielampla lasta eraro de ler.
virtual ResultVoid nlc::SamplerInterface::getLastError (const DeviceHandle deviceHandle)
Revenas ResultVoid
Konfirmas ke malplena funkcio funkciis.
getState () Akiras kielampstatuso de ler.
virtual ResultSamplerState nlc::SamplerInterface::getState (const DeviceHandle deviceHandle)
Revenas RezultojamplerState
Liveras la sampler stato.
start () Komencas kielampler.
virtual ResultVoid nlc::SamplerInterface::start (const DeviceHandle deviceHandle, SamplerNotify* samplerNotify, int64_t applicationData)
Parametroj [en] deviceHandle [en] SamplerNotify [en] applicationData
Revenas ResultVoid
Specifas kian aparaton komenci la sampler for.
Specifas kiajn laŭvolajn informojn raporti (povas esti nullptr).
Opcio: Plusendas aplikaĵ-rilatajn datumojn (uzant-difinita 8-bita tabelo de valoro/aparato ID/indekso, aŭ datotempo, indikilo de variablo/funkcio, ktp.) al samplerNotify.
Konfirmas ke malplena funkcio funkciis.
Versio: doc 1.4.2 / NanoLib 1.3.0
55
8 Klasoj / funkcioj referenco
halti () Haltas kielampler.
virtual ResultVoid nlc::SamplerInterface::stop (const DeviceHandle deviceHandle)
Parametroj [en] deviceHandle Revenas ResultVoid
Specifas kian aparaton haltigi la sampler for. Konfirmas ke malplena funkcio funkciis.
8.35 SamplerConfiguration struct
Ĉi tiu strukturo enhavas la datumojn sampla agordajn opciojn de ler (senmovaj aŭ ne).
Publikaj atributoj
std::vektoro spuritaj Adresoj
Ĝis 12 OD-adresoj estu sampgvidis.
uint32_t
versio
Versio de strukturo.
uint32_t
daŭroMilisekundoj
Sampling daŭro en ms, de 1 ĝis 65535
uint16_t
periodoMilisekundoj
Sampling periodo en ms.
uint16_t
nombroOfSamples
Samples kvanto.
uint16_t
preTriggerNumberOfSamples
Samples pre-trigger kvanto.
bool
uzanteProgramefektivigon
Uzu programaran efektivigon.
bool
uzante NewFWSamplerImplementation Uzu FW-efektivigon por aparatoj kun a
FW-versio v24xx aŭ pli nova.
SamplerMode
reĝimo
Normala, ripeta aŭ kontinua sampling.
SamplerTriggerCondition triggerCondition
Start trigger conditions: 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_OR_EQUAL = 0x16 TC_LESS = 0x17 TC_LESS_OR_EQUAL = 0x18 TC_EQUAL = 0x19 TC_NOT_EQUAL = 0x1A TC_ONE_EDGE = 0x1B TC_MULTI_EDGE = 0x1C, OdIndex, triggerValue
SamplerTrigger
SamplerTrigger
ellasilo por komenci kielampler?
Senmovaj publikaj atributoj
static constexpr size_t SAMPLER_CONFIGURATION_VERSION = 0x01000000 statika konstexpr size_t MAX_TRACKED_ADDRESSES = 12
8.36 SamplerNotify
Uzu ĉi tiun klason por aktivigi sampler sciigoj kiam vi komencas kielampler. La klaso havas la sekvan publikan membrofunkcion.
Versio: doc 1.4.2 / NanoLib 1.3.0
56
8 Klasoj / funkcioj referenco
notify ()
Delivers a notification entry.
virtual void nlc::SamplerNotify::notify (const ResultVoid & lastError, const SamplerState samplerState, const std::vector <SampleData> & sampleDatas, int64_t applicationData)
Parametroj [en] lastError [en] samplerState
[en] sampleDatas [en] applicationData
Raportas ke la lasta eraro okazis dum sampling. Raportas la sampler-stato je sciiga tempo: Neagordita / Agordita / Preta / Funkcianta / Finita / Malsukcesa / Nuligita. Raportas la sampled-datuma tabelo. Raportas aplikaĵ-specifajn datumojn.
8.37 SampleData strukturo
Ĉi tiu strukturo enhavas la sampgviditaj datumoj.
uin64_t iteracioNumero
Komencas je 0 kaj nur pliiĝas en ripetema reĝimo.
std::vector<SampledValues> Enhavas li tabelon de sampgvidis valorojn.
8.38 SampledValue strukturo
Ĉi tiu strukturo enhavas la sampgvidis valorojn.
in64_t valoro uin64_t CollectTimeMsec
Enhavas la valoron de spurita OD-adreso.
Enhavas la kolektotempon en milisekundoj, relative al la sample komenco.
8.39 SamplerTrigger struct
Ĉi tiu strukturo enhavas la ellasilajn agordojn de la sampler.
SamplerTriggerCondition kondiĉo
OdIndex uin32_t valoro
The trigger condition: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_OR_EQUAL = 0x16 TC_LESS = 0x17 TC_LESS_OR_EQUAL = 0x18 TC_EQUAL = 0x19 TC_NOT_EQUAL = 0x1A TC_ONE_EDGE = 0x1B TC_MULTI_EDGE = 0x1C
La OdIndex de la ellasilo (adreso).
Kondiĉvaloro aŭ bita nombro (komencante de bito nul).
8.40 Seria strukturo
Trovu ĉi tie viajn seriajn komunikajn elektojn kaj la jenajn publikajn atributojn:
const std::string const SerialBaudRate
BAUD_RATE_OPTIONS_NAME = “serial baud rate” baudRate =SerialBaudRate struct
Versio: doc 1.4.2 / NanoLib 1.3.0
57
8 Klasoj / funkcioj referenco
const std::string const SerialParity
PARITY_OPTIONS_NAME = “serial parity” parity = SerialParity struct
8.41 SerialBaudRate-strukturo
Trovu ĉi tie vian serian komunikan baudrapidecon kaj la jenajn publikajn atributojn:
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 = “_57600” 57600” BAUD_RATE_115200 = “115200” BAUD_RATE_128000 = “128000” BAUD_RATE_256000 = “256000”
8.42 SerialParity-strukturo
Trovu ĉi tie viajn seriajn egalecajn opciojn kaj la jenajn publikajn atributojn:
const std::string const std::string const std::string const std::string const std::string
NONE = "neniu" NPARA = "nepara" EVEN = "para" MARKO = "marko" SPACE = "spaco"
Versio: doc 1.4.2 / NanoLib 1.3.0
58
9 Permesiloj
9 Permesiloj
NanoLib API interface headers and exampLa fontkodo estas permesita de Nanotec Electronic GmbH & Co. KG laŭ la permesilo Krea Komunaĵo Atribuite 3.0 Neadaptita (CC BY). Bibliotekaj partoj provizitaj en binara formato (kernaj kaj kampbusaj komunikadbibliotekoj) estas licencitaj laŭ la Krea Komunaĵo AtribuiteNeDerivaĵoj 4.0 Internacia Licenco (CC BY ND).
Krea Komunaĵo
La jena homlegebla resumo ne anstataŭigos la permesilon(j)n mem. Vi povas trovi la respektivan permesilon ĉe creativecommons.org kaj ligitan sube. Vi rajtas:
CC BY 3.0
Kunhavigi: Vidu ĝuste. Adapti: Remiksu, transformu kaj konstruu sur la
materialo por ajna celo, eĉ komerce.
CC BY-ND 4.0
Kunhavigi: Kopiu kaj redistribuu la materialon en iu ajn rimedo aŭ formato.
La licencanto ne povas revoki ĉi-suprajn liberecojn kondiĉe ke vi obeas la sekvajn licenckondiĉojn:
CC BY 3.0
CC BY-ND 4.0
Atribuo: Vi devas doni taŭgan krediton, Atribuo: Vidu maldekstre. Sed: Provizu ligilon al ĉi tio
provizi ligon al la permesilo, kaj indiku ĉu
alia permesilo.
ŝanĝoj estis faritaj. Vi povas fari tion en iu ajn
Neniuj derivaĵoj: Se vi remiksas, transformas aŭ konstruas
racia maniero, sed neniel tiu sugesto-
sur la materialo, vi ne rajtas distribui la
sugestas, ke la licencinto apogas vin aŭ vian uzon.
modifita materialo.
Neniuj aldonaj limigoj: Vi eble ne apliki. Neniuj aldonaj limigoj: Vidu maldekstre. juraj terminoj aŭ teknologiaj mezuroj kiuj laŭleĝe
limigi aliajn fari ion ajn la permesilon
permesiloj.
Noto: Vi ne devas observi la permesilon por elementoj de la materialo en la publika domeno aŭ kie via uzo estas permesita de aplikebla escepto aŭ limigo.
Noto: Neniuj garantioj donitaj. La permesilo eble ne donas al vi ĉiujn permesojn necesajn por via celita uzo. Por ekzampAliaj rajtoj kiel publikeco, privateco aŭ moralaj rajtoj povas limigi kiel vi uzas la materialon.
Versio: doc 1.4.2 / NanoLib 1.3.0
59
Imprint, contact, versions
©2024 Nanotec Electronic GmbH & Co.KGKapellenstr.685622 FeldkirchenGermanyTel.+49(0) 89 900 686-0Fax+49(0)89 900 686-50 info@nanotec.dewww.nanotec.com All rights reserved. Error, omission, technical or content change possible without notice. Quoted brands/products are trademarks of their owners and to be treated as such. Original version.
Document 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
+ Added > Changed # Fixed > Re-work of the provided examples.
+ NanoLib Modbus: Added device locking mechanism for Modbus VCP. # NanoLib Core: Fixed connection state check. # NanoLib Code: Corrected bus hardware reference removal.
+ NanoLib-CANopen: Support for Peak PCAN-USB adapter (IPEH-002021/002022).
> NanoLib Core: Changed logging callback interface (LogLevel replaced by LogModule). # NanoLib Logger: Separation between core and modules has been corrected. # Modbus TCP: Fixed firmware update for FW4. # EtherCAT: Fixed NanoJ program upload for Core5. # EtherCAT: Fixed firmware update for Core5.
# Modbus RTU: Korektis tempoproblemojn kun malaltaj baŭdaj indicoj dum firmware-ĝisdatigo. # RESTful: Riparita alŝuto de la programo NanoJ.
# NanoLib Moduloj Sampler: Ĝusta legado de sampgvidis buleajn valorojn.
+ Java 11-subteno por ĉiuj platformoj. + Python 3.11/3.12 subteno por ĉiuj platformoj. + Nova interfaco de ensaluta revokado (vidu ekzamples). + Revoko-lavujoj por NanoLib Logger. > Ĝisdatigu registrilon al versio 1.12.0. > NanoLib Moduloj Sampler: Subteno nun por Nanotec-regilo-firmvaro v24xx. > NanoLib Moduloj Sampler: Ŝanĝo en strukturo uzata por sampler agordo. > NanoLib Moduloj Sampler: Kontinua reĝimo estas sinonimo de senfina; la ellasilkondiĉo estas kontrolita unufoje; la nombro de samples devas esti 0. > NanoLib Modules Sampler: Normala prioritato por la fadeno kiu kolektas datumojn en firmvarreĝimo. > NanoLib Moduloj Sampler: Reskribita algoritmo por detekti transiron inter Preta kaj Kuranta stato. # NanoLib Core: Ne plia Aliro-Malobservo (0xC0000005) ĉe fermo de 2 aŭ pli da aparatoj uzante la saman busan aparataron. # NanoLib Core: Ne plia Segmenta Faŭlto ĉe alkroĉado de PEAK-adaptilo sub Linukso. # NanoLib Moduloj Sampler: Ĝuste sampled-valoroj legante en firmvarreĝimo. # NanoLib Moduloj Sampler: Ĝusta agordo de 502X:04. # NanoLib Moduloj Sampler: Ĝusta miksado de bufroj kun kanaloj. # NanoLib-Canopen: Pliigitaj CAN-tempotempoj por fortikeco kaj ĝusta skanado ĉe pli malaltaj baŭdratoj. # NanoLib-Modbus: VCP-detekta algoritmo por specialaj aparatoj (USB-DA-IO).
+ EtherCAT support.
+ Note on VS project settings in Configure your project.
+ getDeviceHardwareGroup (). + getProfinetDCP (isServiceAvailable). + getProfinetDCP (validateProfinetDeviceIp). + autoAssignObjectDictionary (). + getXmlFileName (). + const std::string & xmlFilePath in addObjectDictionary (). + getSamplerInterface ().
Produkto 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)
Versio: doc 1.4.2 / NanoLib 1.3.0
60
10 Premsigno, kontakto, versioj
Dokumento
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
+ Added > Changed # Fixed + rebootDevice (). + Error code ResourceUnavailable for getDeviceBootloaderVersion (), ~VendorId (), ~HardwareVersion (), ~SerialNumber, and ~Uid. > firmwareUploadFromFile now uploadFirmwareFromFile (). > firmwareUpload () now uploadFirmware (). > bootloaderUploadFromFile () now uploadBootloaderFromFile (). > bootloaderUpload () now uploadBootloader (). > bootloaderFirmwareUploadFromFile () to uploadBootloaderFirmwareFromFile (). > bootloaderFirmwareUpload () now uploadBootloaderFirmware (). > nanojUploadFromFile () now uploadNanoJFromFile (). > nanojUpload () now uploadNanoJ (). > objectDictionaryLibrary () now getObjectDictionaryLibrary (). > String_String_Map now StringStringMap. > NanoLib-Common: faster execution of listAvailableBusHardware and openBusHardwareWithProtocol with Ixxat adapter. > NanoLib-CANopen: default settings used (1000k baudrate, Ixxat bus number 0) if bus hardware options empty. > NanoLib-RESTful: admin permission obsolete for communication with Ethernet bootloaders under Windows if npcap / winpcap driver is available. # NanoLib-CANopen: bus hardware now opens crashless with empty options. # NanoLib-Common: openBusHardwareWithProtocol () with no memory leak now.
+ Linux ARM64 support. + USB mass storage / REST / Profinet DCP support. + checkConnectionState (). + getDeviceBootloaderVersion (). + ResultProfinetDevices. + NlcErrorCode (replaced NanotecExceptions). + NanoLib Modbus: VCP / USB hub unified to USB. > Modbus TCP scanning returns results. < Modbus TCP communication latency remains constant.
+ More ObjectEntryDataType (complex and profile-specific). + IOError return if connectDevice () and scanDevices () find none. + Only 100 ms nominal timeout for CanOpen / Modbus.
+ Modbus support (plus USB Hub via VCP). + Chapter Creating your own Linux project. + extraHardwareSpecifier to BusHardwareId (). + extraId_ and extraStringId_ to DeviceId ().
+ setBusState (). + getDeviceBootloaderBuildId (). + getDeviceFirmwareBuildId (). + getDeviceHardwareVersion (). # Bugfixes.
Eldono.
Produkto
0.8.0 0.7.1 0.7.0 0.5.1 0.5.1
Versio: doc 1.4.2 / NanoLib 1.3.0
61
Dokumentoj/Rimedoj
![]() |
Nanotic NanoLib C++ Programming [pdf] Uzanto-manlibro NanoLib C Programming, C Programming, Programming |