LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to stop a period counter in a while loop without using abort execution%3F

I am using a NI x series 6343 andcounting pulses, but when i try to stop the counter with a boolean operator nothing happens, ihave to go and use abort execution, 

 

Help

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

Is showing your code an option?

 

My telepathic skills are not good on Mondays...

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

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

here it is hope it helps

0 Kudos
Message 3 of 11
(4,162 Views)

I have to say that your code is well commented. 

 

I'm not sure what your issue is, though.  I see nothing that is attempting to stop the task you started.  Are you expecting it to stop by itself?

 

If so, then you shouldn't. Most tasks require an explicit CLEAR TASK to make them stop.

 

I'm not an expert on the EXPRESS VIs, perhaps someone else can have a more informed opinion.

 

How is it that you know it's not stopping?

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 11
(4,148 Views)

You're also using two loops and two DAQ Assistants, Do you have two cards?

 

If not, then you're trying to use two tasks to read one card, and one of them is going to have an error.

 

(Unless there's some magic in this EXPRESS assistant that I don't know about.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

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

the problem is that when i run the vi the the upper loop does not stop with the boolean stop operator in thw while loop, the button just basically does not do anything, i tried a couple of things to stop it, but at the end the only way to stop it is using the abort execution button

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

the upper loop does not stop

 

--- Then why did you say that the trouble was you couldn't stop the counter?

 

You have to realize we can't see your situation unless you tell us accurately.  Instead it's all the way in post #6 when you disclose the real problem.

 

 

Again, are you using two cards?

 

Why are you using two loops?

 

What does the error output of the DAQ ASSISTANTS tell you?  

 

Since you don't have an indicator, I suspect that you haven't looked.

 

There might be a clue there.

 

I suspect you are trying to use two ASSISTANTS on one card, and one of them is complaining, because the other one is using the card.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

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

we are using one DAQ card, i decided to use two loops to make sure that part would not have the same problem as the other one, there is no error message it is just that when i hit stop on user interface it does not do anything, this just happen when rollers are not moving, basically when it is not getting a signals, this is not a problem with the second DAQ assistant, this problem seems to be somehow connected to counters as i can make everything else stop in a while loop, just counters behave differently.

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

 this just happen when rollers are not moving,

That wasn't important enough to say earlier?

 

I'm unable to look at the setup of your tasks, as I don't have NI-DAQ on the VM that has LV 2014 on it, but here's my guess:

 

If you have the task set up to count TIME BETWEEN PULSES (as opposed to pulses per unit time), then it's waiting for a pulse, and if your source isn't rolling, then the pulse never comes.  The timeout should take care of things, but you don't have a timeout on the lower loop.

I don't recall what the default is.

 

Did you actually put an indicator on the ERROR OUT terminal of BOTH assistants?

 

It's still possible that the two loops are vying for control of one card.  I would get rid of one loop altogether until you get the other one working perfectly.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

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

i tried using just that one loop, the same problem remains, the stop sign does not do anything, it just stops after the timeout.

0 Kudos
Message 10 of 11
(4,030 Views)