Page 1 of 1
A little bug in V5
Posted: Wed Jan 18, 2012 2:43 pm
by Crenwick
Hello,
I'm working today for the first time on V5 with a new project and are facing a little bug (maybe the first

)
When I try to write to Eeprom the result is allways 0. When I try the same prog on V4 it's ok so ...
I attached a little demo.
My project is an automatic phonedialer for my alarm system and I need to store my cell number in Eeprom
Can you please check ?
Is it also possible to create a V5 folder on the forum ?
And how can I change the version of Flowcode in my signature ?
Sorry for all the questions
Bernard
Re: A little bug in V5
Posted: Wed Jan 18, 2012 2:52 pm
by petesmart
Hi,
I understand that you do not have the issue with V4, however on certain chips under circumstances that I have yet to fully identify, I have had reliability issues with writing to location 0 on the physical chip. Simulation works fine, however to ensure repeatable success on the hardware I have adopted a practice of starting from address location 1 skipping address location 0.
Not sure if this helps, however it might be worth a try.
All the best
Pete
Re: A little bug in V5
Posted: Wed Jan 18, 2012 2:59 pm
by Crenwick
Hi,
Well I tryed on two different chips on the ten first positions and wathever I try to write it's allways 0.
Sorry for Matrix Staff to give you extra work
Bernard
Re: A little bug in V5
Posted: Wed Jan 18, 2012 6:03 pm
by Benj
Hello,
I can confirm that this is a simulation only bug and that the code is working as expected on the hardware. At least for the 16F88 device which I have just tested.
Re: A little bug in V5
Posted: Wed Jan 18, 2012 6:16 pm
by Crenwick
Thanks Ben,
By the end of the week I will be ready with my PCB.
You all at Matrix have done a big job
Regards,
Bernard
Re: A little bug in V5
Posted: Thu Jan 19, 2012 5:47 am
by STibor
Hello!
I would like to write a lcd screen UINT, ULONG, and Long variables.
I see the V5 Flowcode LCD screen print numbers are manageable variables<= Int. A later improvement in the macro lcd?
Re: A little bug in V5
Posted: Thu Jan 19, 2012 12:03 pm
by JonnyW
Hello.
I would like to write a lcd screen UINT, ULONG, and Long variables.
You can write signed long integers to a string using the ToString$(variable) function. You can then write this string to the LCD.
Create a calculation and type:
buffer = ToString$(variable)
Where buffer is a string and variable is a long or UINT.
You can then display 'buffer' on the LCD.
Jonny
Re: A little bug in V5
Posted: Thu Jan 19, 2012 1:16 pm
by Benj
The NumberToHex function will also work with Long variable types to give you a hexadecimal string you can send to the LCD.
Re: A little bug in V5
Posted: Sun Jan 22, 2012 10:43 am
by STibor
Decision errors when testing two variables.
a = 1 AND b = 64 then c = 4
Re: A little bug in V5
Posted: Sun Jan 22, 2012 12:40 pm
by medelec35
Hi STibor
When using multiple conditions and using 'AND' you will need to use brackets.
Try either
(a = 1) AND (b = 64)
or
you should be able to use a = 1 && b = 64
since though discussions with MM staff it is generally accepted that AND should be use for bitwise only.
Whereas && should be used for bytewise operations.
I would recommend
(a = 1) && (b = 64) as the correct format so I don't believe its a bug
Martin
Edit after testing I have come to the conclusion that:
(a = 1) AND (b = 64) = bytewise operation
and
a = 1 AND b = 64 is bitwise that's why it does not work!
But
a = 1 AND b = 1 will work since either value is not >1
Re: A little bug in V5
Posted: Sun Jan 22, 2012 7:32 pm
by STibor
Thank you for your response.
I wrote Flowcode4.5 program continue in Flowcode5 .
Flowcode5 was only a simulation of a faulty, coded program is good.
Re: A little bug in V5
Posted: Sun Jan 22, 2012 7:37 pm
by medelec35
STibor wrote:
Flowcode5 was only a simulation of a faulty, coded program is good.
Ah, so a = 1 AND b = 64 works on hardware and not simulation.
So it is a simulation bug, but work round is easy.
I would not have niticed that since if multiple statements I enclose with brackets.
Thanks for that information
Martin
Re: A little bug in V5
Posted: Sun Jan 22, 2012 10:39 pm
by JonnyW
Yes. The Flowcode simulation works on a grammar which defines which order to eveluate the operators in, like the C compiler. I thought I had all the operators in the same order as C but maybe not for AND. I'll check this on Monday. As you say, the workaround is easy, but I hope this does not effect too many legacy programs.
Jonny
Re: A little bug in V5
Posted: Mon Jan 23, 2012 9:38 am
by Steve
If the intention of your code is to check that the value of a is 1 and the value of b is 64, then I recommend you use the "logical" operator "&&" as suggested by Martin. Also, using brackets will help make the code's intention more obvious:
Re: A little bug in V5
Posted: Tue Jan 24, 2012 7:39 pm
by STibor
Thank you all for your help!
There will be an example-program package to Flowcode5?
Eeprom->Storing and retrieving Long(ULong) variables.
New adc functions. etc.