Controlling Multiple TXTs

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
robonotpro
Beiträge: 6
Registriert: 16 Jun 2022, 16:13

Controlling Multiple TXTs

Beitrag von robonotpro » 16 Jun 2022, 16:49

Hallo, I am working with a Learning Factory 4.0 (Learnfabrik 4.0). One of my goals is to be able to create programs for the factory. I have explored RoboPro but it seems to have limitations with what I can do. I don't think I can control multiple TXT controllers in one RoboPro program, can I? I am looking into ftrobopy as well but all the documentation is in German so I would appreciate some help on getting started with it. I think I would be able to understand the rest since code is code. I know C++ is an option too but it appears very complicated. Danke!
=================
Hallo, ich arbeite mit einer Lernfabrik 4.0. Eines meiner Ziele ist es, Programme für die Fabrik erstellen zu können. Ich habe mich mit RoboPro auseinandergesetzt, aber es scheint mir Grenzen zu haben, was ich tun kann. Ich glaube nicht, dass ich mehrere TXT-Steuerungen in einem RoboPro-Programm steuern kann, oder? Ich schaue mir auch ftrobopy an, aber die gesamte Dokumentation ist auf Deutsch, also wäre ich für Hilfe bei den ersten Schritten dankbar. Ich denke, ich könnte den Rest verstehen, denn Code ist Code. Ich weiß, dass C++ auch eine Option ist, aber es scheint sehr kompliziert zu sein. Danke!

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

Re: Controlling Multiple TXTs

Beitrag von vleeuwen » 16 Jun 2022, 18:39

That's what factory 4.0 9v (TXTs, C++, https://github.com/fischertechnik/txt_training_factory ) does.
The synchronization between the different stations is done asynchronously with MQTT message.
And that's the concept behind Industry 4.0.
The C++ software is well structured and object oriented and making changes is not too difficult. That structure can be adopted in Python; both belong to the same imperative programming language family

Factory 9V (TXT's, RoboPro) sometimes does this with shared sensors, but this is also possible with MQTT (RoboPro extension SLI's, see my previous publications).
If business processes do not run too fast, synchronous (semi) real-time communication between the processes is actually of no use.

Both factories have a modular structure, so the question is: how can the modules communicate with each other?
This can easily be done with MQTT, but it could also be done with the help of web sockets or Berkeley sockets.
I2C is less suitable for this because it involves a master-slave structure.

To use the existing Factory 9V (TXTs, RoboPro) software on Factory 4.0 you will:
a) Need to make some changes to the cabling.
b) The camera and RFID section are then not usable.
c) If you would like to work MQTT then you will have to develop some RoboPro SLI extension.
software enigineer/teacher/advisor
Google translate
http://tescaweb.nl/Carel/?p=713

robonotpro
Beiträge: 6
Registriert: 16 Jun 2022, 16:13

Re: Controlling Multiple TXTs

Beitrag von robonotpro » 16 Jun 2022, 19:03

vleeuwen hat geschrieben:
16 Jun 2022, 18:39
That's what factory 4.0 9v (TXTs, C++, https://github.com/fischertechnik/txt_training_factory ) does.
The synchronization between the different stations is done asynchronously with MQTT message.
And that's the concept behind Industry 4.0.
The C++ software is well structured and object oriented and making changes is not too difficult. That structure can be adopted in Python; both belong to the same imperative programming language family

Factory 9V (TXT's, RoboPro) sometimes does this with shared sensors, but this is also possible with MQTT (RoboPro extension SLI's, see my previous publications).
If business processes do not run too fast, synchronous (semi) real-time communication between the processes is actually of no use.

Both factories have a modular structure, so the question is: how can the modules communicate with each other?
This can easily be done with MQTT, but it could also be done with the help of web sockets or Berkeley sockets.
I2C is less suitable for this because it involves a master-slave structure.

To use the existing Factory 9V (TXTs, RoboPro) software on Factory 4.0 you will:
a) Need to make some changes to the cabling.
b) The camera and RFID section are then not usable.
c) If you would like to work MQTT then you will have to develop some RoboPro SLI extension.
Thanks for answering, I should've specified I am working with the 9V model too.
I have followed the instructions on GitHub for beginning C++ development, i.e. I have an Eclipse environment ready with the libraries, but not sure where to go from there.

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

Re: Controlling Multiple TXTs

Beitrag von vleeuwen » 16 Jun 2022, 22:06

a)
factory 9v only with RoboPro.
does not work with the C++ software for the factory4.0 9v.
However the RoboPro software is much easier to change by students as the C++ 4.0 software.
The TXT configuration is a little bit different.
b)
factory 4.0 9v
That is very simple, you need to compile the TxtFactoryClient it 4 times with different different build configurations.
That will give you the .exe for the different modules.
It is possible to run the factory4.0 in only a local network (without a internet connection) with a Node-red on a laptop.
Give al the device a fix ip-address in the DHCP of the local network router.
software enigineer/teacher/advisor
Google translate
http://tescaweb.nl/Carel/?p=713

robonotpro
Beiträge: 6
Registriert: 16 Jun 2022, 16:13

