06-18-2011 05:28 PM
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.
06-18-2011 06:29 PM
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.
06-18-2011 06:34 PM
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.
06-18-2011 07:57 PM
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
06-18-2011 08:47 PM
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.
06-18-2011 09:19 PM
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
06-18-2011 09:25 PM
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.
06-19-2011 09:07 AM - edited 06-19-2011 09:08 AM
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
06-19-2011 12:33 PM
@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.
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. 😄
06-20-2011 01:52 AM
I guess something was undefined so you did boolean operations on Null? That crashes most systems. 🙂
/Y