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
RoboPro: Wie Status eines Ausgangs abfragen?
Forumsregeln
Bitte beachte die Forumsregeln!
Bitte beachte die Forumsregeln!
Re: RoboPro: Wie Status eines Ausgangs abfragen?
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.
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.
- Dirk Fox
- ft:pedia-Herausgeber
- Beiträge: 1833
- Registriert: 01 Nov 2010, 00:49
- Wohnort: Karlsruhe
- Kontaktdaten:
Re: RoboPro: Wie Status eines Ausgangs abfragen?
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
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
Re: RoboPro: Wie Status eines Ausgangs abfragen?
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.
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.