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

"Is no input of" error

arunrf
2016-11-01
2016-11-01
  • arunrf - 2016-11-01

    Hi all

    I have a Function Block defined as follows. This refers to a BOOL in PRG SCREEN ( Ladder ) called β€œBlocked” – SCREEN.Blocked – and I inserted that using the input assistant. When I build the code I get an error: β€œBlocked β€œis no input of β€œSCREEN”. Its not a very descriptive error – and cant find any info about it – What could be wrong? Thanks for your help

    iattempnumber := 0;
    SCREEN.Blocked:= 0;
    IF Current >= SCREEN.HMI_Current_Blockage_Setpoint THEN iattempnumber := 10;
    CASE iattempnumber OF
    10:
    IF Current >= SCREEN.HMI_Current_Blockage_Setpoint THEN SCREEN.Blocked := 1;
    MotorSetpointHz := MOVE(-500);
    Blocked_Reverse_Running := 1;
    TONRunReverseTime.IN := Blocked_Reverse_Running;
    TONRunReverseTime.PT := T#2S;
    TONRunReverseTime.Q := Blocked_Reverse_Stopped;
    SCREEN.Blocked := 0;
    END_IF ;
    iattempnumber := 20;
    20:
    IF Current >= SCREEN.HMI_Current_Blockage_Setpoint THEN SCREEN.Blocked := 1;
    MotorSetpointHz := MOVE(-500);
    Blocked_Reverse_Running := 1;
    TONRunReverseTime.IN := Blocked_Reverse_Running;
    TONRunReverseTime.PT := T#4S;
    TONRunReverseTime.Q := Blocked_Reverse_Stopped;
    SCREEN.Blocked := 0;
    END_IF ;
    iattempnumber := 30;
    30:
    IF Current >= SCREEN.HMI_Current_Blockage_Setpoint THEN SCREEN.Blocked := 1;
    MotorSetpointHz := MOVE(-500);
    Blocked_Reverse_Running := 1;
    TONRunReverseTime.IN := Blocked_Reverse_Running;
    TONRunReverseTime.PT := T#8S;
    TONRunReverseTime.Q := Blocked_Reverse_Stopped;
    SCREEN.Blocked := 0;
    END_IF ;
    iattempnumber := 40;
    40:
    IF Current >= SCREEN.HMI_Current_Blockage_Setpoint THEN SCREEN.Blocked := 1;
    MotorSetpointHz := MOVE(-500);
    Blocked_Reverse_Running := 1;
    TONRunReverseTime.IN := Blocked_Reverse_Running;
    TONRunReverseTime.PT := T#16S;
    TONRunReverseTime.Q := Blocked_Reverse_Stopped;
    SCREEN.Blocked := 0;
    END_IF ;
    iattempnumber := 50;
    50:
    IF Current >= SCREEN.HMI_Current_Blockage_Setpoint THEN SCREEN.Blocked := 1;
    MotorSetpointHz := MOVE(-500);
    Blocked_Reverse_Running := 1;
    TONRunReverseTime.IN := Blocked_Reverse_Running;
    TONRunReverseTime.PT := T#32S;
    TONRunReverseTime.Q := Blocked_Reverse_Stopped;
    SCREEN.Blocked := 0;
    END_IF ;
    iattempnumber := 60;
    60:
    IF Current >= SCREEN.HMI_Current_Blockage_Setpoint THEN
    SCREEN.Blocked_Alarm := 1;
    SCREEN.Blocked := 1;
    SCREEN.Blocked_Shutdown := 1;
    END_IF ;
    iattempnumber := 0;
    END_CASE
    END_IF

     
  • Kim - 2016-11-01

    I think the error is very descriptive!
    It tells you that the compiler can't "see" the variable Blocked in your prg SCREEN.
    Most probably you have declared it as a VAR instead of a VAR_INPUT in the header of SCREEN.

     
  • rickj - 2016-11-01

    If I understand correctly the code you list is part of a FB and it is attempting to access a bool defined in a program. If this is the case, it's generally considered bad practice to access external variables in this manner. It's preferred to define FB input and out parameters instead.

    You are probably getting the error because Blocked is defined in a VAR section, which is not externally accessible, instead of a VAR_INPUT section which is externally accessible.

     
  • arunrf - 2016-11-01

    Thanks for your help Kim .... am still fairly new to Codesys You were correct......

     
  • arunrf - 2016-11-01

    Thanks for the comment Rick, I'll try it the way you suggest as well....

     

Log in to post a comment.