Zwei TX, ein Programm

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
Benutzeravatar
Endlich
Beiträge: 362
Registriert: 01 Nov 2010, 08:45
Wohnort: Ingelfingen
Kontaktdaten:

Zwei TX, ein Programm

Beitrag von Endlich » 23 Jun 2012, 14:43

Hallo Community,

ich habe ein Problem, und zwar möchte ich im gleichen Online-Programm zwei TX ansteuern. Nur, jetzt bekomme ich es, selbst mit der Hilfe aus RoboPro, nicht hin beide TX Controller im Programm mit Master und Extension anzusteuern, geschweige denn gleichzeitig zu verbinden. Der Master-TX soll wenn möglich über USB angeschlossen werden und der zweite über Bluetooth, denn dieser befindet sich auf einem fahrenden Roboter.

Wisst ihr wie das geht? Weil ich bekomme es auch nach dem dritten Anlauf nicht hin. :?

Vielen Dank

Benutzeravatar
alteg
Beiträge: 48
Registriert: 05 Nov 2010, 16:57
Wohnort: Swisttal

Re: Zwei TX, ein Programm

Beitrag von alteg » 23 Jun 2012, 17:04

Hallo Endlich,

Ich denke das selbe Problem hatte ich auch schon. Siehe Hier:
http://forum.ftcommunity.de/viewtopic.php?f=21&t=891

Meine Feststellungen:

Zur besseren Verständlichkeit: TXC1 läuft im Onlinemodus TXC2 Im Downloadmodus beide konfiguriert über die Bletoothkommuinkationseinstellungen.

1. Der TXC1im Onlinemodus sendet keine oder unbrauchbare Daten an den TXC2
2. Der TXC2 sendet einwandfrei an TXC1 sofern die Daten nicht abhängig sind von Daten die er von TXC1 bekommen hat.
3. Laufen beide TXC im Downloadmodus gib es keine Probleme.

Mein Fazit (Stand Heute) Bluetoothkommunikation der TXC untereinander ist nur möglich, wenn sich alle TXC im Downloadmodus befinden.

Diese Kombinationen habe ich mit der letzten Firmware und RoboPro Version getestet.

Daß FT darüber Kenntniss hat erklärt mein Thread zu dem Thema.

Gruß

Gereon

Benutzeravatar
Endlich
Beiträge: 362
Registriert: 01 Nov 2010, 08:45
Wohnort: Ingelfingen
Kontaktdaten:

Re: Zwei TX, ein Programm

Beitrag von Endlich » 23 Jun 2012, 18:31

Dankeschön Gereon für deine Antwort,

geht es dann auch nicht, beide TX Controller im Test-Feld zu testen, sodass man nur (ähnlich wie bei IF und Ext.) unten M und 1 drücken kann (Also Master und TX-Extension)?

Benutzeravatar
alteg
Beiträge: 48
Registriert: 05 Nov 2010, 16:57
Wohnort: Swisttal

Re: Zwei TX, ein Programm

Beitrag von alteg » 24 Jun 2012, 09:55

Hallo Endlich

Bei der Bluetoothkommunikation laufen alle TXC eigenständig Sie kommunizieren nur über die in den Programmen definierten Kommunikationsbefehle miteinander. D.h. Jeder der TXC ist Master und kann über Kabel Extensions angeschlossen haben. Für die Bluetoothkommunikation sucht man sich einen der TXC über den als Master ( besser Zentrale ) die Bluetoothkommunikation läuft. Stichwort Sterntopologie.

Gruß

Gereon

Benutzeravatar
Endlich
Beiträge: 362
Registriert: 01 Nov 2010, 08:45
Wohnort: Ingelfingen
Kontaktdaten:

Re: Zwei TX, ein Programm

Beitrag von Endlich » 24 Jun 2012, 18:06

Hi Gereon,

ja diese Sterntopologie hab ich schon von gehört. Na gut, dann werd ich mir wohl an langes Flachbandkabel besorgen, das ich dann von TX 1 zu TX 2 verbinde.
Zwar nicht wie gewünscht aber auf jeden Fall besser als nix.
Dankeschön Gereon für deine Antworten.

PS: Mein Modell könnt ihr dann am FanClubTag mit dem Joystick steuern :D

Benutzeravatar
alteg
Beiträge: 48
Registriert: 05 Nov 2010, 16:57
Wohnort: Swisttal

Re: Zwei TX, ein Programm

Beitrag von alteg » 24 Jun 2012, 20:41

Hallo Endlich

Lange Extensionkabel führen zu Störungen. Mein Versuch mit 6m auf der letzten Convetion war nicht lauffähig. Ich denke max 2 m könnte noch gehen habe ich aber nicht getestet. Es gilt auf jeden fall je länger desto schlechter.

Gruß Gereon

Benutzeravatar
Endlich
Beiträge: 362
Registriert: 01 Nov 2010, 08:45
Wohnort: Ingelfingen
Kontaktdaten:

Re: Zwei TX, ein Programm

Beitrag von Endlich » 24 Jun 2012, 21:58

Hallo Gereon,

das habe ich auch schon befürchtet. Ich werde in den nächsten Tagen bei Reichelt bestellen und es einfach mal ausprobieren. Wenns nicht klappt, dann werde ich den Roboter in einer Abgrenzung fahren lassen und den Ultraschallsensor dabei nutzen.

Ad2
Beiträge: 306
Registriert: 31 Okt 2010, 22:20

Re: Zwei TX, ein Programm

Beitrag von Ad2 » 25 Jun 2012, 10:46

Hi,

