CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

CCS and MPLAB

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








CCS and MPLAB
PostPosted: Sun Mar 12, 2006 10:37 am     Reply with quote

hi all,

My program has an array of struct and I'm using a ccs plugin to compile straight from mplab, like this for example:

Code:

#include <18F4525.h>

typedef struct
{
   int8 ns[8];
   char tipo;
   int credito;
   int contador;

}bt;

bt button[3];

void main()
{
   button[0].credito = 20;
}



The problem is that i can't see this array of struct in the watch window, cause it says unsupported structure.


Does anyone have a clue of why this is happening?

Thanks a lot
kastrup_carioca



Joined: 12 Mar 2006
Posts: 1

View user's profile Send private message

PostPosted: Sun Mar 12, 2006 10:39 am     Reply with quote

it was me who wrote the previous post, but i forgot to log in.

sorry about that....
bayWeiss



Joined: 01 Mar 2007
Posts: 2

View user's profile Send private message

PostPosted: Thu Mar 01, 2007 10:27 am     Reply with quote

What is the solution to the problem? I know that MPLAB will show the array of structs under C18.

cheers!
john.ma



Joined: 19 Nov 2012
Posts: 23

View user's profile Send private message

PostPosted: Wed Feb 20, 2013 6:27 am     Reply with quote

I know this was quite a while ago but I bumped into this issue today and noticed there is a workaround. It works in my case any how...

So for instance you have a structure or union such as:

Code:

union DataBuffer {
   int8 SPI[bufferSize];
   int1 RAW[8*bufferSize];
} SignalData;


You may get an "unsupported structure" message in the simulator window when simulating in MPLAB. This is probably because MPLAB doesn't support these datatypes formats by default...

By appending a structure it forces the simulator to interpret the data differently:

Code:

union DataBuffer {
   int8 SPI[bufferSize];
   int1 RAW[8*bufferSize];
   struct myStruct AUX;
} SignalData;


In the case above I'm using a union thus each element in the union structure have to be the same size. In my case I used 13B therefore my struct is 13B.
The simulator watch window will display the first element in the struct... e.g. SPI array.

Not sure anyone else has found a resolution to this, but this may help Smile
Regards,
John
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group