Hi,
My array has a fixed length of 96 U16 values.
All these values comes from CAN messages received by the controller. There are 4 different CAN Messages. I receive 3 different U16 values in each CAN message (on CAN_DATA_0 to CAN_DATA_5 inclusively). CAN_DATA_6 serves as a multiplexor (it can have 8 possible values). So, 4 CAN messages x 3 U16 values per message x 8 possible values of the multiplexor = 96 different U16 values.
I want to place all of these in an array for the ease of transportability between different pages of my program.
Also, as I said, I will need to do some calculations on this array like : maximum value of the array (and it's position), minimum value of the array (and it's position), sum of all the values inside the array.
I really don't feel like doing a subpage and copying it 96x to do these calculations.
I have some experience on C programming and I definately think that this could be easily done in C code within a "for loop" that is executed each time a new CAN message is received (and the values of the elements inside the array has changed).
Now, I'm looking at the "POU with C-code" function of PLUS1. I've only used the graphical code in PLUS1, so I need to experiment with POU.
Let me know if you think I'm on the right track about this.
Have a good day!
Sam