Page 1 of 1

Variable values in simulation

Posted: Wed Jun 12, 2013 7:09 am
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?

Re: Variable values in simulation

Posted: Wed Jun 12, 2013 9:15 am
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.

Re: Variable values in simulation

Posted: Wed Jun 12, 2013 10:18 pm
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?

Re: Variable values in simulation

Posted: Thu Jun 13, 2013 9:08 am
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.

Re: Variable values in simulation

Posted: Thu Jun 13, 2013 7:10 pm
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.

Re: Variable values in simulation

Posted: Fri Jun 14, 2013 11:26 am
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.

Re: Variable values in simulation

Posted: Sun Jun 16, 2013 7:31 am
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