Convert v4 to v5

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
dbasnett
Posts: 125
Joined: Mon Aug 15, 2011 1:54 pm
Has thanked: 8 times
Been thanked: 11 times
Contact:

Convert v4 to v5

Post by dbasnett »

I would have posted in the v5 forum but I do not have permissions...

I am having a problem upgrading a program from v4 to v5. Here is the output:

http://www.matrixmultimedia.com
Launching the compiler...
C:\Program Files (x86)\Flowcode\v5\Tools\boostc\boostc_pic18_flowcode.exe -v -t PIC18F4580 "TrainerTarget_v4.c"
BoostC Optimizing C Compiler Version 7.04 (for PIC18 architecture)
http://www.sourceboost.com
Copyright(C) 2004-2011 Pavel Baranov
Copyright(C) 2004-2011 David Hobday

Licensed to FlowCode User under Single user Pro License for 1 node(s)
Limitations: PIC18 max code size:Unlimited, max RAM banks:Unlimited

TrainerTarget_v4.c
Starting preprocessor: C:\PROGRA~2\Flowcode\v5\Tools\boostc\pp.exe TrainerTarget_v4.c -i C:\PROGRA~2\Flowcode\v5\Tools\boostc\include -d _PIC18F4580 -la -c2 -o TrainerTarget_v4.pp -v -d _BOOSTC -d _PIC18 -d _CHAR_INDEX

............

TrainerTarget_v4.c(3823): error: missing right paren
TrainerTarget_v4.c(3823): error: general error
TrainerTarget_v4.c(3823): error: variable name expected
TrainerTarget_v4.c(3823): error: general error
TrainerTarget_v4.c(3823): error: failure

failure
Return code = 1
Flowcode was unable to compile the flowchart's C code due to the following errors:


If your flowchart contains C code, please review this carefully. If your flowchart contains no C-code or you have thoroughly reviewed the code, contact Technical Support.

FINISHED

In the supplementary code I have:
#pragma DATA 0x200000,68,101,119,97,121,110,101,66
#pragma DATA _EEPROM,64,255,"Copyright - dewayne@yall.biz, 2011",255,255

The c code at line 3823 is

