Skip to content

Table lookup

edited June 2020 in PLCnext Engineer

Hi,

I'm used to ladder logic that has EN/ENO so i'm having difficulties writing a function that looks at the temperature and a user input then generates a set point according to the two variables.

The function needs to work as follows:

If the temperature is less than 25°C and the user wants to cure to X(1-9)% moisture content then the humidity set point is Y%

If the temperature is between 25°C and 27°C and the user wants to cure to X(1-9)% moisture content then the humidity set point is Y%

etc.

So i have 9 MUX functions and i only want 1 to work if the temperature is within range but it wont allow me to use a direct contact to stop the MUX functions that are out of range. 

I could use another MUX If i could move a number into a variable: Move 1 into Calc if temp is <25 and Move 2 into Calc if temp is >25<=27 etc </p>

Comments

  • Hello John,

    you could use a SEL FB to conditionally freeze the output value to a specific variable and otherwise use the output of your MUX FB.
    Or in this case decide which MUX to use...

    Is this MUX output var a local variable or a global output variable? (Humidity_SP)

    I do recommend not to write to the same output on multiple places.
    Better to use two unique variables and have a defined behavior.

    Humidity_SP := SEL(Humidity_SP_1;Humidity_SP_2; someCondition)

  • Hi Oliver,

    I manged to figure this one out by using the same tag to create a feedback loop for the unwanted input and use another MUX FB to call the different set points 

Sign In or Register to comment.