TIA POrtal: Copy Array of String to another

janner_10

Lifetime Supporting Member
Join Date
Dec 2014
Location
Tewkesbury
Posts
1,301
I am using v14 with a 1215 dc/dc/dc.

I need to copy a 50 element array of strings to another 50 element array of strings.

I can work it out for the individual elements, but I dont want to this 50 times!

Move_BLK doesn't like strings!

Any suggestions?
 
EDIT:

Couldn't do it in ladder, this seems to work though!

IF #tempCopy THEN

"Data_TO_Scada".Previous_Pallet_Results_String := "Data_TO_Scada".Live_Results_String;
"Data_TO_Scada".Previous_Pallet_Results_Date_Time := "Data_TO_Scada".Live_Results_Date_Time;
"Data_TO_Scada".Previous_Pallet_ID := "Data_TO_Scada".Current_Pallet_ID;
"Data_TO_Scada".Previous_Number_Reads := "Data_TO_Scada".Current_Number_Reads;

END_IF;
 
I am using v14 with a 1215 dc/dc/dc.

I need to copy a 50 element array of strings to another 50 element array of strings.

I can work it out for the individual elements, but I dont want to this 50 times!

Move_BLK doesn't like strings!

Any suggestions?

Are you trying to move the whole array? If you, you can just use MOVE. When it asks you to enter the element, just use none. Individual elements would be arrayname[XXX], but you can access the whole array with just arrayname.

If you're trying to shift the array (moving 1-20 into 2-21, or whatever) then move_block_variant should work.
 
Try to organize your data in user defined Data Types, and assign this Data Type to "previous" and "live" structures.
Then you can do in one line:
"Data_TO_Scada".Previous := "Data_TO_Scada".Live ;

Or in Array of Data Type. Then you can do for example
"Data_TO_Scada".Data[0] := "Data_TO_Scada".Data[1] ;
etc.
 

Similar Topics

Hi everyone! I am working on a Siemens plc (1200/1500), and I have two instruction that i have to perform. A) data structure (40 bools, 40...
Replies
3
Views
2,304
All, We are looking into the best ways to protect IP in PLC/SCADA code and the latest offerings included with TIA portal seem much better than...
Replies
3
Views
3,817
Hi all, Straight up question: I'm using TIA Portal and an S7-1200, and wanting to do a straight bitwise copy of all the data in a Word to put it...
Replies
16
Views
19,916
My PLC (S7-1200 with CPU-1212C) has now been delivered to customer site. They've asked me to do some updates to the software. I can do that on my...
Replies
21
Views
323
Does anyone know why the connection interface is greyed out and says why I can only use Teleservice instead of the other options like PN/IE? I am...
Replies
0
Views
44
Back
Top Bottom