Page 1 of 1

Convert v4 to v5

Posted: Tue Nov 13, 2012 6:13 pm
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)
{

Re: Convert v4 to v5

Posted: Tue Nov 13, 2012 7:43 pm
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,

Re: Convert v4 to v5

Posted: Wed Nov 14, 2012 4:00 pm
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.

Re: Convert v4 to v5

Posted: Wed Nov 14, 2012 4:12 pm
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?

Re: Convert v4 to v5

Posted: Wed Nov 14, 2012 4:27 pm
by dbasnett
Also, what do I have to do to be able to post in the V5 forum?

Re: Convert v4 to v5

Posted: Wed Nov 14, 2012 4:39 pm
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

Re: Convert v4 to v5

Posted: Wed Nov 14, 2012 5:04 pm
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);

}

}

Re: Convert v4 to v5

Posted: Wed Nov 14, 2012 5:33 pm
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.

Re: Convert v4 to v5

Posted: Wed Nov 14, 2012 5:46 pm
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);
}

Re: Convert v4 to v5

Posted: Thu Nov 15, 2012 3:13 pm
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.

Re: Convert v4 to v5

Posted: Thu Nov 15, 2012 3:26 pm
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)

Re: Convert v4 to v5

Posted: Thu Nov 15, 2012 4:42 pm
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

Re: Convert v4 to v5

Posted: Thu Nov 15, 2012 11:52 pm
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..

Re: Convert v4 to v5

Posted: Fri Nov 16, 2012 3:08 pm
by dbasnett
Rebooting took care of the 120 error. Now I am back to the original problem. Any ideas?

Re: Convert v4 to v5

Posted: Fri Nov 16, 2012 3:26 pm
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.

Re: Convert v4 to v5

Posted: Fri Nov 16, 2012 4:07 pm
by dbasnett
The part of the code is attached to one of my previous posts.

Re: Convert v4 to v5

Posted: Fri Nov 16, 2012 4:23 pm
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.

Re: Convert v4 to v5

Posted: Tue Nov 20, 2012 5:17 pm
by dbasnett
Thanks to David! A new .fcd file and all is well.