PLUS+1™ Tools > PLUS+1™ and C



Is there any way to pass an array or structure to/from a CCP?
The primary use I have for these things is to implement complex CAN protocols, such as CanOpen object dictionary iteractions, PDOs, J1939 memory access etc...
To do this I need to be able to control the CAN bus.
I'm trying to do this by connecting my CCP block to standard CAN Tx/Rx blocks, but the interface to arrays (8 8bit variables) used to hold the data is a bit dirty. Is there a better way to do this?


It is my understanding passing arrays to/from the CCP is not possible at this point.
It is my impression this is something they are looking into.

Yes passing arrays is not possible. What I have had to do is add a lot of dummy functions that all return a different index of the array.

For example I use an array with 5 values. To get the info into CCP land, I have an input function that I pass each array element as a separate parameter to my c function ex. inputfun(array0, array1, array2, array3, array4). I do some processing on the elements then to get them back out to guide land I have to make 5 dummy functions that each returns one element from the array ex. returnarray0(), returnarray1()....

Its messy but works. I can throw together a example if interested.



[0] Message Index

Go to full version