UDT (User Defined Data Types ) in SCL

thetripathi

Member
Join Date
Mar 2008
Location
Bangalore
Posts
11
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
 
As you haven't posted the UDT I can't verify that this will compile. The obvious mistakes are that the parameter name you have chosen is CSData but in the code you have used CS. I am assuming the UDT is named CSData in the symbol table, in which case you need to put it in quotes to refer to it symbolically.
Code:
FUNCTION_BLOCK FB600
VAR_IN_OUT

[b]CS:"CSData";[/b]

END_VAR

[color=red]CS.Par.DiaBlade[/color] := 380.0; (* [mm] Actual blade diameter *)

END_FUNCTION_BLOCK
 

Similar Topics

Afternoon all, I'm working on setting up a large excel recipe table for porting updates through the Linx Gateway RTD/DDE function into my recipe...
Replies
2
Views
115
I am trying to copy an array of real numbers into a UDT with a real data type element. I have attached a snip below showing my COP instruction...
Replies
4
Views
204
Hello Inside a FB, I´m trying to transfer a string from a DB to a IN_OUT var that was define as a UDT. The problem is that i can´t determine the...
Replies
4
Views
140
Does anybody have any samples of how to "Create and Use" UDT's in CCW Developer Edition? (I am using v22) I can't find any information from...
Replies
3
Views
320
Hello, I have been looking for a reference for the order that a UDT is copied in the COP instruction. More specifically - I have a set of code...
Replies
5
Views
553
Back
Top Bottom