Hi, I've got a little problem that involves arrays and looping it.
I've got an FB and 3 arrays of 128 bools inside.
One is a list of detected nodes on Profibus.
Second is a list of configured nodes on Profibus.
Third is a list of nodes that got error ( configured but not available, available but not configured ), array index is node's address.
So It looks like this:
To achieve an effect of having node's status from 1 to 127 I can copy and paste every one and change index, but i'd rather loop thru it. I tried looping and iserting INT/WORD counter into array index with no luck.
When getting to it with a pointer... how can I get to 3 arrays if I have only 2 Address registers... and even if I can hold counter value for example for 24 addres... how to count the P# value to 3.0 bit array adress?
I've got an FB and 3 arrays of 128 bools inside.
One is a list of detected nodes on Profibus.
Second is a list of configured nodes on Profibus.
Third is a list of nodes that got error ( configured but not available, available but not configured ), array index is node's address.
So It looks like this:
Code:
O(
A #Status_Profi_conf[1]
AN #Status_Profi_read[1]
)
O(
AN #Status_Profi_conf[1]
A #Status_Profi_read[1]
)
= #Status_Profi_error[1]
To achieve an effect of having node's status from 1 to 127 I can copy and paste every one and change index, but i'd rather loop thru it. I tried looping and iserting INT/WORD counter into array index with no luck.
When getting to it with a pointer... how can I get to 3 arrays if I have only 2 Address registers... and even if I can hold counter value for example for 24 addres... how to count the P# value to 3.0 bit array adress?