I must say I never tried it out but from what I understand from the documentation it should be possible to have 2 TXs in online mode. Both have to be master and at most one can be connected via USB (this is an imho unnecessary limitation of the ftMscLib).
Another option would be to have the stationary (USB) TX in online mode and the mobile TX in download mode. It should be possible to have the two talk together by means of the Bluetooth message exchange.
I do not understand the limitation on cable length in the master-extension configuration. RS485 is a balanced connection and @1Mbps the lines are not electrically long (hundreds of meters should be possible). It is wise however that both TXs have their own power supply (either adapter or battery). So apart from the 6-wire cable no other connection should exist between the two. If you do have more connections, the ground wire in the 6-wire cable may actually carry some current which will cause a difference in ground level in the TXs. And although RS485 is relatively immune to this it may nevertheless cause some inference (because it is not a pure DC current). Note that with the RoboInterface and extensions the situation is much worse because it concerns a number of single-ended (open drain) connections with relatively weak pull-ups.

Benutzeravatar
Endlich
Beiträge: 362
Registriert: 01 Nov 2010, 08:45
Wohnort: Ingelfingen
Kontaktdaten:

Re: Zwei TX, ein Programm

Beitrag von Endlich » 25 Jun 2012, 13:44

Hi,

ich habe es schon ausprobiert beide als Master zu installieren, nur leider bekomme ich das nicht hin beide dann in RoboPro als Master zu registrieren.
Wenn ich dich jetzt falsch verstanden habe, dann korrigiere mich bitte. ;)

Das hatte ich sowieso vor, das ich beide TX mit je einer Stromversorgung versorge.

Ad2
Beiträge: 306
Registriert: 31 Okt 2010, 22:20

Re: Zwei TX, ein Programm

Beitrag von Ad2 » 25 Jun 2012, 16:40

You are right. it is a limitation of RoboPro. Look at the Help paragraph 7.2 under 'Achtung'. With C programs it is possible, see page 20 of "Programmierung des ROBO TX Controllers, Teil 1: PC-Programmierung". You could try to launch a second instance of RoboPro but then you need two programs as well.

Benutzeravatar
Endlich
Beiträge: 362
Registriert: 01 Nov 2010, 08:45
Wohnort: Ingelfingen
Kontaktdaten:

Re: Zwei TX, ein Programm

Beitrag von Endlich » 25 Jun 2012, 17:44

Hello Ad2,

thank you for your answer. I read this part of the help and try to solve my problem. Thank you.

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

Re: Zwei TX, ein Programm

Beitrag von vleeuwen » 25 Jun 2012, 19:14

In the past this was possible.
I did published some notes about that.

Main problems:
1)
The FtMscLib is not re-entrant.
2)
The USB sub identifier of the TX-C is fix.
This difference with the ROBO interface, which have a unique USB sub indentifier.

ad 1)
Each connection will need his proper instance of the FTMscLib (different memory parts).

You need to copy not only your applicaiton but also the FTMscLib to different locations.


ad 2)
Only one USB connection is possible but you could have more than one BT connections or USB +BT connections.

Benutzeravatar
Endlich
Beiträge: 362
Registriert: 01 Nov 2010, 08:45
Wohnort: Ingelfingen
Kontaktdaten:

Re: Zwei TX, ein Programm

Beitrag von Endlich » 26 Jun 2012, 06:23

So, i checked the tip from Ad2.
But, i have the problem now, too. In the Help of RoboPro part 13 is this statemant: "Der Anschluss mehrerer ROBO TX Controller über mehrere USB Schnittstellen an einen PC ist nicht vorgesehen."
short in English: "The connection with more then 1 TX Controller is not possible"

I am a little bit confused. :?
I try to change the serial number in the Test-Center. But it is not possible.

Ad2
Beiträge: 306
Registriert: 31 Okt 2010, 22:20

Re: Zwei TX, ein Programm

Beitrag von Ad2 » 26 Jun 2012, 10:35

Correct. This is also what Carel says and is a limitation of the ftMscLib implementation. AFAIK not of the TX or the driver. It seems that every TX (even over USB) will get his own virtual comport on the PC side (eventhough they have the same set of USB descriptors), it is the lib that does not handle this correctly.
But according to the documentation Bluetooth does not have this limitation (which is a bit weird because these are also connected via virtual comports). So ftMscLib should allow at most 1 USB connection plus upto 7 BT connections. In this case it is RoboPro that is the limiting factor.

Ad2
Beiträge: 306
Registriert: 31 Okt 2010, 22:20

Re: Zwei TX, ein Programm

Beitrag von Ad2 » 26 Jun 2012, 10:51

You cannot change the serial number on a TX because it is immutable. TXs have a unique BT address and a name that you can change. From USB all TXs look exactly the same. Nevertheless you can connect more than one because the USB enumerator will assign unique device IDs (for as long as they stay connected). Although the deTX does not enumerate as a communication class device, it in fact is one and the ft device driver connects it to a virtual serial port. You can connect a terminal emulator to this port (e.g. realterm, putty) and communicate directly with the TX. To do anything useful however you have to implement the X1 protocol. This is precisely what ftMscLib does, the lib however seems to maintain only one global handle for the virtual comport although most functions have this handle as a parameter (a prerequisite for reentrancy).

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

Re: Zwei TX, ein Programm

Beitrag von vleeuwen » 26 Jun 2012, 21:44

Each TX-C connection needs it proper instance of a FtMscLIb.
So you need to load the FtMscLib from different fysical locations otherwise Windows will use the same program memory.

It is even possible to connect with two FtMscLib in one C++ program, for that you need some experiance with C++ low level programming.
However I also notice some interference between the two (slower refresh rate).
Maybe this has something to do with the way the FtMsclIb is using the multimedia time

Antworten