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,412
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,891
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
20,020
Hi, I have had problem with upgrading some projects from v16 to v18. I tried it on 3 diffrent computers. I want to post this so that anyone that...
Replies
3
Views
79
Hello gentlemen, Im working on a small project on TIA Portal, about establishing a Modbus TCP connection between my ET200SP plc and a socomec...
Replies
11
Views
247
Back
Top Bottom