Variable values in simulation
Moderator: Benj
Variable values in simulation
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?
- 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
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.
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
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?
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
- 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
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.
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
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.
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.
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: Variable values in simulation
Hi again!
Ok now I understand, I thought it was when you tested on the hardware. There I am sure it works
Good luck
Jorgen.
Ok now I understand, I thought it was when you tested on the hardware. There I am sure it works
![Very Happy :D](./images/smilies/icon_biggrin.gif)
Good luck
Jorgen.
Re: Variable values in simulation
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
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