Re: Controlling Multiple TXTs

Beitrag von robonotpro » 17 Jun 2022, 07:21

vleeuwen hat geschrieben:
16 Jun 2022, 22:06
a)
factory 9v only with RoboPro.
does not work with the C++ software for the factory4.0 9v.
However the RoboPro software is much easier to change by students as the C++ 4.0 software.
The TXT configuration is a little bit different.
b)
factory 4.0 9v
That is very simple, you need to compile the TxtFactoryClient it 4 times with different different build configurations.
That will give you the .exe for the different modules.
It is possible to run the factory4.0 in only a local network (without a internet connection) with a Node-red on a laptop.
Give al the device a fix ip-address in the DHCP of the local network router.
Could you expand on the C++ build configurations? Frankly, I don't have a lot of experience with C++.
Zuletzt geändert von robonotpro am 04 Jul 2022, 10:13, insgesamt 1-mal geändert.

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

Re: Controlling Multiple TXTs

Beitrag von vleeuwen » 17 Jun 2022, 15:21

a)
Conditional compiler directives are used. (see for example: https://cplusplus.com/doc/tutorial/preprocessor/)
These are basic software engineering components.
They are also used in other languages.
b)
In the C++ code frequent use is made of the so-called "design patterns". (see for example: https://stackoverflow.com/questions/106 ... ns-using-c)
c)
Mechanically, there are a number of weaknesses in the factory module; this causes the transport robots to get stuck every now and then. These are design flaws. I myself have made a number of mechanical modifications to the model used by Saxion University of Applied Sciences.
Also sometimes plugs come loose. Systematically using RoboPro to check whether all aductors and sensors are functioning properly.
The fischertechnik C++ and RoboPro software actually contains no checks on the proper functioning of sensors and aductors.
But it's hard to document all of that.
d)
It is recommended to first understand the RoboPro code per module. With the 4G language RoboPro that is a lot easier than the C++ program.
Making modifications is a lot easier in RoboPro than in C++ or Python.
e)
For Saxion University of Applied Sciences I have realized a number of RoboPro SLI extensions that enable the use of MQTT.
software enigineer/teacher/advisor
Google translate
http://tescaweb.nl/Carel/?p=713

robonotpro
Beiträge: 6
Registriert: 16 Jun 2022, 16:13

Re: Controlling Multiple TXTs

Beitrag von robonotpro » 20 Jun 2022, 06:45

vleeuwen hat geschrieben:
17 Jun 2022, 15:21
a)
Conditional compiler directives are used. (see for example: https://cplusplus.com/doc/tutorial/preprocessor/)
These are basic software engineering components.
They are also used in other languages.
b)
In the C++ code frequent use is made of the so-called "design patterns". (see for example: https://stackoverflow.com/questions/106 ... ns-using-c)
c)
Mechanically, there are a number of weaknesses in the factory module; this causes the transport robots to get stuck every now and then. These are design flaws. I myself have made a number of mechanical modifications to the model used by Saxion University of Applied Sciences.
Also sometimes plugs come loose. Systematically using RoboPro to check whether all aductors and sensors are functioning properly.
The fischertechnik C++ and RoboPro software actually contains no checks on the proper functioning of sensors and aductors.
But it's hard to document all of that.
d)
It is recommended to first understand the RoboPro code per module. With the 4G language RoboPro that is a lot easier than the C++ program.
Making modifications is a lot easier in RoboPro than in C++ or Python.
e)
For Saxion University of Applied Sciences I have realized a number of RoboPro SLI extensions that enable the use of MQTT.
What I have understood from the C++ code is that all of the client controllers are running the main.cpp program from the TXTFactoryClient file, and they execute commands based on the conditional statements inside that code. There are conditional statements for each factory station to begin with, and then statements to control the stations within. Would you say that's accurate? Thanks again.

robonotpro
Beiträge: 6
Registriert: 16 Jun 2022, 16:13

Re: Controlling Multiple TXTs

Beitrag von robonotpro » 20 Jun 2022, 11:08

robonotpro hat geschrieben:
20 Jun 2022, 06:45
vleeuwen hat geschrieben:
17 Jun 2022, 15:21
a)
Conditional compiler directives are used. (see for example: https://cplusplus.com/doc/tutorial/preprocessor/)
These are basic software engineering components.
They are also used in other languages.
b)
In the C++ code frequent use is made of the so-called "design patterns". (see for example: https://stackoverflow.com/questions/106 ... ns-using-c)
c)
Mechanically, there are a number of weaknesses in the factory module; this causes the transport robots to get stuck every now and then. These are design flaws. I myself have made a number of mechanical modifications to the model used by Saxion University of Applied Sciences.
Also sometimes plugs come loose. Systematically using RoboPro to check whether all aductors and sensors are functioning properly.
The fischertechnik C++ and RoboPro software actually contains no checks on the proper functioning of sensors and aductors.
But it's hard to document all of that.
d)
It is recommended to first understand the RoboPro code per module. With the 4G language RoboPro that is a lot easier than the C++ program.
Making modifications is a lot easier in RoboPro than in C++ or Python.
e)
For Saxion University of Applied Sciences I have realized a number of RoboPro SLI extensions that enable the use of MQTT.
What I have understood from the C++ code is that all of the client controllers are running the main.cpp program from the TXTFactoryClient file, and they execute commands based on the conditional statements inside that code. There are conditional statements for each factory station to begin with, and then statements to control the components within. Would you say that's accurate? Thanks again.

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

