thetripathi
Member
Hi All,
I have created structured data types for my application because this gives a clear explanation of the variables used.For this I have lot of UDTs in my program.I have tried to create a FB in SCL.But the compiler doesn't allow this.The declared variable already exists in symbol table also and I have defined the structured variable in the IN_OUT field.But still the complier is not able to identify this variable.I will paste a part of my code and the error which is coming.
FUNCTION_BLOCK FB600
VAR_IN_OUT
CSData:CSData;
END_VAR
CS.Par.DiaBlade := 380.0; (* [mm] Actual blade diameter *)
CS.Par.DiaCorr := 32.54; (* [mm] Reduction to blade diameter = (Blade overlap) + (Material Dimension) *)
CS.Par.NMax := 980.0; (* [rpm] Max motor speed *)
CS.Par.TorqNom := 2467.8; (* [Nm] Nominal motor torque *)
CS.Par.GearRatio := 1.0; (* Gear ratio (Motor speed / output speed) *)
CS.Par.JTot := 15.2; (* [Kgm2] Total inertia including motor *)
END_FUNCTION_BLOCK
The red colour ones are my structured variable.
Can anybody throw a light on this.
Thanx
Preet
I have created structured data types for my application because this gives a clear explanation of the variables used.For this I have lot of UDTs in my program.I have tried to create a FB in SCL.But the compiler doesn't allow this.The declared variable already exists in symbol table also and I have defined the structured variable in the IN_OUT field.But still the complier is not able to identify this variable.I will paste a part of my code and the error which is coming.
FUNCTION_BLOCK FB600
VAR_IN_OUT
CSData:CSData;
END_VAR
CS.Par.DiaBlade := 380.0; (* [mm] Actual blade diameter *)
CS.Par.DiaCorr := 32.54; (* [mm] Reduction to blade diameter = (Blade overlap) + (Material Dimension) *)
CS.Par.NMax := 980.0; (* [rpm] Max motor speed *)
CS.Par.TorqNom := 2467.8; (* [Nm] Nominal motor torque *)
CS.Par.GearRatio := 1.0; (* Gear ratio (Motor speed / output speed) *)
CS.Par.JTot := 15.2; (* [Kgm2] Total inertia including motor *)
END_FUNCTION_BLOCK
The red colour ones are my structured variable.
Can anybody throw a light on this.
Thanx
Preet