Sign in to follow this  
Followers 0
iarglez

Indirect addressing an array element

10 posts in this topic

Hello guys, I need some help regarding indirect addressing: There is a user defined array data type integrated by the following elements: Array user defined data type Array.ArrayInfo user defined tag size 100 Parameter1 String16 Parameter2 String16 Parameter3 String16 Parameter4 INT size 5 Parameter5 INT size 20 I'm using Array.ArrayInfo[index_element].Parameter4[1].0 to check bit 0 of element 1 of array parameter4 but an error of data type rise after trying to accept edits. Is this error related to the user defined data type? Or, Am I using an erroneous format to address the data type to the bit level? Edited by iarglez

Share this post


Link to post
Share on other sites
Please, post your program and I'll help you

Share this post


Link to post
Share on other sites
If you can't post your entire program at least post any UDT definitions which are part of this problem. Does the syntax checker allow this if you use a number in place of 'index_element'?

Share this post


Link to post
Share on other sites
Is "Array" a tag of some user-defined type or is it an array of "ArrayInfo" user-defined types? If the latter, then possibly use Array[index_element].Parameter4[1].0

Share this post


Link to post
Share on other sites
Hello b_carlton, actually yes, the syntax checker has no problem if I write a number instead of the "index element".

Share this post


Link to post
Share on other sites
Then make sure that 'index_element' in a integral type (INT, SINT, DINT).

Share this post


Link to post
Share on other sites
Hello Gerry, Array is a tag of a user-defined type. a specific user defined data type was created named: udt_Part, then a Base tag was created making reference to the data type udt_Part just created. udt_part contains: PartInfo which is a userd defined data type length 100 ... This is the data array part info contains: Parameter1 which is a string 16 Parameter2 which is a string 16 Parameter3 which is a string 16 Parameter4 which is a SINT length 5 Parameter5 which is a INT length 20 Thanks for the support,

Share this post


Link to post
Share on other sites
It is an INT data type. I'll try with the other two options.

Share this post


Link to post
Share on other sites
Here is the program post. to_post_STA45_DTM_Rfbshd.ACD

Share this post


Link to post
Share on other sites
Make your index_element ("i_CellPart_Working" in this case) accessible to your Station_45 Program. In other words, your index_element is not in the scope of the program where you are trying to use it. Your syntax is ok Bye Edited by chantecler
1 person likes this

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