Author Topic: Arrays  (Read 18739 times)

Offline metalninjadragon

  • PLUS+1 Developer
  • ***
  • Posts: 32
  • Karma: +0/-0
Arrays
« on: June 30, 2011, 05:49:58 PM »
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?

thanks

Randy

  • Guest
Re: Arrays
« Reply #1 on: August 23, 2012, 10:33:12 PM »
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.

radioact

  • Guest
Re: Arrays
« Reply #2 on: September 11, 2012, 09:28:59 PM »
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.

Tyler