Jump to content

Moving/Copying the Contents of a Structured Data Type


Go to solution Solved by Crossbow,

Recommended Posts

Posted

Hello All,

In the Rockwell world, I can easily copy all the contents from one User Defined Data Type Tag to the other by using a COP (Copy)

For instance, Copy Profile00 to Profile01 with a length of 1, would copy all the contents of Profile00 over to Profile01 (Profile00.Name, Profile00.Height etc.)

How can I accomplish this in GXWorks3? Seems like every type of Mov I do errors because I'm trying to move an SDT....

 

Thanks for the help!

Posted
15 minutes ago, Crossbow said:

I just use a ST box and write Structure2:=Structure1;

I have ZERO experience with ST but....

I whipped this up and compiled with no error, cant test until im back on site tomorrow

IF D116 = 0 THEN ActiveProfile:=Profile00;
END_IF;

d116 would be the active profile number....

So when d116 equals 0 then move Profile00 contents to ActiveProfile

Do i have Active and Profile backwards? ActiveProfile:=Profile00 to me seems like it would make Active what Profile00 is, or am i mixed up?

  • Solution
Posted

Destination:=Source

You can also put the comparison in the ladder in front of the ST box, and it will only run when the logic in front is true.

ST boxes are great for math and comparison stuff.  And much of the old Mitsu command set doesn't seem to work well with SDT.  In the other IEC controller I have used, there is a MOVE command for things like this...

Posted
2 minutes ago, Crossbow said:

Destination:=Source

You can also put the comparison in the ladder in front of the ST box, and it will only run when the logic in front is true.

ST boxes are great for math and comparison stuff.  And much of the old Mitsu command set doesn't seem to work well with SDT.  In the other IEC controller I have used, there is a MOVE command for things like this...

Wow had no idea

Thank you so much for the help!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...