Hi We have picked up an issue
OSCAT_BASIC.Scale_r function call not working in the old lad and FBD version 4.60.
Gives no output on the function call. When we convert this to LAD2 it works.
As can be see by the two screenshot in normal LD not working in LAD2 it works.
Please confirm if this is an issue with Oscat or with LAD in 3.5.21sp3, is there an workaround.
It seems like a bug in FBD. Work-around:
If you click on the small line between the box and the output variable and delete this, the variable is removed. When you then assign a variable again (Ctrl-A), then you will see that the line will be a bit longer. If you then select the previous variable, you will see that it works.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That's what I found as well Shaun. I have seen it at least in versions 3.5.21.1 and 3.5.21.3. There seems to be an issue with the FBD/LD package v4.6.0.0. The workaround proposed by Tim works but needs to be done manually on every code change/addition.
For now we manually downgrade the FBD/LD package from v4.6.0.0 down to v4.5.0.0 after installation of CoDeSys. Same as you did. I hope this gets fixed on a next patch.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi We have picked up an issue
OSCAT_BASIC.Scale_r function call not working in the old lad and FBD version 4.60.
Gives no output on the function call. When we convert this to LAD2 it works.
As can be see by the two screenshot in normal LD not working in LAD2 it works.
Please confirm if this is an issue with Oscat or with LAD in 3.5.21sp3, is there an workaround.
Regards
Shaun
Is that rung definitely being executed? Is the POU called?
Yes it is called
It seems like a bug in FBD. Work-around:
If you click on the small line between the box and the output variable and delete this, the variable is removed. When you then assign a variable again (Ctrl-A), then you will see that the line will be a bit longer. If you then select the previous variable, you will see that it works.
here is formula for scale function you can impliment your own scale function
Output=OutMin+(Input−InMin)×(InMax−InMin)(OutMax−OutMin)
FUNCTION_BLOCK FB_Scale
VAR_INPUT
xIn : REAL; // Input value (e.g., raw sensor)
xInMin : REAL; // Input range minimum
xInMax : REAL; // Input range maximum
xOutMin : REAL; // Output range minimum
xOutMax : REAL; // Output range maximum
END_VAR
VAR_OUTPUT
xOut : REAL; // Scaled output
END_VAR
VAR
xGain : REAL;
xOffset : REAL;
END_VAR
// Implementation
xGain := (xOutMax - xOutMin) / (xInMax - xInMin);
xOffset := xOutMin - xGain * xInMin;
xOut := xGain * xIn + xOffset;
Hi All,
We downgraded Codesys LAD/FB in the IDE to version 4.5 and it works. Codesys Version 4.6 lad/fb not working.
Was the way we fixed this.
Kind Regards
Shaun
That's what I found as well Shaun. I have seen it at least in versions 3.5.21.1 and 3.5.21.3. There seems to be an issue with the FBD/LD package v4.6.0.0. The workaround proposed by Tim works but needs to be done manually on every code change/addition.
For now we manually downgrade the FBD/LD package from v4.6.0.0 down to v4.5.0.0 after installation of CoDeSys. Same as you did. I hope this gets fixed on a next patch.