Leute,
eine vielleicht etwas merkwürdige Frage:
Zu welchem Zeitpunkt wird eigentlich von der Firmware des TX-C ein Universaleingang gelesen?
Mein Problem:
Ich schalte einen (nicht ft) Sensor mit einem Lampenausgang ein bzw. gebe durch die steigende Flanke dem Sensor das Startsignal zur Messung.
Danach lese ich sofort das digitale Ergebnis mit einem Universaleingang.
Relativ oft scheint das Leseergebnis nicht zu stimmen:
Das Programm zeigt ein falsches Ergebnis an.
Eigentlich kann das nur davon kommen, dass der Wert des Eingangs evtl. von VOR dem Startsignal stammt. Das darf aber nicht sein.
Meine Frage ist also, ob ein Universaleingang genau dann im Programmablauf von der Firmware eingelesen wird, wenn ich das (mit einem Zuweisungsbefehl) will, oder ob der Wert evtl. von einer "älteren" Messung stammt.
Ich habe irgendwo gelesen, dass Eingänge alle 10ms von der Firmware gelesen werden. Das würde evtl. heißen, dass ich im Programm ein bis zu 10ms "altes" Eingangssignal lese. Kann das sein?
Wenn ja: Kann ich irgendwie im Programm eine "aktuelle" Messsung des Eingangs veranlassen?
Gruß ftDirk
Zeitpunkt des Lesens eines Eingangs
Forumsregeln
Bitte beachte die Forumsregeln!
Bitte beachte die Forumsregeln!
Zeitpunkt des Lesens eines Eingangs
Gruß ftDirk
Re: Zeitpunkt des Lesens eines Eingangs
Hallo Dirk,
bau doch versuchsweise nach dem Start des Sensors bis zum Abfragen des Eingangs mal eine Wartezeit in der Größenordnung von 10 ms ein. Bis dahin sollte die Firmware den Eingang ja auf jeden Fall neu eingelesen haben.
Gruß
Holger
bau doch versuchsweise nach dem Start des Sensors bis zum Abfragen des Eingangs mal eine Wartezeit in der Größenordnung von 10 ms ein. Bis dahin sollte die Firmware den Eingang ja auf jeden Fall neu eingelesen haben.
Gruß
Holger
Re: Zeitpunkt des Lesens eines Eingangs
The TA (transfer area) will be renewed every 10 ms (USB), 15-50 ms (BT) and offline between 1 ?and 10 ms.
This means: receiving the data from the sensors and sending the data to the actuators.
The TA is the communication medium between your program and the hardware.
In case your are using a closed control loop, you need to react with an algorithme on the incoming data.
So the result of the algorithme will be send to the actuators at least in the next TA renew cycle.
Between the creation of the sensor data and the moment that the new data will arrive at the output (M or O) will be more than 10 ms, at least 10 to 20 ms.
This means: receiving the data from the sensors and sending the data to the actuators.
The TA is the communication medium between your program and the hardware.
In case your are using a closed control loop, you need to react with an algorithme on the incoming data.
So the result of the algorithme will be send to the actuators at least in the next TA renew cycle.
Between the creation of the sensor data and the moment that the new data will arrive at the output (M or O) will be more than 10 ms, at least 10 to 20 ms.
Re: Zeitpunkt des Lesens eines Eingangs
@Holger: Werde ich so machen.
@vleeuwen: Danke für die Erklärung. Sehr zeitkritische Abläufe sind damit ja wohl unmöglich.
Gruß ftDirk
@vleeuwen: Danke für die Erklärung. Sehr zeitkritische Abläufe sind damit ja wohl unmöglich.
Gruß ftDirk
Gruß ftDirk
Re: Zeitpunkt des Lesens eines Eingangs
Hallo Dirk,
geh aufgrundder Erklärung von vleeuven aber eher in den Bereich 20 ms und darüber hinaus.
Aktivierung der Messung - > 10 ms -> Messung -> 10 ms -> Auslesen der Messergebnisse.
Gruß
Holger
geh aufgrundder Erklärung von vleeuven aber eher in den Bereich 20 ms und darüber hinaus.
Aktivierung der Messung - > 10 ms -> Messung -> 10 ms -> Auslesen der Messergebnisse.
Gruß
Holger
Re: Zeitpunkt des Lesens eines Eingangs
Remark:
For a stable closed control loop, it is better to stay far away from the limits. Otherwise you probably will have to deal with side effects.
For example take a look into control engineering and look for a Bode or Nyquist diagram.
For a stable closed control loop, it is better to stay far away from the limits. Otherwise you probably will have to deal with side effects.
For example take a look into control engineering and look for a Bode or Nyquist diagram.