lekraut

Copy Structure

4 posts in this topic

Hello, I have searched the manuals and forums, but don't have a simple solution for copying data from one structure to another. The best solution I have come up with is to write a specific function block for copying one structure to another of the same type. Is that the best solution?

Edited by lekraut

Share this post


Link to post
Share on other sites

Which Software GX Works 2?

Share this post


Link to post
Share on other sites

 

You can use block move

Example in ST...

BMOV_M(TRUE, RecipeSteps[CurrentStep].Operation, K100, StepData.Operation);

 

The above copies one subscript of an array of structures (DUT) called RecipeSteps, to a single structure (of the same type) called StepData.

The variable "Operation" is the first variable declared (start address) of the structure. The K value is the length of the structure in total.

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now