Page 1 of 1

c code error on compiling no c code in program

Posted: Wed Nov 24, 2010 6:06 am
by GOWITDEFLO
Hi I am a new user and have been trying to compile my first program to chip or hex file and have had no success.

The program is a Pwm motor speed controller with encoder for speed reference

I receive a c code error 'If your flowchart contains c code please review this carefully ' The problem is there are no c code blocks or c code in my program that i am aware of. I am running ver 4.3 on windows XP using an EB006 programmer. I have read posts on the forums concerning this problem and have not found a solution.

My compiler and programmer options are as loaded selecting EB006 board

I have tried some of the test files posted on the forum in connection with this error and the same error occurs

I have included my program file and associated generated files for your perusal. . Please advise Many thanks

Re: c code error on compiling no c code in program

Posted: Wed Nov 24, 2010 9:17 am
by Steve
If you look at the compiler messages, the problem is at line 1058 in the generated C code file:

Code: Select all

E:\Documents and Settings\A.Masdoll\Desktop\flowcode files\Component Routines\Components\PWM & Analogue Output\CHARICKS  SINGLE CHANNEL  ADC Controlled PWM 16F690.c(1058): error: can't convert 'unsigned char' to 'float'

E:\Documents and Settings\A.Masdoll\Desktop\flowcode files\Component Routines\Components\PWM & Analogue Output\CHARICKS  SINGLE CHANNEL  ADC Controlled PWM 16F690.c(1058:12): error: failed to generate expression
Looking at the C code file at this line (use Notepad's edit..goto menu), you get to the following lines:

Code: Select all

		//Call Component Macro
		//Call Component Macro: float=SWITCH(0)::ReadState
		FCV_FLOAT = FCD_SWITCH0_ReadState();
So you can see exactly where the problem is. The "ReadState" macro returns a "BYTE" variable, but your return variable is a "FLOAT".

Re: c code error on compiling no c code in program

Posted: Wed Nov 24, 2010 11:21 am
by GOWITDEFLO
Hi Steve
Thank you for the info I am sure I will be able to tackle similar problems more easily.
Thank you for a great program!!! Makes life a lot easier for those of us who have been trudging along with various languages for years.