c code error on compiling no c code in program

Moderator: Benj

Post Reply
GOWITDEFLO
Posts: 2
Joined: Tue Oct 26, 2010 5:42 pm

c code error on compiling no c code in program

Post 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
Attachments
CHARICKS SINGLE CHANNEL ADC Controlled PWM 16F690.msg.txt
(2.23 KiB) Downloaded 389 times
CHARICKS SINGLE CHANNEL ADC Controlled PWM 16F690.c
(22.61 KiB) Downloaded 372 times
CHARICKS SINGLE CHANNEL ADC Controlled PWM 16F690.fcf
(8 KiB) Downloaded 364 times

User avatar
Steve
Matrix Staff
Posts: 3429
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

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

Post 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".

GOWITDEFLO
Posts: 2
Joined: Tue Oct 26, 2010 5:42 pm

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

Post 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.

Post Reply