Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched.
Close
Hi everybody,
The Codesys online help isn't helping me too much to understand what an "Alias" is.
Could someone perhaps show me a little example of an implementation of it?
Particularly it interests me concerning arrays...
Thanks in advance,
Rob
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Alias means "another name for".
Alias in CODESYS is a user defined data type (DUT).
So if you make ThirtyTwoBytes an Alias of ARRAY [0..31] OF BYTE, you can declare myVar : ThirtyTwoBytes; or myVar1 : ARRAY [0..31] OF BYTE; and they'll be the same data type.
I know another programming software where you have alias variables, but in CODESYS you have alias types.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks I-Campbell, your explanation helped me to understand an alias assignment isn't what I had figured out.
I thought the alias could be assigned to the array elements, not to the array itself.
Is this possible in anyway though? (assigning alias to array elements)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi everybody,
The Codesys online help isn't helping me too much to understand what an "Alias" is.
Could someone perhaps show me a little example of an implementation of it?
Particularly it interests me concerning arrays...
Thanks in advance,
Rob
Alias means "another name for".
Alias in CODESYS is a user defined data type (DUT).
So if you make ThirtyTwoBytes an Alias of ARRAY [0..31] OF BYTE, you can declare myVar : ThirtyTwoBytes; or myVar1 : ARRAY [0..31] OF BYTE; and they'll be the same data type.
I know another programming software where you have alias variables, but in CODESYS you have alias types.
Thanks I-Campbell, your explanation helped me to understand an alias assignment isn't what I had figured out.
I thought the alias could be assigned to the array elements, not to the array itself.
Is this possible in anyway though? (assigning alias to array elements)