Creating fresh Custom Code

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Kumaran
Posts: 73
Joined: Tue Apr 08, 2008 5:23 pm
Been thanked: 1 time

Creating fresh Custom Code

Post by Kumaran »

Hi

I want to create fresh custom component for some devices. what are the parameters that I need to consider changing/ defining? In one of your example document "Custom Components For Flowcode", only macro name & count, Macro return, macro parameter & macro parameter types are instructed to change, where as I find there are some more parameters in default custom code c file & in the beta components.

[Port]
DesiredPort=0
PortMandatory=0
SamePortAsID=0

[Pins]
Count=0

what are these above definition? such that, I have seen many parameters, which I dont I fully understand.

Can you please give your suggestions?

Thanks
M.S.S

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Creating fresh Custom Code

Post by Benj »

Hello,

These extra parameters are used by the simulation interaction only and they can be removed from the file when creating new custom components.

Kumaran
Posts: 73
Joined: Tue Apr 08, 2008 5:23 pm
Been thanked: 1 time

Re: Creating fresh Custom Code

Post by Kumaran »

As per custom code for flowcode document I have created custom component. I am getting few errors in the complied C and I found error customise component macro. could you please look in to the attached customc file screenshots and suggest me how to resolve them?

problem summary
---------------------
1. I built simple program to check the code, I inserted one function and compiled to c. output of Compiled C code has some error information in it in the custom functions sections like below
void FCD_Custom0_ds1307_init()
{
//Error Reading Code For default::Macro_ds1307_init

}function


2. When I checked the functions in the user component custom code, I have seen that two functions DS1307Write and DS1307Read arguments are incorrect. Please attached screenshot.
Attachments
Error.zip
Screen Shots and sample program developed for check
(44.25 KiB) Downloaded 260 times
PIC_Custom.c
My code
(3.11 KiB) Downloaded 253 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Creating fresh Custom Code

Post by Benj »

Hello,

Right I have found the problem I think. It was due to the GetDefines section of code. Flowcode v4 changed the way this process was handled so it fell in line with the interrupt and startup sections. I also rearranged the parameters list at the top of the file to correspond with the order of the functions. Not sure if this would make a difference.
Attachments
PIC_Custom.c
(2.96 KiB) Downloaded 275 times

Kumaran
Posts: 73
Joined: Tue Apr 08, 2008 5:23 pm
Been thanked: 1 time

Re: Creating fresh Custom Code

Post by Kumaran »

Hi

I have downloded your file. Now the functions are getting read when compiling to c. however, still I am getting errors when compiling the to hex.
The error message
C:\Program Files\HI-TECH Software\PICC\9.70\bin\picc.exe --CHIP=16F877A -N48 DS1307_Custom_Code_example.c
DS1307_Custom_Code_example.c:
94: void FCD_Custom0_GetDefines()
^ (314) ";" expected
(1273) Omniscient Code Generation not available in Lite mode (warning)
HI-TECH C Compiler for PIC10/12/16 MCUs (Lite Mode) V9.70
Copyright (C) 2009 Microchip Technology Inc.
(908) exit status = 1

Return code = 1


Beauty is that, first time when I am compiling it, I did not get any error messages. After adding some codes I got this error message. So I deleted those codes and kept only one function and tried to compile. this time it got failed to compile.

What could be the reason?
Attachments
PIC_Custom.c
(3.19 KiB) Downloaded 282 times
DS1307_Custom_Code_example.fcf
(5 KiB) Downloaded 270 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Creating fresh Custom Code

Post by Benj »

Hello,

Right I have had a bit of a look with the custom component file and found a couple of minor problems.

I cannot test that the file is compiling however because I am currently using a 64-bit Windows 7 machine and it keeps giving me the return code 1 error message. If it keeps on like this then its going in a skip or at least as far as I can throw it. I don't care if it is brand new. For anyone out there considering windows 7, don't do it. XP is by far the best Windows OS out there. And likely to stay that way for years to come. I do use 64-bit win 7 at home and that works fine but this machine is just not playing.

Right rant over with here is the custom file. Let me know if it compiles on a non retarded version of Windows.
Attachments
PIC_Custom.c
(3.09 KiB) Downloaded 286 times

Post Reply