How to use if equal or similar functions to set signal values?
Posted: Mon 17. Feb 2020, 17:35
Dear PEAK-Team,
I was wondering how the "if equal" and similar functions work (if less, if greater, etc.): If I understood correctly I can specify the number of functions/line which will be executed if the expression is true. And I am not defining the line number of (one) function block which will be executed:
If I would add 7 to "LinesPerformedIfTrue" the first to the seventh line would be executed and not only the 7th line, correct?
Would you mind to provide a small example how to set a signal value according to a comparison of another signal?
For example if I would have for each of the gear shift signals P,R,N,D, a single bit signal (on/off) and would like to translate it to a 2 bit signal (P = 0, R = 1, N = 2, D = 3). How could I do the comparison & value setting using the "if equal const". Or do you have a more simple solution for this example in mind?
Thank you!
Dominik M.
I was wondering how the "if equal" and similar functions work (if less, if greater, etc.): If I understood correctly I can specify the number of functions/line which will be executed if the expression is true. And I am not defining the line number of (one) function block which will be executed:
If I would add 7 to "LinesPerformedIfTrue" the first to the seventh line would be executed and not only the 7th line, correct?
Would you mind to provide a small example how to set a signal value according to a comparison of another signal?
For example if I would have for each of the gear shift signals P,R,N,D, a single bit signal (on/off) and would like to translate it to a 2 bit signal (P = 0, R = 1, N = 2, D = 3). How could I do the comparison & value setting using the "if equal const". Or do you have a more simple solution for this example in mind?
Thank you!
Dominik M.