File Fill (FLL) in Structured Text

BachPhi

Member
Join Date
Dec 2007
Location
Los Alamos
Posts
640
Structured Text does not have FLL instruction, but one can create the equivalent.

Code:
SIZE(destination,0,length);
FOR position := 0 TO length-1 DO
   destination[position] := source;
END_FOR;

I am thinking of create an AOI for it. But not sure how to handle different input types.
For example, the source can take SINT, INT , DINT, REAL
and destination SINT, INT, DINT, REAL, Structure

Any ideas? Thanks.
 
Last edited:
It's only bits, but ST ain't C

I would expect for a non-structure destination that the source value would be cast; if so then one AOI might work for all numeric types (overflow issues aside).


What about a multi-dimensional destination?


Can source not be a structure? If
Code:
typex_struct_array[position] := typex_struct_source;
does not work, then there would need to be an AOI for each structure type e.g.
Code:
typex_struct_array[position].member0 := typex_struct_source.member0
typex_struct_array[position].member1 := typex_struct_source.member1
...
Unless there is some kind of reflection.


I think there will be several AOIs.
 
Not true.
AOI-Sum-Input-Types.png



EDIT: Inputs can take real, but not Ouput
 
Last edited:
In Siemens world, I've seen this solved with In/Outs before. InOuts only act as a pointer, instead of copying directly, so there are a few extra tricks you can use.



Does that help on the AB side at all?
 
If you want to create an overload function this is the best was I know how. There are probably better.

Set up input parameters as not required not visible as default.

Create a I_xCfgxxxxx, either a bool for each data type sint, int, dint real or a sint where a predefined value enables the examination of sint, int ,dint,etc use this as a flow control for you aoi execution switch break or what ever you want to use. Should be strapped to a const controller tag when inserting AOI and decide which data type you are examining

Pass a parameter for array size as arrays cannot be created dynamically in CLX. Strap to a controller const tag for dim.

Create a udt with each destination type array for an in/out parameter use same const strap as above.

When creating AOI in program you will need to establish array size of in/out UDT.

That’s all I can think of as a suggestion without spinning up a test AOI, don’t have time right now maybe later in the week. Also don’t believe you can alias parameters doing it this way. The parameters will need to be assigned with each decision and error checking will need to be done for each type. This would still be essentially several AOIs in one but only one AOI to manage.

This may work may not it’s just off the top of my head.
 

Similar Topics

I have an Allen Bradley temperature switch that I am trying to use in studio 5000. I am getting the message "Unable to interpret the IODD file"...
Replies
0
Views
47
Hey y'all!! I'm looking for an old EDS file, GSE 560. I can't find them anywhere. It is for a GSE560 display on a DeviceNet network, with...
Replies
0
Views
72
I have no experience with Eaton HMIs. I downloaded the Galileo software and I am trying to get the file on a HMI (XV-102-H3-70twrl-10) to modify a...
Replies
4
Views
101
I just converted an existing application from RSView32 to FactoryTalkView SE. In RSView32, the Datalog was made in a *.DBF file. There was...
Replies
2
Views
65
Good day all! Can someone help me with the procedure to update Beijers E700 firmware? The Panel I am working on is firmware 2.04v and I would...
Replies
1
Views
62
Back
Top Bottom