03-10-2016 09:22 AM
Hello,
I've met problem while debugging: some nets don't display theirs values.
The conditional breakepoint is set on "1" (blue circle)
Actual executing module - comparator (red circle).
As you can state, probes "3" and "4" don'st display net values, whereas "6" does (being placed after "3" and "4").
Where is a problem.
Thanks in advance.
Pavel
Solved! Go to Solution.
03-10-2016 09:30 AM - edited 03-10-2016 09:32 AM
I agree it does look like an odd problem, but you've made it very hard on yourself because you have all those wires running across your diagram! A good way to compact them is to create type def clusters of your state data. This will allow you to unbundle and bundle only the data you need in each part of your state machine.
To create a type def cluster, you can either create a new control and use the dropdown menu to make a type def (or strict type def if it is a front panel element that you always want to look the same). The type def allows you to change something (the name of a piece of data, or add or delete pieces) and it will be updated all over your program automatically. Another way is to create a cluster constant on the block diagram. Add some stuff to it (boolean constant, numeric constant, etc) and then Right Click >> Make Type Def. You can then open type def, or it will ask you to save it when you save your project.
Edit: Also, how come you have a separate boolean indicator for each possible case that could be running? It might be better to have a single status indicator that tells you what the loop is doing.
03-10-2016 09:45 AM
Please tell me that someone else put that bit of code in your case structure and not you.
03-10-2016 09:53 AM
In LabView, there's no guarantee of the order of execution in a multiply-parallel situation like this. What is probably happening is that the breakpoint is being hit before the code actually executes the bits where you have the probes. You have to keep stepping through it manually until it gets to those points.
03-10-2016 09:57 AM - edited 03-10-2016 09:58 AM
But order of execution does mean that the values at 3 and 4 had to occur before the value shown in probe 6 has been calculated.
Now if this is a case where the breakpoint happened, then the probes were placed on the wire, or you are placing probes with highlight execution turned on, then it is possible for 3 and 4 to not show a value. If wires 3 and 4 already executed by the time their probes were placed, and wire 6 had not by the time its probe was placed, then you could have a probe value at 6 and not 3 and 4.
Probes only show values that have occurred when the wire executes after the placing of the probe. It won't show anything that occurred before the probe was dropped.
It's not obvious from the attached pictures or the message as to what state of execution the code is in.
03-10-2016 10:36 AM
RavensFan a écrit :But order of execution does mean that the values at 3 and 4 had to occur before the value shown in probe 6 has been calculated.
Now if this is a case where the breakpoint happened, then the probes were placed on the wire, or you are placing probes with highlight execution turned on, then it is possible for 3 and 4 to not show a value. If wires 3 and 4 already executed by the time their probes were placed, and wire 6 had not by the time its probe was placed, then you could have a probe value at 6 and not 3 and 4.
Probes only show values that have occurred when the wire executes after the placing of the probe. It won't show anything that occurred before the probe was dropped.
It's not obvious from the attached pictures or the message as to what state of execution the code is in.
Hello RavensFan,
It was exactly the case - values were not highlighted and I added probes after VI execution stopped on breakpoint.
Thanks.
P.S. However I didn't understand what did you mean under "Please tell me that someone else put that bit of code in your case structure and not you."
03-10-2016 10:41 AM
Hi Pavel,
There is a Select node where True selects a value of True, and False selects a value of False. The term Rube Goldberg has come to mean doing something in an overly complicated way, and in this case the Select node does nothing but complicate the code.
03-10-2016 11:19 AM
@Pavel_47 wrote:Hello RavensFan,
It was exactly the case - values were not highlighted and I added probes after VI execution stopped on breakpoint.
Thanks.
P.S. However I didn't understand what did you mean under "Please tell me that someone else put that bit of code in your case structure and not you."
I'm glad that helped.
Click on the link I posted. It links to one of the very first messages in that thread. Then go ahead and read through the entire thread. It'll help you become a better programmer.