Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched.
Close
Das Problem ist, dass wenn der IF Fall ausgeführt wird und Step_M1 = 30 wird das Ausgangssignalt trig.Q nicht gesetzt wird. Weis jemand worand das liegen könnte.
MFG
Tobias Ruf
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Also bei mir funktioniert das Beispiel. Sicher, daß keine Variablen mehrfach verwendet wurden? Wird Step_M1 der Wert "30" auch wieder entzogen wenn var1 False wird?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hallo,
ich habe folgendes Problem: Programausschnitt
Variablendeklaration:
Step_M1:INT; (Globale Deklaration)
trig:R_TRIG;
Programmteil:
IF var1 THEN
END_IF
trig(Clk:=Step_M1=30);
Das Problem ist, dass wenn der IF Fall ausgeführt wird und Step_M1 = 30 wird das Ausgangssignalt trig.Q nicht gesetzt wird. Weis jemand worand das liegen könnte.
MFG
Tobias Ruf
hi,
die TRIG funktionen arbeiten mit boolschen variablen. denke es liegt daran...
versuch es doch so:
IF var1 THEN
Step_M1:=30;
bSignal := TRUE;
END_IF
trig(Clk:=bSignal);
oder wenn Step_M1 sowieso global ist:
IF Step_M1=30 THEN
trig(Clk:=TRUE)
END_IF
hoffe das hilft weiter, ansonsten poste am besten mal mehr code und / oder informationen...
mfg
Also bei mir funktioniert das Beispiel. Sicher, daß keine Variablen mehrfach verwendet wurden? Wird Step_M1 der Wert "30" auch wieder entzogen wenn var1 False wird?