LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI crashes when completing boolean logic

Hi guys,

 

I'm an amatuer trying to do some basic parallel port control through labview. I've designed this big state machine, but whenever I complete the logic Labview will crash upon saving or running the vi.

 

I've attached the broken vi. Go to the top right of the block diagram and connect the open OR gate to something. Even a true constant causes a crash. Is the logic simply too big and bloated to handle? What can I do to fix it? Is a while loop+feedback nodes for registers the correct way to implement digital logic?

 

Sorry if this seems silly. I only just started using labview.

0 Kudos
Message 1 of 11
(4,643 Views)

Yes, I see the crash in LabVIEW 2010 SP1. I guess NI needs to investigate.

 


@Seiko809 wrote:

 Even a true constant causes a crash. Is the logic simply too big and bloated to handle?


No, there are projects out there that have 1000x more code.

0 Kudos
Message 2 of 11
(4,637 Views)

Seiko809 wrote:

Is a while loop+feedback nodes for registers the correct way to implement digital logic?


There is no way to really the what your logic is supposed to do. Can you explain the detials of the algorithm?

 

A lot of your code is overly complicated. For example the "number to boolean array" needs only one instance. You are doing the same calculation 4 times in parallel. Also "index array" is resizeable.

Message 3 of 11
(4,635 Views)

The copy I downloaded shows seven feedback nodes which are not wired.

 

Is In Port.vi compatible with the OS version you are using?  Try removing it or using Diagram Disable to see if that is where the problem is.

 

When I disable InPort.vi and wire all the feedback nodes to something, it does not crash.

 

As altenbach said, you need to tell us what this is intended to do.

 

Lynn

Message 4 of 11
(4,626 Views)

Thank you both for the quick response. "johnsold" seems to be correct. After wiring all nodes, there is no problem. Thank you so much! And I'll get to tidying the diagram up like altenbach suggested.

 

I went ahead and completed the diagram. The result is a controller that uses 4 status pins on the port as "buttons". Pressing the correct combination activates a small motor that turns a latch (like a lock). It's just something I was fooling around with to learn more about this stuff.

 

Again, I really appreciate the help. I'll stick around to see if I can learn more about Labview here.

0 Kudos
Message 5 of 11
(4,620 Views)

Here is how it looks after I cleaned it up a bit.  I deleted the feedback nodes which were not connected to anything. I disabled the In Port.vi because it is not available on my platform.  I replaced the feedback nodes with shift registers, not because there is any problem with them, just that I am more comfortable with shift registers. I also simplified the number to boolean array to individual booleans after altenbach's suggestion.  There are probably additional changes which might simplify things further.

 

Lynn

 

Keyboard logic.2.png

0 Kudos
Message 6 of 11
(4,615 Views)

Lynn, now there is an image that really needs to be shown with dots on the wire intersections.  Without those dots and all of those crossing wires, it is impossible to tell what is connected and what is just crossing.  Smiley Wink

0 Kudos
Message 7 of 11
(4,613 Views)

Normally I dislike the dots, but in this case you may be right.

 

The dotted boolean wires are especially prone to being hard to identify junctions.

 

Lynn

 

Keypad logic with dots.png

0 Kudos
Message 8 of 11
(4,594 Views)

@Seiko809 wrote:

 I've designed this big state machine, ...


You still have not explained what the program is supposed to do. I am pretty sure that 80% of the current code is not necessary and the entire thing could be done much simpler.

 

I am also not sure why you call it a state machine (and it is not "big" either). 😄

 

Just glancing at Lynn's image above, many things make absolutely no sense and just clutter and complicate the diagram.

 

Find the following constructs. All boolean operations where one input is a diagram constant can be eliminated and replace with a plain wire or possibly an invert.

 

  • "A .AND. TRUE" is simply "A" (a wire!)
  • "A .OR. FALSE" is simply "A" (a wire!)
  • "A .XOR. TRUE" is simply ".NOT. A"
  • "(A .OR. FALSE) _AND_ (.NOT. (A .AND. FALSE))" is simply "A" (a wire!)
  • Instead of inverting a FALSE constant, you could simply use a TRUE constant.
  • ....

For example, the code operating in the lower shift register can be reduced to a single "invert". Of course all the currently remaining feedback nodes currently give an invariant constant. Obviously, you must have had much more in mind so either their inputs need to be hooked up somewhere useful or they should be deleted.

 

So, please describe in a few words what kind of outputs you expect based on the changing values of the four boolean input value. I am sure we can point you to an almost atomic solution. 😄

 


@Seiko809 wrote:

Sorry if this seems silly. I only just started using labview.


Virtually all your problems are algorithmic and would be an problem in any programming language. The problems have nothing to do with LabVIEW per se. 😄

0 Kudos
Message 9 of 11
(4,581 Views)

I guess something was undefined so you did boolean operations on Null? That crashes most systems. 🙂

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 11
(4,559 Views)