ICD Mode part 2

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
saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times

ICD Mode part 2

Post by saschech@gmx.de »

Hello Benj,Steve

If i work in a user-macro with lokale variable,compile to chip , run simulation,
all work`s ok ; but ....(Benj wrote: I see that the global variables in the watch window remain correctly but local variables are removed from the window)

If i compile to chip in ICD-Mode ther are 2 point`s i have problem:

1. The variable test "dont work correct"
2. In the user-makro lok_var there are not lokal variable show in the "variable manager"

Regards Wolfgang

the same with 16F88
Attachments
lokale variable.gif
(51.64 KiB) Downloaded 2968 times
lok_var.fcf
(6 KiB) Downloaded 259 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: ICD Mode part 2

Post by Benj »

Hello Wolfgang

Always bear the following in mind when working with microcontrollers.

On a reset variables will always start in a unknown state.

Any variables you read in your program before you write to them should be initialised.

Eg. count = count + 1 will read the count variable before assigning the new value of +1 to the variable. Therefore the variable count must be initialised by setting count = 0.

Another common mistake is to use a while loop eg while count < 15. The count variable could start at a value greater then 15 and you while loop may never get run, let alone the correct number of times.

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times

Re: ICD Mode part 2

Post by saschech@gmx.de »

Hello Benj

I do set in "haupt" test to 0!
In my user macro ,i set the lok_var.lokvar to 11.
then lok_var.lokvar02 = lok_var.lokvar01
then the "locale variable" lok_var.test = lok_var.lokvar02 (= 11)

Why the globale Variable test dont work and have 11?

Why i dont show local variable in the variable manager in the ICD mode?
I think jou dont read my question precisely!
I have spend a lot of money (over 200 euro) and expect a produkt,what works correct!
Last edited by saschech@gmx.de on Tue Sep 22, 2009 1:14 pm, edited 3 times in total.

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: ICD Mode part 2

Post by Benj »

Hello Wolfgang

Sorry sometimes it is a bit hard to understand what the problem is.

The local variable should be available to add to the watch window while you are inside the macro. When you leave the macro the variable will dissapear from the watch window and will not return until you add it again.

Maybe we could allow this variable to reappear when you are back inside the macro so you dont have to keep adding it to your watch window. I will add it onto our system as a suggestion.

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times

Re: ICD Mode part 2

Post by saschech@gmx.de »

Hallo Benj
I give you 1 v4 example file!

My problem is , i dont show the (locale Variable) show the screenshot

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

Re: ICD Mode part 2

Post by Steve »

At the moment, local variables cannot be viewed in the "watch window" in ICD mode. If you need to see what is going on, please use a global variable.

As a workaround, you could add a general "watch" global variable which you set to the value of the local variable in your routine. This is not ideal, but should allow you to see the values you want to.

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times

Re: ICD Mode part 2

Post by saschech@gmx.de »

Hello Steve

Thank you for the answer , i understand it,woks well!

Regards Wolfgang

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times

Re: ICD Mode part 2

Post by saschech@gmx.de »

Hello Steve

Why the "globale Variable > test" dont work in ICD-mode , if i use in my user-macro the "lokale > Variable lok_var.test" ????????

Regards Wolfgang

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

Re: ICD Mode part 2

Post by Steve »

You will need a calculation icon ("test = my_macro.my_var") which will set the global "test" variable to the current value of the local "my_var" variable. Once this icon has been run in ICD mode, the value of "test" will be set appropriately.

You can also reverse this by having "my_macro.my_var = test", which will allow you to set the local variable via ICD mode. To do this, you would need to set the value of "test" BEFORE this icon is exectuted.

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times

Re: ICD Mode part 2

Post by saschech@gmx.de »

Hello Steve

I want set in my code the Globale variable test to 0 , bat the variable dont schange to 0 he remain by 11!

I put in test = 0 second bat he hold the 11 alltime in ICD-mode.

Regards Wolfgang
Attachments
Haupt.gif
(52.71 KiB) Downloaded 2810 times
test = 0.gif
test = 0.gif (30.01 KiB) Viewed 9424 times

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times

Re: ICD Mode part 2

Post by saschech@gmx.de »

Hello Steve

If i rename the "lokale variable to lok_var.test_1" it works.

I cannot have the thame names like: global >> test ...... lokal >> lok_var.test ????

Regards Wolfgang
Last edited by saschech@gmx.de on Tue Sep 22, 2009 2:36 pm, edited 1 time in total.

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

Re: ICD Mode part 2

Post by Steve »

That seems strange! Can you please send me your FCF file and I will look into this.

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times

Re: ICD Mode part 2

Post by saschech@gmx.de »

Hello Steve

Here the both files .Last use in ICD-mode(ICD is select).

Regards Wolfgang
Attachments
lok_var_test_1.fcf
(7 KiB) Downloaded 263 times
lok_var_test.fcf
(7 KiB) Downloaded 262 times

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

Re: ICD Mode part 2

Post by Steve »

Sorry, Wolfgang - I've run out of time today. I'll look into this issue tomorrow.

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

Re: ICD Mode part 2

Post by Steve »

Yes - I now see the cause of the problem. This will be fixed in release v4.2 of Flowcode.

The workaround for now is to ensure that the local variables have a different name to the global variables.

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times

Re: ICD Mode part 2

Post by saschech@gmx.de »

Hallo Steve

Thank you for answer, du you have a timeline for 4.2 with all fix?

Regards Wolfgang

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

Re: ICD Mode part 2

Post by Steve »

No set deadline. Perhaps a few weeks, but certainly no mor than 4 weeks.

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times

Re: ICD Mode part 2

Post by saschech@gmx.de »

Hello Steve
Thank`s again , please jou have a look to my problem with display and PA (post ICD-Mode part1) ; i cannot work with v4 my projekt , if it is not fix

Regards Wolfgang

Post Reply