LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

abort execution button does not reset LabView?

Solved!
Go to solution

Hi,

 

I have made this VI (attached to this message), but everytime I use 'run continuously' , it seems like it gives the wrong outcome in the front panel. However, it does give the correct outcome when I add a random control to the block diagram and delete it immediately (so technically, nothing changed to the blockdiagram) and after that press 'run continuously'.

 

So the 'abort execution' button, which i use to stop the system, does not reset my system? How to reset the system before I use it?

 

Furthermore, below I show 4 similar parts, if I use 25 of these parts in one file, does it take a lot computational effort or is it no big deal for LabView (on a basic computer?!)

Naamloos.png

Thanks in advance!

 

 

0 Kudos
Message 1 of 8
(2,958 Views)

Abort and run continuously are for diagnostics only and should NEVER be used to run/stop a program.  Put a proper while loop around your code and wire in a STOP button.  

 

It's certainly no big deal for any PC to keep track of some booleans but your code looks like it's probably a mess of potential race conditions.  Can't really tell without seeing the whole thing but I can gurantee that there's a better way to do what you want.  Tell us what you're actually trying to do and we can steer you in the right direction.  At the very least 25 sections of repeated code scream for a subVI.  Smiley Wink

 

 You should check out some of the excellent tutorials NI has available:  http://www.ni.com/academic/students/learn-labview/ 

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
Message 2 of 8
(2,936 Views)

Hi,

 

Thanks for your reply, the system I am trying to make consists of several subsystems:

 

each subsystem waits to obtain a high signal from the previous subsystem and a high signal from a manual on/off-switch.

The subsystem should then give high digital signals to a boolean and to the next subsystem and reset the previous subsystem, including the previous subsystem boolean.

 

the next subsystem should do the same thing.

 

Like the VI that i sent in my message, the only difference is that all the 'previous' booleans should remain off.

In my VI, the previous booleans become on-off-on-off-on-off. instead of all 'off'.

 

I'm sorry if it is not clear, but if you can really shorten/use less controls for this VI then please tell me how..

 

Cheers!

0 Kudos
Message 3 of 8
(2,817 Views)

First of all eliminate the local variables and wire to the control directly. It is completely silly to read a control and write a value to a local variable ot itself. That makes no sense at all! You are also reading the same control (not the local variable!) In many different places in parallel. It is possible that some get old values and some get current values, because there is no way to tell in which order the control and all it's local variables are read. Juat wire to the control!

 

Secondly, to reset the feedback node, globally initialize them with a false.(lowest input)

 

There are basic beginner mistakes and I would strongly recommend that you continue with some tutorial and exercised before getting too far into the weeds by just randomly hacking around.

0 Kudos
Message 4 of 8
(2,800 Views)

@Bartb0 wrote:

 

Thanks for your reply, the system I am trying to make consists of several subsystems:

 

each subsystem waits to obtain a high signal from the previous subsystem and a high signal from a manual on/off-switch.

The subsystem should then give high digital signals to a boolean and to the next subsystem and reset the previous subsystem, including the previous subsystem boolean.


What is a "subsystem" and how does it interface with your code? I think you are doing this way too complicated!

 

Please explain exaclty what the various controls should do an what result you expect. 

0 Kudos
Message 5 of 8
(2,794 Views)

Well, basically I want to try to program a drive (just the software part), using controls and indicaters instead of the hardware, 

the biggest problem is that it involves different steps that should be done after each other.

 

The very basic requirements are:

-there are 5 robot positions, 2 lights and a display

 

- when the program starts, a robot moves from position 1 to position 2, two lights turn on and the display should show a number: 20

- when the robot has arrived at position 2, it should move to position 3, the first two lights should go off and the display should show a new number: 35

- when the robot has arrived at position 3, only the first light should go on and the display number should be: 100.

 

If there is an easy way to program such things, then I would like to know it 🙂

 

and yes, I do make beginner mistakes, but that is because I am a beginner, wanting to know if some things are possible within LabView.

 

Cheers!

0 Kudos
Message 6 of 8
(2,723 Views)
Solution
Accepted by topic author Bartb0

Just do a simple state machine 😄

Message 7 of 8
(2,701 Views)
Thanks!!!! Its exactly what i needed!! I already thought i should maybe use a shift register, but i didnt know about this state machine! Thanks a lot!
0 Kudos
Message 8 of 8
(2,662 Views)