Home  >  Support  >  Support Forum  >  I get this error while executing the following code.
Notice! We've recently migrated to using a new forum, we hope you enjoy it. If you are an existing member and this is your first time visiting our new forum, please reset your password to be able to sign in.
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

I get this error while executing the following code.

0 votes
Can anyone please check this issue.line 28 : ERROR PARALLEL 1.C : SPD0RShadow is out of scope/ not declared.

#class auto
#define DINBUFSIZE 31
#define DOUTBUFSIZE 31
#define Esc 27
#define D_BAUDRATE 600L
#use "slave_port.lib"
#memmap xmem

#define MSSG_TMOUT 0000UL
// will discontinue collecting data 0 seconds after
// receiving any character or when maxSize are read.

// This timeout period determines when to give up waiting for any data to
// arrive and must be implemented within the user's program, as it is below.
#define IDLE_TMOUT 9000UL
// will timeout after 9`` seconds if no data is read.

* Using serXread(), the program can accept binary data, not just text.
* This structure represents a 16-bit integer followed by twenty 32-bit
* floating point values. Of course, them floats better be IEEE-754
* format values!

typedef struct
short d;
float f[20];
// serDread and serDwrite read and write bytes of any data type

void main()

char value;
char REG;
int i,n,maxSize;
unsigned long t;
DATA data;
char s[32];
// For status messages.

n = 0;
maxSize = sizeof(DATA); // 82 bytes
//Initializing the port as slave port by assigning below value in SPCR
while ((n != 1) || ((char)data.d != Esc)) {
// until 'Esc'
// 82 bytes max, up to 3 sec between chars before timing out

if ((n = serDread(&data, maxSize, MSSG_TMOUT)) > 0)

printf("\n Received data is %c \n",data.d);
printf("value in REG is %c\n",REG);
printf("value in SPD0R is %c\n",value);
// start anew for next message
serDputs(" Timed out! ");
// start anew for next message
serDputs(" Done");
while (serDwrFree() != DOUTBUFSIZE) ;
// Complete tx before closing

asked Jul 2 in Rabbit Software by AISWARYA RAJ New to the Community (1 point)

Please log in or register to answer this question.

1 Answer

0 votes

This error is telling you that SPD0RShadow has not been defined anywhere. There is no shadow register defined for the SPD0R register. Use NULL instead for that parameter.
answered Jul 7 by trooper2 Seasoned Professional (242 points)
Your M2M Expert™for Businessfor Developers
Newsletter SignupYouTubeGoogle+FacebookCopyright © 1996-2013 Digi International Inc. All rights reserved. Legal