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

User avatar
Crenwick
Posts: 127
Joined: Sun Aug 07, 2011 1:40 pm
Location: Belgium
Has thanked: 7 times
Been thanked: 21 times
Contact:

A little bug in V5

Postby Crenwick » Wed Jan 18, 2012 2:43 pm

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 113 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
Has thanked: 190 times
Been thanked: 140 times
Contact:

Re: A little bug in V5

Postby petesmart » Wed Jan 18, 2012 2:52 pm

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
Has thanked: 7 times
Been thanked: 21 times
Contact:

Re: A little bug in V5

Postby Crenwick » Wed Jan 18, 2012 2:59 pm

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: 14567
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4598 times
Been thanked: 4239 times
Contact:

Re: A little bug in V5

Postby Benj » Wed Jan 18, 2012 6:03 pm

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
Has thanked: 7 times
Been thanked: 21 times
Contact:

Re: A little bug in V5

Postby Crenwick » Wed Jan 18, 2012 6:16 pm

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: 262
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 115 times
Been thanked: 112 times
Contact:

Re: A little bug in V5

Postby STibor » Thu Jan 19, 2012 5:47 am

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 129 times

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 64 times
Been thanked: 306 times
Contact:

Re: A little bug in V5

Postby JonnyW » Thu Jan 19, 2012 12:03 pm

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
These users thanked the author JonnyW for the post (total 2):
STibor (Thu Jan 19, 2012 6:58 pm) • brandonb (Thu Mar 29, 2012 6:16 am)
Rating: 10.53%
 

User avatar
Benj
Matrix Staff
Posts: 14567
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4598 times
Been thanked: 4239 times
Contact:

Re: A little bug in V5

Postby Benj » Thu Jan 19, 2012 1:16 pm

The NumberToHex function will also work with Long variable types to give you a hexadecimal string you can send to the LCD.
These users thanked the author Benj for the post:
STibor (Thu Jan 19, 2012 6:58 pm)
Rating: 5.26%
 

User avatar
STibor
Posts: 262
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 115 times
Been thanked: 112 times
Contact:

Re: A little bug in V5

Postby STibor » Sun Jan 22, 2012 10:43 am

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

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8536
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2456 times
Been thanked: 3525 times
Contact:

Re: A little bug in V5

Postby medelec35 » Sun Jan 22, 2012 12:40 pm

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
These users thanked the author medelec35 for the post:
STibor (Sun Jan 22, 2012 7:29 pm)
Rating: 5.26%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
STibor
Posts: 262
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 115 times
Been thanked: 112 times
Contact:

Re: A little bug in V5

Postby STibor » Sun Jan 22, 2012 7:32 pm

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 63 times

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8536
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2456 times
Been thanked: 3525 times
Contact:

Re: A little bug in V5

Postby medelec35 » Sun Jan 22, 2012 7:37 pm

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

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 64 times
Been thanked: 306 times
Contact:

Re: A little bug in V5

Postby JonnyW » Sun Jan 22, 2012 10:39 pm

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: 3090
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 89 times
Been thanked: 391 times
Contact:

Re: A little bug in V5

Postby Steve » Mon Jan 23, 2012 9:38 am

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: 262
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 115 times
Been thanked: 112 times
Contact:

Re: A little bug in V5

Postby STibor » Tue Jan 24, 2012 7:39 pm

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.