TXT C/C++ Programmierung

Alles rund um TX(T) und RoboPro, mit ft-Hard- und Software
Computing using original ft hard- and software
Forumsregeln
Bitte beachte die Forumsregeln!
Antworten
O.Smolarz
Beiträge: 1
Registriert: 07 Aug 2020, 18:26

TXT C/C++ Programmierung

Beitrag von O.Smolarz » 07 Aug 2020, 19:09

Hallo,

Ich versuche mit Hilfe der Anleitung bei GitHub (https://github.com/fischertechnik/txt_demo_c_download/) meinen TXT-Controller mit C/C++ zu programmieren.
Dabei verwende ich die TXT firmware (V4.6.6), FtTxtWorkspace.zip (V1.2.1), gcc-linaro-7.2.1-2017.11-i686-mingw32_arm-linux-gnueabihf und eclipse 2020-06 (4.16.0). Eclipse habe ich fertig eingerichtet und die Beispielprogramme lassen sich kompilieren und ausführen.

Da ich Programmieranfänger bin, sind mir viele Dinge noch unklar.
Was enthält das Linaro-Paket? Den Compiler?

Wo finde ich die C/C++-Befehle (mit Erklärung) für den TXT-Controller, z.B. für die Ein- und Ausgänge von den verschiedenen Sensoren.

Ich freue mich über jede Hilfe.

vleeuwen
Beiträge: 1561
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: TXT C/C++ Programmierung

Beitrag von vleeuwen » 08 Aug 2020, 02:52

Because the whole documentation of the txt-Demo_download, Eclipse, Linaro, C11++/C14++ etc. is in English, my reply is also in English.
(you can always make use of Goolgle translate)

Creating C/C++ suppose some basic knowledge about C/C++ programming and how compilers are operating.
It suppose also that you are able to search and filter information on the internet.
Hereby some hints .

The application development is with Eclipse on a MS-Windows system.

a)
Was enthält das Linaro-Paket? Den Compiler?
gcc-linaro-7.2.1-2017.11-i686-mingw32_arm-linux-gnueabihf
This is a complete toolchain, containing a cross compiler, a linker a library manager, etc. A toolchain create the executable code or libry code for the ARM-system on the windows machine (X64). The TXT is a ARM system.
After creating the code, the code needs to be uploaded to the TXT.
for more background knowledge, see for example:
https://www.definitions.net/definition/toolchain
https://stackoverflow.com/questions/227 ... s-compiler,
https://en.wikipedia.org/wiki/Toolchain
https://en.wikipedia.org/wiki/Cross_compiler

b)
Wo finde ich die C/C++-Befehle (mit Erklärung) für den TXT-Controller,
There are no higher level commands as you are uses with for example: RoboPro, txt_demo_c_online extension02, FtRoboPy.
Your program is communicating with the sensors and actuators through the so called transfer area. A shared memory space between the user application and the thread that control directly the hardware.
The TA (transfer area) is the way that your program communicate with the hardware Input/Output section(thread).
Your application is reading the input sections of the TA and writing into the output sections.
TA the other hand the Input/Output section(thread) reads the output section and use that information to set the Motor/Output of the TXT it also reads the sensors Inputs and write this data into the TA.
The demo's 01, 02, 03, 05, 06 and 07 give examples of the use of the TA.
The TA has been describe in FtTxtWorkspace/TxtDeps/Txt_Includes/FtShmem.h.

The same TA is in use with the txt_demo_c_online programming.
In the main.cpp of TestProj02 you will find more example about the use of the TA.
https://github.com/fischertechnik/txt_d ... TestProj02

This year I already gave a online course TXT SLI programming.
When I have time I consider to do the same for local programming, on line or during the Ft-convention in October.

vleeuwen
Beiträge: 1561
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: TXT C/C++ Programmierung

Beitrag von vleeuwen » 08 Aug 2020, 18:09

@O.Smolarz

There is now a small overview (first beta version) of the transfer area available in the txt_demo_c_download repository.
I hope that this well help you for better understanding the communication between the application and the `MotorIOLib` controller on the TXT.

Antworten