RoboPro: Wie Status eines Ausgangs abfragen?

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
sprocket
Beiträge: 3
Registriert: 14 Feb 2012, 19:05

RoboPro: Wie Status eines Ausgangs abfragen?

Beitrag von sprocket » 14 Feb 2012, 19:10

Hallo,

absolute Newbie Frage: wie kann ich in RoboPro den Status eines Ausgangs abfragen? Hintergrund: ich möchte das Ampel-Programm aus dem TrainingLab schöner machen. Dazu will ich ein Unterprogramm erstellen, dass eine Lampe einschaltet, wenn sie aus ist und entsprechend ausschaltet, wenn sie an ist.

Gruss,
sprocket

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

Re: RoboPro: Wie Status eines Ausgangs abfragen?

Beitrag von vleeuwen » 14 Feb 2012, 19:35

By my knowledge this is not possible.
About this I have had a discussion on the old forum
RoboPro does not remind a state of the Outputs.

This is a fundamental difference with MS-Robotics Developer Studio, the FtTxService keep a full state of the TX-C.
This makes relative commands possible like: Increase Power, Decrease Power, Reverse direction and Start or Stop without losing the last Power and Direction.

Benutzeravatar
Dirk Fox
ft:pedia-Herausgeber
Beiträge: 1833
Registriert: 01 Nov 2010, 00:49
Wohnort: Karlsruhe
Kontaktdaten:

Re: RoboPro: Wie Status eines Ausgangs abfragen?

Beitrag von Dirk Fox » 14 Feb 2012, 20:44

Hallo sprocket,

das Problem lässt sich ganz einfach lösen: Wenn Du die Lampe einschaltest, setzt Du ein "Flag" (Variable) auf "Ein" (= 1), und wenn Du sie ausschaltest, setzt Du das Flag auf "Aus" (= 0). Der Wert des Flags zeigt Dir dann immer an, welchen Status die Lampe hat.

Beste Grüße,
Dirk

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

Re: RoboPro: Wie Status eines Ausgangs abfragen?

Beitrag von vleeuwen » 14 Feb 2012, 23:22

With this kind of variable you are creating your own state description.
However when you change the value of this lamp on a lot of place, you need to change this variable on each of these places too. Maybe a subroutine ChangeLamp could make this easier.
In a simple example this will work but in case of a more complex program with a lot of outputs, you get also a lot of variables to maintain.

The state information of the actuators is already present in the Transfer Area data.
I can imagine an input element GetOutputStatus similar as the GetInputStatus elements.

Antworten