Sign in to follow this  
Followers 0
Guest cmulder

Using pointers in GX IEC Developer

3 posts in this topic

Hi all, The thing I'm trying to achieve is actually quite difficult to explain, but since there's no use posting this topic if I can't explain, I'll give it a go anyway... I have created a DUT ("DUTDigitalInput") consisting of 4 BOOL's. The DUT represents one digital input, with extra information that can be used to "overrule" the input via software, for instance during commissioning. In the GVL I have defined a number of digital inputs, each of the type DUTDigitalInput. Now I would like to create an FB where I can address each variable defined in the GVL one-by-one to check whether it has to be overruled or not. Of course I would prefer not to call them by name or even address. Instead I would like to input the startaddress and number of inputs in the FB, and internally in the FB I can then address the correct variable. My guess is I have to use pointers for this, but I do not really know how to create and use these in GX IEC Developer. Any help would be much appreciated. My apologies if it isn't exactly my explanation isn't exactly clear. I have tried to explain as good as possible. Thanks in advance, Caspar

Share this post


Link to post
Share on other sites
if your data types are all the same, you can use arrays, move your DUT defined variables into an array of the same dimension, this array can then be moved into your user defined function blocks as a single addressable element. Hope this answer matches your question!

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
Sign in to follow this  
Followers 0