A little bug in V5

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
User avatar
Crenwick
Posts: 127
Joined: Sun Aug 07, 2011 1:40 pm
Location: Belgium
Contact:

A little bug in V5

Post 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 :wink: )

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 ? :wink:

And how can I change the version of Flowcode in my signature ?

Sorry for all the questions :oops:

Bernard
Attachments
Eeprom test.fcf
(6 KiB) Downloaded 145 times
Last edited by Crenwick on Wed Jan 18, 2012 3:01 pm, edited 1 time in total.
Bernard

Flowcode 6 / EB006-V9

User avatar
petesmart
Valued Contributor
Valued Contributor
Posts: 395
Joined: Thu May 06, 2010 11:42 am
Location: Sydney, Australia
Contact:

Re: A little bug in V5

Post 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
sorry about that Chief!

User avatar
Crenwick
Posts: 127
Joined: Sun Aug 07, 2011 1:40 pm
Location: Belgium
Contact:

Re: A little bug in V5

Post 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 :wink:

Bernard
Bernard

Flowcode 6 / EB006-V9

User avatar
Benj
Matrix Staff
Posts: 14929
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: A little bug in V5

Post 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.

User avatar
Crenwick
Posts: 127
Joined: Sun Aug 07, 2011 1:40 pm
Location: Belgium
Contact:

Re: A little bug in V5

Post 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 :wink:

Regards,

Bernard
Bernard

Flowcode 6 / EB006-V9

User avatar
STibor
Posts: 263
Joined: Fri Dec 16, 2011 3:20 pm
Contact:

Re: A little bug in V5

Post 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?
Attachments
counter.fcf
(9 KiB) Downloaded 157 times

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Contact:

Re: A little bug in V5

Post 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

User avatar
Benj
Matrix Staff
Posts: 14929
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: A little bug in V5

Post by Benj »

The NumberToHex function will also work with Long variable types to give you a hexadecimal string you can send to the LCD.

User avatar
STibor
Posts: 263
Joined: Fri Dec 16, 2011 3:20 pm
Contact:

Re: A little bug in V5

Post by STibor »

Decision errors when testing two variables.
a = 1 AND b = 64 then c = 4
Attachments
decision.fcf
(10 KiB) Downloaded 97 times

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 9010
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Contact:

Re: A little bug in V5

Post 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
Martin

User avatar
STibor
Posts: 263
Joined: Fri Dec 16, 2011 3:20 pm
Contact:

Re: A little bug in V5

Post 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.
Attachments
decision Flowcode 45.fcf
Flowcode 4.5
(4.5 KiB) Downloaded 77 times

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 9010
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Contact:

Re: A little bug in V5

Post 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
Martin

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Contact:

Re: A little bug in V5

Post 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

User avatar
Steve
Matrix Staff
Posts: 3193
Joined: Tue Jan 03, 2006 3:59 pm
Contact:

Re: A little bug in V5

Post 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:

Code: Select all

(a = 1) && (b = 64)

User avatar
STibor
Posts: 263
Joined: Fri Dec 16, 2011 3:20 pm
Contact:

Re: A little bug in V5

Post 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.

Post Reply