MX_UINT8 FCM_CheckAbutton(MX_UINT8 FCL_BUTPOW2, MX_UINT8 FCL_BUTVAL)
{

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: Convert v4 to v5

Post by Enamul »

Hi

I guess it would tough to sort that without having a look at the code. If that is commercially sensitive code, you can PM me so that I can have a look what's going wrong?

Thanks,
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
DavidA
Matrix Staff
Posts: 1076
Joined: Fri Apr 23, 2010 2:18 pm
Location: Matrix Multimedia Ltd
Has thanked: 58 times
Been thanked: 258 times
Contact:

Re: Convert v4 to v5

Post by DavidA »

Indeed it is difficult to tell without seeing the code.

- Always please ensure you are running the latest version of Flowcode, 5.4 is the latest at the time of writing, Help >> Check for Updates to see whether there is an upgrade available.

- To help others diagnose your code it is good to use the new 'disable' feature on icons in v5 to try and narrow down where the problem code is occuring.

dbasnett
Posts: 125
Joined: Mon Aug 15, 2011 1:54 pm
Has thanked: 8 times
Been thanked: 11 times
Contact:

Re: Convert v4 to v5

Post by dbasnett »

I am using the latest version of flowcode. Am I correct about the line number in the c code, i.e. this error message

TrainerTarget_v4.c(3823): error: missing right paren

is on line 3823 in the c code?

dbasnett
Posts: 125
Joined: Mon Aug 15, 2011 1:54 pm
Has thanked: 8 times
Been thanked: 11 times
Contact:

Re: Convert v4 to v5

Post by dbasnett »

Also, what do I have to do to be able to post in the V5 forum?

User avatar
DavidA
Matrix Staff
Posts: 1076
Joined: Fri Apr 23, 2010 2:18 pm
Location: Matrix Multimedia Ltd
Has thanked: 58 times
Been thanked: 258 times
Contact:

Re: Convert v4 to v5

Post by DavidA »

Hello,

Yes it does refer to that line in the C-code.

More information on upgrading forum accounts can be found here: http://www.matrixmultimedia.com/mmforum ... =46&t=9958

dbasnett
Posts: 125
Joined: Mon Aug 15, 2011 1:54 pm
Has thanked: 8 times
Been thanked: 11 times
Contact:

Re: Convert v4 to v5

Post by dbasnett »

I duplicated the macro that appears to be causing the error, and the error changed line numbers. I have attached the macro.

.............

TrainerTarget_v4.c(4267): error: missing right paren
TrainerTarget_v4.c(4267): error: general error
TrainerTarget_v4.c(4267): error: variable name expected
TrainerTarget_v4.c(4267): error: general error
TrainerTarget_v4.c(4267): error: failure


Here is the c code starting at line 4267.

MX_UINT8 FCM_CheckAbutton(MX_UINT8 FCL_BUTPOW2, MX_UINT8 FCL_BUTVAL)
{

MX_UINT8 FCR_RETVAL;

// get button state
//Input: PORTB -> butRD
//TRISE.PSPMODE workaround
#if ('b' == 'e')
  trisb = trisb | (0xFF & 0x0F);
  FCV_BUTRD = portb & 0x0F;
#else
  trisb = trisb | 0xFF;
  FCV_BUTRD = portb;
#endif

// is button pressed?
//Decision: (butRD AND CheckAbutton.ButPow2) = CheckAbutton.ButPow2?
if ((FCV_BUTRD & FCL_BUTPOW2) == FCL_BUTPOW2)
{

// less than max?
//Decision: CheckAbutton.butVal < 255?
if (FCL_BUTVAL < 255)
{

// increment count
//Calculation:
// CheckAbutton.butVal = CheckAbutton.butVal + 1
FCL_BUTVAL = FCL_BUTVAL + 1;

} else {

//Comment:
//Button Pressed

// turn state on
//Calculation:
// butSTcur = butSTcur OR CheckAbutton.ButPow2
FCV_BUTSTCUR = FCV_BUTSTCUR | FCL_BUTPOW2;

}

} else {

// are we at 0?
//Decision: CheckAbutton.butVal > 0?
if (FCL_BUTVAL > 0)
{

// decrement count
//Calculation:
// CheckAbutton.butVal = CheckAbutton.butVal - 1
FCL_BUTVAL = FCL_BUTVAL - 1;

} else {

//Comment:
//Button Released

// turn state off
//Calculation:
// butSTcur = butSTcur AND (255 XOR CheckAbutton.ButPow2)
FCV_BUTSTCUR = FCV_BUTSTCUR & (255 ^ FCL_BUTPOW2);

}

}
Attachments
CheckAbutton.fcm
(4.89 KiB) Downloaded 351 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: Convert v4 to v5

Post by Benj »

Hello,

The C code does seem to be missing the final '}' to terminate the macro.

Therefore this error makes sense.
TrainerTarget_v4.c(4267): error: missing right paren
I expect this is a Flowcode issue but we will investigate and let you know.

dbasnett
Posts: 125
Joined: Mon Aug 15, 2011 1:54 pm
Has thanked: 8 times
Been thanked: 11 times
Contact:

Re: Convert v4 to v5

Post by dbasnett »

Sorry. I think I did not copy the c correctly. Let me try again:

//Checks a button state

MX_UINT8 FCM_CheckAbutton(MX_UINT8 FCL_BUTPOW2, MX_UINT8 FCL_BUTVAL)
{

MX_UINT8 FCR_RETVAL;

// get button state
//Input: PORTB -> butRD
//TRISE.PSPMODE workaround
#if ('b' == 'e')
  trisb = trisb | (0xFF & 0x0F);
  FCV_BUTRD = portb & 0x0F;
#else
  trisb = trisb | 0xFF;
  FCV_BUTRD = portb;
#endif

// is button pressed?
//Decision: (butRD AND CheckAbutton.ButPow2) = CheckAbutton.ButPow2?
if ((FCV_BUTRD & FCL_BUTPOW2) == FCL_BUTPOW2)
{

// less than max?
//Decision: CheckAbutton.butVal < 255?
if (FCL_BUTVAL < 255)
{

// increment count
//Calculation:
// CheckAbutton.butVal = CheckAbutton.butVal + 1
FCL_BUTVAL = FCL_BUTVAL + 1;

} else {

//Comment:
//Button Pressed

// turn state on
//Calculation:
// butSTcur = butSTcur OR CheckAbutton.ButPow2
FCV_BUTSTCUR = FCV_BUTSTCUR | FCL_BUTPOW2;

}

} else {

// are we at 0?
//Decision: CheckAbutton.butVal > 0?
if (FCL_BUTVAL > 0)
{

// decrement count
//Calculation:
// CheckAbutton.butVal = CheckAbutton.butVal - 1
FCL_BUTVAL = FCL_BUTVAL - 1;

} else {

//Comment:
//Button Released

// turn state off
//Calculation:
// butSTcur = butSTcur AND (255 XOR CheckAbutton.ButPow2)
FCV_BUTSTCUR = FCV_BUTSTCUR & (255 ^ FCL_BUTPOW2);

}

}

// return value
//Calculation:
// CheckAbutton.Return = CheckAbutton.butVal
FCR_RETVAL = FCL_BUTVAL;

return (FCR_RETVAL);
}

dbasnett
Posts: 125
Joined: Mon Aug 15, 2011 1:54 pm
Has thanked: 8 times
Been thanked: 11 times
Contact:

Re: Convert v4 to v5

Post by dbasnett »

I am so confused. I tried disabling the supplemental code but that had no affect. When I upgraded the program all I did was make a copy of the folder it was in, then open it with FC5.

dbasnett
Posts: 125
Joined: Mon Aug 15, 2011 1:54 pm
Has thanked: 8 times
Been thanked: 11 times
Contact:

Re: Convert v4 to v5

Post by dbasnett »

I made a new copy of the folder and now I am getting this:

Launching the compiler...
C:\Program Files (x86)\Flowcode\v5\Tools\boostc\boostc_pic18_flowcode.exe -v -t PIC18F4580 "TrainerTarget_v4.c"
BoostC Optimizing C Compiler Version 7.04 (for PIC18 architecture)
http://www.sourceboost.com
Copyright(C) 2004-2011 Pavel Baranov
Copyright(C) 2004-2011 David Hobday

Compiler can not be started without a host program (code 120)

Return code = 120

Flowcode was unable to compile the flowchart's C code due to the following errors:


Then I went back to the original FC4 version, and opened it with FC4 and got the same error!!!!! I thought FC4 and FC5 were independent.

c:\program files (x86)\matrix multimedia\flowcode v4\boostc\boostc_pic18_flowcode.exe -v -t PIC18F4580 "TrainerTarget_v4.c"

BoostC Optimizing C Compiler Version 7.04 (for PIC18 architecture)

http://www.sourceboost.com

Copyright(C) 2004-2011 Pavel Baranov

Copyright(C) 2004-2011 David Hobday



Compiler can not be started without a host program (code 120)

User avatar
DavidA
Matrix Staff
Posts: 1076
Joined: Fri Apr 23, 2010 2:18 pm
Location: Matrix Multimedia Ltd
Has thanked: 58 times
Been thanked: 258 times
Contact:

Re: Convert v4 to v5

Post by DavidA »

Hello, v4 and v5 are seperate but there is some overlap with BoostC.

However this is not an error ive seen before...

Could you try the fix stated in this forum topic: http://www.matrixmultimedia.com/mmforum ... red#p33220

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: Convert v4 to v5

Post by Enamul »

Compiler can not be started without a host program (code 120)
I have faced this kind of issue once...restarting the machine solved my problem..
Enamul
University of Nottingham
enamul4mm@gmail.com

dbasnett
Posts: 125
Joined: Mon Aug 15, 2011 1:54 pm
Has thanked: 8 times
Been thanked: 11 times
Contact:

Re: Convert v4 to v5

Post by dbasnett »

Rebooting took care of the 120 error. Now I am back to the original problem. Any ideas?

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: Convert v4 to v5

Post by Enamul »

I am not that much expert to look through code without actual fcf file. Can you please post the problem part of the code while disabling rest of the bit? I can see what is actually going wrong.
Enamul
University of Nottingham
enamul4mm@gmail.com

dbasnett
Posts: 125
Joined: Mon Aug 15, 2011 1:54 pm
Has thanked: 8 times
Been thanked: 11 times
Contact:

Re: Convert v4 to v5

Post by dbasnett »

The part of the code is attached to one of my previous posts.

User avatar
DavidA
Matrix Staff
Posts: 1076
Joined: Fri Apr 23, 2010 2:18 pm
Location: Matrix Multimedia Ltd
Has thanked: 58 times
Been thanked: 258 times
Contact:

Re: Convert v4 to v5

Post by DavidA »

Hello,

We would need to see the entire Flowcode file, if the program is business sensitive and you do not want to post it on a public forum then please PM me for an email address to send the program to, and we can assure you that either verbally or via an NDA if you wish, that we will diagnose the problem, then remove all trace of the program from our system.

dbasnett
Posts: 125
Joined: Mon Aug 15, 2011 1:54 pm
Has thanked: 8 times
Been thanked: 11 times
Contact:

Re: Convert v4 to v5

Post by dbasnett »

Thanks to David! A new .fcd file and all is well.

Post Reply