Variable values in simulation

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
andyduell
Posts: 17
Joined: Mon Feb 25, 2013 8:52 am
Contact:

Variable values in simulation

Post by andyduell »

When I simulate a downloaded programme without any changes I get values for variables. What I don't understand is if I then close that programme and then start again I get different values. Is there some random number generator built into the simulator?

User avatar
DavidA
Matrix Staff
Posts: 1076
Joined: Fri Apr 23, 2010 2:18 pm
Location: Matrix Multimedia Ltd
Has thanked: 58 times
Been thanked: 258 times
Contact:

Re: Variable values in simulation

Post by DavidA »

Hello,

Im not quite sure i fully understand your issue but... I would imagine it would depend on what your program is doing, there is a random number generator in Flowcode but it should be only used when called. Uninitialized variables should default to zero. If you can post a fcf exhibiting this behavior that would be easier.

andyduell
Posts: 17
Joined: Mon Feb 25, 2013 8:52 am
Contact:

Re: Variable values in simulation

Post by andyduell »

In another post I am asking for help with One Wire programming. A reply from "jgu1" Jorgen included an attached file and I have uploaded below Jorgen's original copy.

When I run the simulation I get a value in RetVal at the decision diamond which I then edit to 0 to stop the program branching to "No device Found".

I do the same at the next decision diamond, edit RetVal to 0 to stop getting a "CRC Error" and then I get values for the other three variables.

I then close the program without saving and start again but all the variables have different values. I had assumed that I would have to enter values for the variables for the simultaion to work. Can you tell me what is happening please?
Attachments
1. Single OneWire_DS18B20_886_Virker.fcf
(15.5 KiB) Downloaded 246 times

User avatar
DavidA
Matrix Staff
Posts: 1076
Joined: Fri Apr 23, 2010 2:18 pm
Location: Matrix Multimedia Ltd
Has thanked: 58 times
Been thanked: 258 times
Contact:

Re: Variable values in simulation

Post by DavidA »

Hello Andy,

The One Wire is a component that does not simulate, and as such the VB which deals with our components will return random values. Something like the One Wire component should be checked in hardware.

andyduell
Posts: 17
Joined: Mon Feb 25, 2013 8:52 am
Contact:

Re: Variable values in simulation

Post by andyduell »

Hi David,
Thanks for clearing that up at least I now know that I don't have a problem with the Flowcode program and it is working normally.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Variable values in simulation

Post by jgu1 »

Hi again!

Ok now I understand, I thought it was when you tested on the hardware. There I am sure it works :D

Good luck

Jorgen.

andyduell
Posts: 17
Joined: Mon Feb 25, 2013 8:52 am
Contact:

Re: Variable values in simulation

Post by andyduell »

Hi Jorgen,

I do have a problem with the hardware, I still haven't got it working, but then I haven't spent much time on it yet. From my exeprience of computers over 40 years I have learned to test everything possible, which is why I started this post to make sure that my software was working as it should. That then eliminates a possible area of doubt and I can concentrate on the programming. Thanks for your interest.
Andy

Post Reply