C Code to Flowcode

For C and ASSEMBLY users to post questions and code snippets for programming in C and ASSEMBLY. And for any other C or ASM course related questions.

Moderators: Benj, Mods

niel
Posts: 14
Joined: Mon Jan 28, 2013 6:24 pm
Contact:

C Code to Flowcode

Postby niel » Tue Jan 29, 2013 12:00 pm

I'm currently working on the program of our project. I have a C code, and i want to represent it in Flowcode. Is there any way I can easily manage to make the program on Flowcode v4? The C code will be my reference and guide program..

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 514 times
Been thanked: 467 times
Contact:

Re: C Code to Flowcode

Postby dazz » Tue Jan 29, 2013 12:05 pm

Hi neil

yes if you understand c its relatively straight forward, start a flowchart and get as far as you can, post the c code use the code tagon the forum , attach the c file and your flowchart to your post. if you get stuck ask
that way people can give more help

Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

niel
Posts: 14
Joined: Mon Jan 28, 2013 6:24 pm
Contact:

Re: C Code to Flowcode

Postby niel » Tue Jan 29, 2013 12:15 pm

hey dazz, thanks for the reply. well, the flowcode must be in such a way that the flow of the program is also seen. including the decisions and stuff. not just the c code itself to be paste in the c box in flowcode. the c code came also from a program made in flowcode. hte problem is, the one who programmed it won't give the flowcode file to me. he said that i should do the flowcode by myself by making the c code as my reference. but i am not that familiar to c programming. what would be a solution to that? :( :(

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 514 times
Been thanked: 467 times
Contact:

Re: C Code to Flowcode

Postby dazz » Tue Jan 29, 2013 12:26 pm

Hi neil
If you can give me a few hours (im on my way out soon) i will generate a c file from a flowchart and add comments so you should be able to see what flowcode components they relate to

Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

niel
Posts: 14
Joined: Mon Jan 28, 2013 6:24 pm
Contact:

Re: C Code to Flowcode

Postby niel » Tue Jan 29, 2013 12:45 pm

hey dazz, thanks! that would be great. i'm willing to wait for it. what about if i attached the c code here? can you help me configure it out? the programmer explained the flow of the program to me, but it is very long. i'm getting a hard time understanding it. and i'm not also a good programmer.

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 514 times
Been thanked: 467 times
Contact:

Re: C Code to Flowcode

Postby dazz » Tue Jan 29, 2013 12:50 pm

Hi neil
yes attach it here , i wont write the flowchart for you but give you some pointers

Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

niel
Posts: 14
Joined: Mon Jan 28, 2013 6:24 pm
Contact:

Re: C Code to Flowcode

Postby niel » Tue Jan 29, 2013 12:56 pm

hey dazz, here it is. i'll wait for your pointers. thanks :D
Attachments
Ball_Collector.c
(35.31 KiB) Downloaded 684 times
Last edited by niel on Thu Jan 31, 2013 2:43 am, edited 1 time in total.

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 514 times
Been thanked: 467 times
Contact:

Re: C Code to Flowcode

Postby dazz » Tue Jan 29, 2013 8:48 pm

Hi Neil
Hope this helps as my c isnt to good, however matrix code in a very structured and clean way so it isnt too difficult to grasp, as i said im not going to write your flowchartr but give you some pointers.
First off print 2 copies of your c code use one for adding notes and a clean copy for referance, you will also need the datasheet for the pic and if you look in your flowcode/tools/boostc folder there is a help file to use as a referance.
so what do the bits of the c file do im not going to try to explain them but show how to get the info you need to get a flowchart made, the following abreviations are from the c code.
FCM =Macro
FCV =Variable
FCLV =Loop
so if you look at the code they tell us whats a macro , variable or loop, lets have a look at the code, find the section below

Code: Select all

//Macro function declarations
void F.FCM_duration();
void FCM_Sonar_Sense();
void FCM_Movement();
void FCM_RIGHT_SONAR();
void FCM_CENTER_SONAR();
void FCM_LEFT_SONAR();
void FCM_FIND_MOVE();
void FCM_X_CENTERING();
void FCM_GET_BALL();


