Page 1 of 1
ICD Mode part 2
Posted: Sat Sep 19, 2009 5:20 pm
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
Re: ICD Mode part 2
Posted: Mon Sep 21, 2009 2:39 pm
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.
Re: ICD Mode part 2
Posted: Mon Sep 21, 2009 2:54 pm
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!
Re: ICD Mode part 2
Posted: Mon Sep 21, 2009 3:11 pm
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.
Re: ICD Mode part 2
Posted: Mon Sep 21, 2009 3:20 pm
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
Re: ICD Mode part 2
Posted: Tue Sep 22, 2009 7:31 am
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.
Re: ICD Mode part 2
Posted: Tue Sep 22, 2009 8:51 am
by saschech@gmx.de
Hello Steve
Thank you for the answer , i understand it,woks well!
Regards Wolfgang
Re: ICD Mode part 2
Posted: Tue Sep 22, 2009 11:49 am
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
Re: ICD Mode part 2
Posted: Tue Sep 22, 2009 12:36 pm
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.
Re: ICD Mode part 2
Posted: Tue Sep 22, 2009 1:12 pm
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
Re: ICD Mode part 2
Posted: Tue Sep 22, 2009 1:43 pm
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
Re: ICD Mode part 2
Posted: Tue Sep 22, 2009 1:47 pm
by Steve
That seems strange! Can you please send me your FCF file and I will look into this.
Re: ICD Mode part 2
Posted: Tue Sep 22, 2009 2:34 pm
by saschech@gmx.de
Hello Steve
Here the both files .Last use in ICD-mode(ICD is select).
Regards Wolfgang
Re: ICD Mode part 2
Posted: Tue Sep 22, 2009 3:43 pm
by Steve
Sorry, Wolfgang - I've run out of time today. I'll look into this issue tomorrow.
Re: ICD Mode part 2
Posted: Wed Sep 23, 2009 9:26 am
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.
Re: ICD Mode part 2
Posted: Wed Sep 23, 2009 9:46 am
by saschech@gmx.de
Hallo Steve
Thank you for answer, du you have a timeline for 4.2 with all fix?
Regards Wolfgang
Re: ICD Mode part 2
Posted: Wed Sep 23, 2009 10:00 am
by Steve
No set deadline. Perhaps a few weeks, but certainly no mor than 4 weeks.
Re: ICD Mode part 2
Posted: Wed Sep 23, 2009 10:25 am
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