Kommunikation RoboPRO/C++

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
PGRRobotik
Beiträge: 6
Registriert: 05 Jun 2012, 19:01
Kontaktdaten:

Kommunikation RoboPRO/C++

Beitrag von PGRRobotik » 03 Okt 2014, 13:25

Hallo allerseits!
Da wir gerade an einem neuen Projekt arbeiten, kam bei uns die Frage auf, ob eine Kommunikation zwischen RoboPRO und C++ möglich ist. Der Gedanke dahinter ist, dass man RoboPRO für die Hardware Ansteuerung benutzt und C++ als das berechnende Tool.
Es besteht zwar die Möglichkeit, dass man mit der C++ library den TX-Controller und damit die Hardware ansteuert, jedoch sind die Latenzzeiten bei der Kommunikation über USB relativ hoch, was wir gerne vermeiden würden.

Was meint ihr dazu? Kennt ihr eine Lösung?


Viele Grüße!
PGR-Robotik
Die Robotik AG des Privatgymnasium Dr. Richter in Kelkheim
http://www.pgr-robotik.de

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

Re: Kommunikation RoboPRO/C++

Beitrag von vleeuwen » 03 Okt 2014, 14:43

Hi all,
It is not very clear to me what you mean.

Latency and refresh rate for the transfer area:
The FtMscLib ( FtMscLibEx or FtMscLibExNet) has in the online mode the same latency over USB as RoboPro in the online mode.
The latency for USB is 0, so the refresh rate for the transfer area is +/- 10 ms and is stable.
The max latency for BlueTtooth is not defined, so the refresh rate for the transfer area is not stable ( between 10 to 50 ms for more than 90% of the refreshes).

RoboPro compiles directly into machine code and has no C++ interface.
Programming for offline use (cross compiling) is only in C.
The TXT-C in the offline mode has no ability to communicated with a PC like the older Robo Interface.

For C++ you need the FtMscLibEx library. This lib make it possible to use the callback's in C++ classes.
Unmanaged C++ programming is a little bit more complex than C# and VB.NET because you have to deal with memory and object management issues.

However for text base Object oriented programming, C# or VB.NET (or managed C++) is must easier in use, the FTMscLibExNET library support this.
The sensor changes are also available as "Events". MS-Visual Studio is part of Dreamspark and is free for schools.

I hope that this helps you.
Otherwise e-mail me in private,
kind regards Carel van Leeuwen

eumel
Beiträge: 29
Registriert: 17 Mär 2014, 17:36

Re: Kommunikation RoboPRO/C++

Beitrag von eumel » 03 Nov 2014, 20:52

Hallo PGR-Robotic
Ich habe die Bibliothek umfisch50.dll von Ulrich Müller so ergänzt, dass der TX-Controller (ab firmware 1.30) einfach angesteuert werden kann.
Die Verbindung erfolgt über Bluetooth.
Die neue Bibliothek heißt TX.dll und verwendet die Bibliothek ftMscLib.dll (13.11.2012) von Fischertechnik.
TX.dll habe ich mit c++ erstellt. Man kann diese Bibliothek in c++-Projekte einbinden und dann folgende Anweisungen verwenden:
txOpenController txCloseController txGetAnalog txGetDistance txGetInput txGetTrack txGetVoltage
txGetCounter txClearCounter txSetLamp txSetMotor txStartMotor txStartMotorSync
txIsMotorReady txAreMotorsReady txGetGPSVer txGetGPSBreite txGetGPSLaenge
txGetGPSZeit txGetGPSGesch txGetGPSSat txGetGPSHoehe
txSleep txEsc txGetTickCount
Die gps-Befehle beziehen sich auf den Empfänder Navigatron (von flytron).

Mit freundlichen Grüßen eumel (H. Jawtusch)

Benutzeravatar
schnaggels
Beiträge: 389
Registriert: 31 Okt 2010, 23:14
Wohnort: Kelkheim
Kontaktdaten:

Re: Kommunikation RoboPRO/C++

Beitrag von schnaggels » 06 Nov 2014, 13:40

Hallo Jawtusch,

gibt es Bibliothek irgendow online zum herunterladen? Ein Link hier wäre prima, auch für andere.

Können wir auch gern in den Downloadbereich der FTC legen.
http://ftcommunity.de/downloads.php?kategorie=Software

Danke,
Thomas

eumel
Beiträge: 29
Registriert: 17 Mär 2014, 17:36

Re: Kommunikation RoboPRO/C++

Beitrag von eumel » 06 Nov 2014, 21:00

Hallo Thomas
Ich habe die TX-dll im Downloadbereich hochgeladen (wird noch freigegeben).
Die ursprüngliche umFish50.dll von Ulrich Müller ist in umFish50.pdf dokumentiert.
txOpenController wird mit der com-Nummer des Bluetooth-Gerätes aufgerufen.
Der Befehl zur Synchronisation von 2 Motoren hat die Parameter
txStartMotorSync (ftiMain m1 m2 dir1 dir2 Speed icount).
Bei nur einen Controller ist ftiMain=0.
Die gps-Befehle erfordern keine Parameter.
Wenn gewünscht, kann ich noch das komplette c++-Projekt als zip-Datei
hochladen.
Mit freundlichen Grüßen eumel (Jawtusch)

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

Re: Kommunikation RoboPRO/C++

Beitrag von vleeuwen » 06 Nov 2014, 22:04

Is this a real C++ object oriented solution?
With the callback's integrated in the Classes?

eumel
Beiträge: 29
Registriert: 17 Mär 2014, 17:36

Re: Kommunikation RoboPRO/C++

Beitrag von eumel » 07 Nov 2014, 20:53

Hello vleeuwen
I'm sorry but this DLL is simply structured programmed in c++ using global variables and so on.
Therefore you have to test its behavior, if you connect more than one TX-controllers.
Good luck eumel (Jawtusch)

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

Re: Kommunikation RoboPRO/C++

Beitrag von vleeuwen » 07 Nov 2014, 22:46

The FtMscLibEx (Extended version of the FtMscLib) (see the fischertechnik download site) offers the possibility to implement real C++ classes including callback at class level.
Also callbacks for Inputs, Counters and Display Buttons change notifications.

The FtMscLIbExNet (see the fischertechnik download site) offers .NET framework 4 functionality, including Events for the Inputs, Counters and Display Buttons.
This include support for managed C++.

Antworten