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 support@ccsinfo.com

Structure Elements in Watch Window 'out of scope'

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



Joined: 09 Oct 2007
Posts: 62

View user's profile Send private message

Structure Elements in Watch Window 'out of scope'
PostPosted: Mon Apr 07, 2008 4:43 pm     Reply with quote

I don't see the structure node elements in the Watch Window of MPLAB IDE 8.00. I am running CCS Compiler PCM 4.060, ICD2, PIC16F690-ICD.
It shows 'out of scope'.

I am trying to take in variable length string on the fly. It can be 8-520 bytes. I am trying to take one byte at a time through ram, store it in program memory, free up the ram, then repeat until the entire command string is taken in.

Does anyone have any ideas on what could be causing this? Any help would be greatly appreciated.

Related Structure Code Attached:

Code:

struct node           //declare structure GetIn485Command
        {
         char inputstring;           //declare member variable - takes in 1 byte per loop
         struct node  *nextptr;      //declare member variable
        }; struct node  *ptr1,*startptr; 
char mychar;  //declare variable

Main void()
{
 while(1)               
     {
      delay_ms(10);     
      reset_uart();                //Resets Serial Port / USART
      clear_usart_transmitter();   //Clear the USART transmit register and its fifo by reading it three times.
      clear_usart_receiver();      //Clear the USART receive register and its fifo by reading it three times.
      delay_ms(2.4);
      //delay_ms(10);
      //Slave--->Master
      // TF(); //Updates Array Opcode204[] to transmit Temperature Function Values
      //COMMAND - MASTER--->SLAVE
     
      //Dynamic Memory Function for receiving command from Master
      ptr1 = malloc(sizeof(struct node));
      mychar =getc();
     ptr1->inputstring =  mychar;           //  ->Structure Pointer Operation
      ptr1->nextptr = NULL;
      startptr = ptr1;
//     mychar = getc();


      While (mychar!=26)       //takes in 1 byte at a time from Command
        {                    //may need to try hex number instead of 26
             ptr1->nextptr = malloc(sizeof(struct node));
             ptr1 = ptr1->nextptr;         
             ptr1->inputstring = mychar;    //ptr->membervar1 = var;
             ptr1->nextptr = NULL;          //ptr->memebervar2 = NULL;
          mychar = getc();          //store incomming byte in mychar, RAM
             //Copy from RAM to program memory, RAM can handle 253 bytes max.
 
             //free RAM
         }
    }
}



Screenshot Link Here:
http://forum.microchip.com/forceddownload.aspx?file=0%3b328517
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