Re: Controlling Multiple TXTs

Beitrag von vleeuwen » 20 Jun 2022, 16:39

All 4 clients are using a different executable.
See the project properties for the TxtFactoryCLient.
It is a conditional compilation based on the Symbool in "project settings|C/C++ build|Tool Settings|CroosGCC compiler|Preprocessor|Defined Symbols (-D)".
Only one of the four symbols CLIENT_MPO, CLIENT_HBW, , CLIENT_VGR, CLIENT_SLD is defined their.

So this project can compiled for debug and release and for the different TXT's
Forum_2022-06-20.JPG
Forum_2022-06-20.JPG (102.01 KiB) 2464 mal betrachtet
software enigineer/teacher/advisor
Google translate
http://tescaweb.nl/Carel/?p=713

Benutzeravatar
MasterOfGizmo
Beiträge: 2720
Registriert: 30 Nov 2014, 07:44

Re: Controlling Multiple TXTs

Beitrag von MasterOfGizmo » 21 Jun 2022, 13:13

robonotpro hat geschrieben:
20 Jun 2022, 06:45
What I have understood from the C++ code is that all of the client controllers are running the main.cpp program from the TXTFactoryClient file, and they execute commands based on the conditional statements inside that code. There are conditional statements for each factory station to begin with, and then statements to control the stations within. Would you say that's accurate? Thanks again.
Ja, das klingt richtig.

Zum Verständnis: Es gibt zwei Arten von Bedingungen hier. Sogenannte Compiler-Direktiven und bedingte Befehle. Die sehen ggf fast gleich aus ('#if' bzw. 'if'), in C++ erkennt man die Compiler-Direktiven daran, dass sie mit einem Doppelkreuz (#) beginnen.

Man kann sich das ganz gut mit dem Kuchenbacken erklären. Das Programm ist das Rezept für eine Obsttorte. Du hast bei der Auswahl der Früchte nach Rezept zwei Möglichkeiten: A) Du wählst schon beim Backen eine Obstsorte aus, B) Du machst eine Torte mit diversen Früchten und kannst später beim Essen auswählen. Das Backen entspricht dann dem Übersetzen (Kompilieren) des Programmcodes in die EXE. Das Essen entspricht dem Ausführen des fertigen EXE.

Compiler-Direktiven entsprechen der Auswahl beim Backen. Wenn der Compiler aus dem Programmcode das EXE "backt" wird hier bereits eine Auswahl getroffen. Die dabei nicht ausgewählen Dinge landen gar nicht erst im EXE und können dann später auch nicht benutzt werden. So entstehen aus dem einen Programmcode die vier verschiedenen EXE's für die vier Teile der Factory. Diese Auswahl wird per Compiler-Direktive (#if oder #ifdef) getroffen.

Und dann gibt es noch die "normalen" bedingten Befehle. Die treffen eine Auswahl später, wenn das Programm auf dem TXT läuft. Das sind so Sachen wie "wenn der Taster gedrückt ist, dann mache dies, sonst jenes". Da sind also im Programm noch alle Alternativen enthalten.
Arduino für fischertechnik: ftDuino http://ftduino.de, ftDuino32 http://ftduino.de/32

robonotpro
Beiträge: 6
Registriert: 16 Jun 2022, 16:13

Re: Controlling Multiple TXTs

Beitrag von robonotpro » 28 Jun 2022, 12:00

vleeuwen hat geschrieben:
20 Jun 2022, 16:39
All 4 clients are using a different executable.
See the project properties for the TxtFactoryCLient.
It is a conditional compilation based on the Symbool in "project settings|C/C++ build|Tool Settings|CroosGCC compiler|Preprocessor|Defined Symbols (-D)".
Only one of the four symbols CLIENT_MPO, CLIENT_HBW, , CLIENT_VGR, CLIENT_SLD is defined their.

So this project can compiled for debug and release and for the different TXT's
Forum_2022-06-20.JPG
Thanks a lot! I was able to compile and get the file. But to confirm, when I compile for example Client_SLD I will get a TXTFactoryClient file within a SLD_Posix_Release directory. And that is what I should load on the SLD controller? I'm asking because the file is a little smaller than the demo file from GitHub but in my mind I assume they should be the same.

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

Re: Controlling Multiple TXTs

Beitrag von vleeuwen » 01 Jul 2022, 16:11

@robonotpro
That is the case.
I case of more questions, contact me bij PM, that is easier to reply.
With some small change, it is also possible to run the Factory 4.0 inside a local network only and with a local NodeRed dashboard on a laptop.
software enigineer/teacher/advisor
Google translate
http://tescaweb.nl/Carel/?p=713

Antworten