I'm new to Codesys, and PLC programming in general. I am currently being self-taught with the help of some literature. Currently working a practice program. I made a function but when I try to call it I get and error 4051, 'Throttle_Timer' is no function.
Here is the function
FUNCTION_BLOCK Throttle_Timer
VAR_INPUT
delayTimeMs:TIME;
END_VAR
VAR_OUTPUT
END_VAR
VAR
Delay:TON;
END_VAR
Delay(IN:=TRUE, PT:=delayTimeMs);
IF NOT(Delay.Q) THEN
RETURN;
END_IF
Delay(IN:=FALSE);
Here is where I am trying to call it.
PROGRAM PLC_PRG
VAR
Delay: TON;
END_VAR
(*Pressing the Speed Up Button*)
WHILE speedUp =TRUE AND Throttle<99.51 DO;
Throttle:=Throttle+0.5;
(*function call*)
Throttle_Timer(T#500ms)
END_WHILE;
I cannot for the life of me figure out why. I call the function by name and in parentheses give it the input parameter. Was hoping someone could shed some light on this.