//Variable declarations
char FCV_STATUS;
short FCV_HOLD_CMP;
char FCV_HEIGHT_SENSE;
char FCV_STAT;
short FCV_ECHO;
char FCV_IN;
short FCV_ECHO2;
char FCV_IN2;
short FCV_ECHO3;
char FCV_IN3;
char FCV_X_CENTERING;
char FCV_SERVO1_POS;
char FCV_BLOCKADE_SENSE;
char FCV_RIGHT_FINDER;
char FCV_TIMER;

char FCLV_LOOP1;
char FCLV_LOOP2;
char FCLV_LOOP3;
char FCLV_LOOP4;
char FCLV_LOOP5;

So we now know the names of the macros ,variables and loops, open flowcode and add the macros, from the menu bar select macro,new then add the macro name so FCM_GET_BALL(); will simply be GET_BALL save that macro and do the rest, we will add the icons to the macro later. do the same for the variables, now we can take a look at the contents of one of the macros, scroll and find FCM_duration(); we will look at a selection of it and apply it to the duration macro you saved earlier, open flowcode from the menu select macro import and select duration. im spliting the c into sections, im goint to comment on the first 8 then the rest is for you to sort out, the c for the macro is in order ie the first bit is an output:

Code: Select all

void FCM_duration()
{
   
   //Output
   //Output: 0 -> PORTB
   trisb = 0x00;
   portb = 0;


   //Comment:
   //DOWN JOINT

As you can see above, The output tells you what port and pin it needsand the value , so you would drag an output icon into flowcode set to port B pin 0, lets break it down;
Output: 0 -> PORTB (This tells us its an output on port B with a value of 0 )
trisb = 0x00;( this is bit tells the compiler to set port b pin 0 to an output ( we ignore this in our flowcode macro)
portb = 0; (This tells us the port and pin in this case port b pin 0)

Code: Select all


   //Call Component Macro
   //Call Component Macro: Servo(0)::EnableServo(0)
   FCD_Servo0_EnableServo(0);

Above is a component macro, so drag in a component macro double click it choose servo(0) and select enable servo


Code: Select all


   //Calculation
   //Calculation:
   //  servo1_Pos = 0
   FCV_SERVO1_POS = 0;

Above we can see its a calculation so drag a calculation box into our macro and enter this servo1_Pos = 0

Code: Select all

   //Loop
   //Loop: While servo1_pos = 160
   while (1)
   {

next drag in a loop ,double click it the tick test loop at end above that add the following
Servo1_pos = 160 look at the loop code above second line that tells us to add Servo1_pos = 160 into our loop (i will mention the test loop at end later

Code: Select all

      //Calculation
      //Calculation:
      //  servo1_Pos = servo1_Pos + 5
      FCV_SERVO1_POS = FCV_SERVO1_POS + 5;

Add a calculation icon inside the loop with the above parameters

Code: Select all


      //Call Component Macro
      //Call Component Macro: Servo(0)::SetPosition(0, servo1_Pos)
      FCD_Servo0_SetPosition(0, FCV_SERVO1_POS);

Drag a component macro in and add the above parameters(see below for how we can work it out
in the channel byte box add 0 we get that from Servo(0) above
in the set position byte box we add servo1_Pos that info comes from SetPosition(0, servo1_Pos) above

Code: Select all

      //Delay
      //Delay: 100 ms
      delay_ms(100);

Drag in a delay and set its time

Code: Select all

      if ((FCV_SERVO1_POS == 160) != 0) break;
   }

Remeber our test loop at end tick box thats from this is where it writes the loop exit code based on the parameter Servo1_pos = 160 that we added to the loop earlier

Code: Select all

   //Call Component Macro
   //Call Component Macro: Servo(0)::DisableServo(0)
   FCD_Servo0_DisableServo(0);

so add the above beneth the loop (you should be able to work out what to drag in now :)
and so on until you've coded all the macros, im shattered now so when you get the above sorted ask and i will do another post on other bits, keep looking at the print out of the c file and you will quickly pic up what you need and dont need to write a flowchart

Regards
Dazz
These users thanked the author dazz for the post:
medelec35 (Tue Jan 29, 2013 8:50 pm)
Rating: 5.26%
 
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

niel
Posts: 14
Joined: Mon Jan 28, 2013 6:24 pm
Contact:

Re: C Code to Flowcode

Postby niel » Wed Jan 30, 2013 4:28 am

Hi dazz,
thanks for the pointers you gave to me. i really appreciate it. from this, i might be able to make the flowcode program based on the c code. i really need to do this because in our subject Microprocessor Systems, we need to provide the flowcode and explain it to our professor. this is a great help, thanks a whole bunch! maybe if i have some more questions, i can ask you, is that okay? :)

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 514 times
Been thanked: 467 times
Contact:

Re: C Code to Flowcode

Postby dazz » Wed Jan 30, 2013 10:21 am

Hi Niel
When youve converted all the macros, post the flowchart, then i can give you some more pointers to do the main part of the chart
Regards

Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

niel
Posts: 14
Joined: Mon Jan 28, 2013 6:24 pm
Contact:

Re: C Code to Flowcode

Postby niel » Wed Jan 30, 2013 11:01 am

Hi dazz,
i'm currently working on it. maybe it will take some time because i have classes and i can only do it during nighttime. if i finished the flowchart, i'm gonna post it right away. thanks again.. :D

niel
Posts: 14
Joined: Mon Jan 28, 2013 6:24 pm
Contact:

Re: C Code to Flowcode

Postby niel » Wed Jan 30, 2013 11:33 am

//Loop
//Loop: Loop 20 times
for (FCLV_LOOP1=0; FCLV_LOOP1<20; FCLV_LOOP1++)
{
//Input
//Input: D7 -> height_sense
trisd = trisd | 0x80;
FCV_HEIGHT_SENSE = ((portd & 0x80) == 0x80);



Hi Dazz,

i just wanna ask how to do this. the (FCLV_LOOP1=0; FCLV_LOOP1<20; FCLV_LOOP1++), how will i represent this in flowcode? it's a bit confusing.

Niel

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: C Code to Flowcode

Postby Enamul » Wed Jan 30, 2013 11:53 am

Hi

Loops can be managed in FC in different ways; shown way is one of them..
Attachments
loop.png
loop.png (5.17 KiB) Viewed 21431 times
Enamul
University of Nottingham
enamul4mm@gmail.com

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 514 times
Been thanked: 467 times
Contact:

Re: C Code to Flowcode

Postby dazz » Wed Jan 30, 2013 11:56 am

Hi niel
If you look at that section of code it tells us that the loop must loop 20 times, (FCLV_LOOP1=0; FCLV_LOOP1<20; FCLV_LOOP1++) it says if loop is les than 20 loop again, so in flowcode you would drag in a loop go to the properties tick loop count and add 20 in the box,

//Loop
//Loop: Loop 20 times
for (FCLV_LOOP1=0; FCLV_LOOP1<20; FCLV_LOOP1++)

Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

niel
Posts: 14
Joined: Mon Jan 28, 2013 6:24 pm
Contact:

Re: C Code to Flowcode

Postby niel » Wed Jan 30, 2013 12:14 pm

Hi dazz, yes i know how to do that, the loop 20 times, but i am confused with the line "for (FCLV_LOOP1=0; FCLV_LOOP1<20; FCLV_LOOP1++)".. what does this mean? what am i going to do with this?

Hi enamul, thanks for that. is that the way i will express that term in flowcode?

niel
Posts: 14
Joined: Mon Jan 28, 2013 6:24 pm
Contact:

Re: C Code to Flowcode

Postby niel » Wed Jan 30, 2013 12:20 pm

and another question, how can i know if the loop will be testing at the end or at the start? is it always at the end? the c code doesn't tell whether it's at the start or end..

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: C Code to Flowcode

Postby Enamul » Wed Jan 30, 2013 12:25 pm

is that the way i will express that term in flowcode?
Yes, your loop is expressed in FC in that way.

and another question, how can i know if the loop will be testing at the end or at the start? is it always at the end? the c code doesn't tell whether it's at the start or end..
It actually depends on the c code...like for loop is always checked at start..while is always checked at start but do...while is checked at the end.
Enamul
University of Nottingham
enamul4mm@gmail.com

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 514 times
Been thanked: 467 times
Contact:

Re: C Code to Flowcode

Postby dazz » Wed Jan 30, 2013 1:13 pm

Hi niel
the code thats confusing you you dont do anything with that that bit is just the end of loop conditions, a little exercise create a new flowchart drag in a loop, then compile to c rename the c file empty loop, now change the properties in your flowchart to loop 20 times, compile to c rename the c file loop20 , then look at the file, do this several times with different parameters then look at the generated c files you will see the last line changes depending on the settings of the loop
so "for (FCLV_LOOP1=0; FCLV_LOOP1<20; FCLV_LOOP1++)" , means you have ticked the loop count and typed 20 in the box

have a look at my other post in this thread the exit condition for the loop was if ((FCV_SERVO1_POS == 160) != 0) break; remember in our first macro we ticked added the following into the loopo properties, tick loop until, tick end added SERVO_POS =160

Im off out for a few hours , if its still confusing i will add another post explaining a bit more
Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 514 times
Been thanked: 467 times
Contact:

Re: C Code to Flowcode

Postby dazz » Wed Jan 30, 2013 1:51 pm

Hi
i kow its a lot to take in but if you look at the images and cope below it should all become clear.
if you look at the image the stuff inside the circle can be detemined from the following code in the loop while if ((FCV_HEIGHT_SENSE == 20) == 0) break; if you look at the c code after the image you will notice the statement at the end, this tells us the loop is set as in the image
end.jpg
end.jpg (42.07 KiB) Viewed 21420 times

Code: Select all

//Loop
   //Loop: While height_sense = 20
   while (1)
   {

      //Input
      //Input: D7 -> height_sense
      trisd = trisd | 0x80;
      FCV_HEIGHT_SENSE = ((portd & 0x80) == 0x80);


      if ((FCV_HEIGHT_SENSE == 20) == 0) break;
   }

if you look at the image the stuff inside the circle can be detemined from the following code in the loop while if ((FCV_HEIGHT_SENSE == 20) == 0) break; if you look at the c code after the image you will notice the statement at the start of the loop code , this tells us the loop is set as in the image.
start.jpg
start.jpg (41.12 KiB) Viewed 21420 times

Code: Select all

   //Loop
   //Loop: While height_sense = 20
   while (FCV_HEIGHT_SENSE == 20)
   {

      //Input
      //Input: D7 -> height_sense
      trisd = trisd | 0x80;
      FCV_HEIGHT_SENSE = ((portd & 0x80) == 0x80);


   }



if you look at the image the stuff inside the circle can be detemined from the following code in the loop for (FCLV_LOOP1=0; FCLV_LOOP1<20; FCLV_LOOP1++) break; if you look at the c code after the image you will notice the statement at the start of the loop code , this tells us the loop is set as in the image. so you can see from the samples the code position and the way its written tells us that it loops 20 times then exits the loop
loop.jpg
loop.jpg (38.46 KiB) Viewed 21420 times

Code: Select all

//Loop
   //Loop: Loop 20 times
   for (FCLV_LOOP1=0; FCLV_LOOP1<20; FCLV_LOOP1++)
   {

      //Input
      //Input: D7 -> height_sense
      trisd = trisd | 0x80;
      FCV_HEIGHT_SENSE = ((portd & 0x80) == 0x80);


   }
These users thanked the author dazz for the post:
medelec35 (Thu Feb 14, 2013 11:00 am)
Rating: 5.26%
 
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

niel
Posts: 14
Joined: Mon Jan 28, 2013 6:24 pm
Contact:

Re: C Code to Flowcode

Postby niel » Wed Jan 30, 2013 3:53 pm

Hey dazz,
thanks so much, it's a great help to me. now i've understand how a loop at the start differs from a loop at the end.. thank you so much :D really,, :D

niel
Posts: 14
Joined: Mon Jan 28, 2013 6:24 pm
Contact:

Re: C Code to Flowcode

Postby niel » Wed Jan 30, 2013 5:38 pm

Hi dazz,
i'm almost done on my flowcode.. but there is a problem... i don't know how to apply these terms in flowcode.. here it is..
void main()
{

//Initialisation
adcon1 = 0x0F;
ucfg = 0x08;
cr_bit(pie2, USBIE);


#ifdef MX_MIAC_SYSTEM

#if (48 != MX_MIAC_MM_MIAC_BASE)

#define MOD_ID ((0 << 5) + 48) << 9

MIAC_CAN_TX[0] = MX_SERVO_PIN_ARRAY[0];
MIAC_CAN_TX[1] = MX_SERVO_PIN_ARRAY[1];
MIAC_CAN_TX[2] = MX_SERVO_PIN_ARRAY[2];
MIAC_CAN_TX[3] = MX_SERVO_PIN_ARRAY[3];
MIAC_CAN_TX[4] = MX_SERVO_PIN_ARRAY[4];
MIAC_CAN_TX[5] = MX_SERVO_PIN_ARRAY[5];
MIAC_Module_WR(MOD_ID, 640, 6,1,1);
MIAC_Module_GetAck(MOD_ID + 32, 640, 20);

MIAC_CAN_TX[0] = MX_SERVO_PIN_ARRAY[6];
MIAC_CAN_TX[1] = MX_SERVO_PIN_ARRAY[7];
MIAC_CAN_TX[2] = MX_SERVO_TRIM[0];
MIAC_CAN_TX[3] = MX_SERVO_TRIM[1];
MIAC_CAN_TX[4] = MX_SERVO_TRIM[2];
MIAC_CAN_TX[5] = MX_SERVO_TRIM[3];
MIAC_Module_WR(MOD_ID, 640, 6,0,1);
MIAC_Module_GetAck(MOD_ID + 32, 640, 20);

MIAC_CAN_TX[0] = MX_SERVO_TRIM[4];
MIAC_CAN_TX[1] = MX_SERVO_TRIM[5];
MIAC_CAN_TX[2] = MX_SERVO_TRIM[6];
MIAC_CAN_TX[3] = MX_SERVO_TRIM[7];
MIAC_CAN_TX[4] = MX_SERVO_NO_CHAN;
MIAC_Module_WR(MOD_ID, 640, 5,0,0);
MIAC_Module_GetAck(MOD_ID + 32, 640, 20);

#undef MOD_ID

#endif
#else
char temp;

ccpr1h = MX_SERVO_CCPR1H; //Set capture compare setpoint
ccpr1l = MX_SERVO_CCPR1L;
t1con = MX_SERVO_T1CON; //Setup timer and start running
ccp1con = MX_SERVO_CCP1CON; //Configure CCP1 settings
st_bit(pie1, CCP1IE); //Enable CCP1 interrupt
ccp2con = MX_SERVO_CCP2CON; //Configure CCP2 settings
st_bit(pie2, CCP2IE); //Enable CCP2 interrupt
st_bit(intcon, PEIE); //Enable Interrupts
st_bit(intcon, GIE);

for (temp = 0; temp < MX_SERVO_NO_CHAN; temp++)
{
FCD_Servo0_ToggleTris(MX_SERVO_PORT_ARRAY[temp], MX_SERVO_PIN_ARRAY[temp], 1); //Convert Servo pin to input to disable motor
}
#endif


//Interrupt initialisation code



//Calculation
//Calculation:
// timer = 0
// status = 0
FCV_TIMER = 0;
FCV_STATUS = 0;


//Call Component Macro
//Call Component Macro: Servo(0)::EnableServo(1)
FCD_Servo0_EnableServo(1);


//Call Component Macro
//Call Component Macro: Servo(0)::SetPosition(1, 235)
FCD_Servo0_SetPosition(1, 235);


//Call Component Macro
//Call Component Macro: Servo(0)::EnableServo(0)
FCD_Servo0_EnableServo(0);


//Call Component Macro
//Call Component Macro: Servo(0)::SetPosition(0, 0)
FCD_Servo0_SetPosition(0, 0);


//Call Macro
//Call Macro: Sonar_Sense
FCM_Sonar_Sense();


mainendloop: goto mainendloop;
}

void MX_INTERRUPT_MACRO(void)
{

#ifndef MX_MIAC_SYSTEM
if (ts_bit(pir1, CCP1IF) && ts_bit(pie1, CCP1IE))
{
if (MX_SERVO_IDX < MX_SERVO_NO_CHAN)
{
FCD_Servo0_TogglePort(MX_SERVO_PORT_ARRAY[MX_SERVO_IDX], MX_SERVO_PIN_ARRAY[MX_SERVO_IDX], 1); //Start Servo duty cycle

MX_SERVO_CALC = MX_SERVO_TRIM[MX_SERVO_IDX] + MX_SERVO_POSITION[MX_SERVO_IDX]; //Calculate the required position
MX_SERVO_CALC = MX_SERVO_CALC * MX_SERVO_CLK_COUNT; //Calculate the number of clock cycles required
MX_SERVO_CALC = (MX_SERVO_CALC >> 8) & 0xFFFF; //Shift back to be 16-bit

ccpr2h = ( MX_SERVO_CALC >> 8 ); //Setup capture compare registers
ccpr2l = ( MX_SERVO_CALC & 0xFF );
}
cr_bit(pir1, CCP1IF); //Clear interrupt
}


if (ts_bit(pir2, CCP2IF) && ts_bit(pie2, CCP2IE))
{
if (MX_SERVO_IDX < MX_SERVO_NO_CHAN) //If channel is active
{
FCD_Servo0_TogglePort(MX_SERVO_PORT_ARRAY[MX_SERVO_IDX], MX_SERVO_PIN_ARRAY[MX_SERVO_IDX],0); //End of control pulse
}
MX_SERVO_IDX = (MX_SERVO_IDX + 1) & 0x07; //Increment channel

if (MX_SERVO_REQUIRED[MX_SERVO_IDX] > MX_SERVO_POSITION[MX_SERVO_IDX])
MX_SERVO_POSITION[MX_SERVO_IDX] = MX_SERVO_POSITION[MX_SERVO_IDX] + 1; //Increment duty

if (MX_SERVO_REQUIRED[MX_SERVO_IDX] < MX_SERVO_POSITION[MX_SERVO_IDX])
MX_SERVO_POSITION[MX_SERVO_IDX] = MX_SERVO_POSITION[MX_SERVO_IDX] - 1; //Decrement duty

cr_bit(pir2, CCP2IF); //Clear interrupt
}
#endif


}


what am i going to do with these codes? how am i suppose to start? i am not familiar with them...

niel
Posts: 14
Joined: Mon Jan 28, 2013 6:24 pm
Contact:

Re: C Code to Flowcode

Postby niel » Wed Jan 30, 2013 6:45 pm

hi dazz,
here is the fcf file that i made out of the c code. will you check it please? i think there are some mistakes there. i can't understand the codes at the end that's why i have a hard time making the main body of the program.. i'll wait for your reply.... :) thanks...
Attachments
ball collector.fcf
(31.29 KiB) Downloaded 576 times

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 514 times
Been thanked: 467 times
Contact:

Re: C Code to Flowcode

Postby dazz » Wed Jan 30, 2013 7:26 pm

Hi niel

Give me a day or so as im very busy just now, if i can lok at it before thewn i will post here

Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 514 times
Been thanked: 467 times
Contact:

Re: C Code to Flowcode

Postby dazz » Thu Jan 31, 2013 12:46 pm

Hi niel
just managed to go through your chart, There are a few errors , i would convert your flowchart to c and compare it against the original, concentrate on the macros, one thing to note is with loops if the code is expressed as below, it means loop until

Code: Select all

if ((FCV_IN == 1) != 0) break;


whereas the code below meas loop while

Code: Select all

if ((FCV_IN == 1)= 0) break;


your about 90% done, when you've gone through it can you post the c file from your flowchart
Regards
Dazz
These users thanked the author dazz for the post:
medelec35 (Thu Feb 14, 2013 11:01 am)
Rating: 5.26%
 
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

niel
Posts: 14
Joined: Mon Jan 28, 2013 6:24 pm
Contact:

Re: C Code to Flowcode

Postby niel » Fri Feb 01, 2013 7:30 am

hey dazz,
thanks for analyzing my flowchart.. i will work on the things you've said, but not for now because i also have so many things to do. when i finished it, i'm going to post it here. thanks so much! 8)