Autom. Zähler Reset

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
simmi
Beiträge: 5
Registriert: 16 Feb 2011, 06:00

Autom. Zähler Reset

Beitrag von simmi » 16 Feb 2011, 06:05

Hallo,
wie kann ich einen oder mehere Zählereingänge (C1-C4) im Robo Pro Programm automatisch zurücksetzen.

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

Re: Autom. Zähler Reset

Beitrag von Endlich » 16 Feb 2011, 06:22

Hallo simmi,

du bringst das "Zähleergenis" des Motors in eine Variable und setzt dann die Variable mit einem "="- Befehl gleich. Den "="- Befehl setzt du dann auf Null und schon müsste dann dein "Zählergenis" auf Null stehen.

Ich hoffe, ich konnte dir helfen

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

Re: Autom. Zähler Reset

Beitrag von vleeuwen » 16 Feb 2011, 09:58

Use a "command" and select as command "reset" and send this command to the encoder motor control.

simmi
Beiträge: 5
Registriert: 16 Feb 2011, 06:00

Ich noch einmal. Zähler Reset

Beitrag von simmi » 16 Feb 2011, 18:19

Hallo, danke erst mal an Endlich und vleeuwen für die schnelle Antwort, aber es geht noch nicht. Ich benutze den Encoderausgang als C1Digital der den Zähler C1 hochzählt, kann man ja im Interface-Fenster sehen. Diesen Zählwert möchte ich im Programm auf Null setzen wenn ein kompletter Zyklus zu Ende ist. Im Interfacefenster kann ich ihn mit der Resettaste zurücksetzen, was ich aber wenn es geht automatisch machen möchte. Momentan wird er nur nach Abschalten des Robo TX Controller auf Null gesetzt.
Zuletzt geändert von Gast am 16 Feb 2011, 19:05, insgesamt 1-mal geändert.
Grund: Thema zusammengeführt

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

Re: Autom. Zähler Reset

Beitrag von vleeuwen » 16 Feb 2011, 21:02

The functionality that you try to obtain is not clear to me.
Can you publish a image of the workflow?

If you took a look into the API/TA decription you will see (chapter 7.5 TA_OUTPUT) that there is only one byte involved for resetting a counter (cnt_reset[]).
The reset command is using these bytes.

However in case the input frequency of the counter pulses in higher than +/- 50 hz, the fast counters are out of the (semi) real time range of the interface. The counter is acting as a fast counter.
In that case it is possible that you don't see the 0 (null is not the right idication because that means not defined).
Advice: test your program with a counter input frequncy much lower than 50Hz.

50Hz is the maximum (semi) real time counter frequency under condition that the sample rate is 10 ms (USB and not BT) and the count puls is 100% symetrical. 100% symetrical is not the case with a puls switch.
For BT a rule of the thumd is a refresh rate of 20-40 ms => a max counter frequency 25 to 10 Hz.
Zuletzt geändert von vleeuwen am 21 Feb 2011, 11:07, insgesamt 1-mal geändert.

Kai P.
Beiträge: 41
Registriert: 16 Nov 2010, 22:38
Wohnort: Dortmund

Re: Autom. Zähler Reset

Beitrag von Kai P. » 20 Feb 2011, 19:29

Es gibt einen Allgemeinen Resetbefehl den du an alle Zähler senden kannst ;)
Heute bauen wir Roboter... und was in 20 Jahren?!

simmi
Beiträge: 5
Registriert: 16 Feb 2011, 06:00

Re: Autom. Zähler Reset

Beitrag von simmi » 22 Feb 2011, 06:26

Hallo Kai P,
und wie und wo wird er hereingeschrieben ??

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

Re: Autom. Zähler Reset

Beitrag von vleeuwen » 22 Feb 2011, 11:55

There is one API function available for manipulating the Transfer Area (7.5 cnt_reset):
This functionis obsolate because since RoboPro beta 3.04 the FtMscLib has been changed, no documentaion available yet.
function 3.6 SetOutCounterReset
However with this function you can only reset one of the 4 counters.
In RoboPro you have the Reset Command element

You could create your own function that reset the whole BOOL8 cnt_reset[N_CNT} (boolean array)

UMueller
Beiträge: 220
Registriert: 31 Okt 2010, 22:58

Re: Autom. Zähler Reset

Beitrag von UMueller » 22 Feb 2011, 14:30

Hallo,

Bild

Mini-Motor an M2 mit Impulstaster an C2.
Alle 5 sec wird der zugehörende Counter (heißt hier C2Z) zurückgesetzt.
Der Counterstand wird laufend in Var angezeigt.

Gruß Ulrich Müller

Nachtrag : http://www.ftcomputing.de/robodreh.htm unten eine Variante zur Drehzahlmessung mit dem Counter.

Antworten