LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically unlatch Boolean

I have a boolean button, "Relay Power" that the user presses to start a pulse train.

There are two types of pulse train options: single and continuous.

 

My logging is dependent on the state of 'injection' and 'relay power'

 

When "Injecting?" goes FALSE and 'Relay Power' is TRUE, my logging starts. In the continuous case, when 'Injecting?' goes TRUE, the logging stops.

 

In my single case, the 'Injecting' never goes TRUE again since it just runs once. I think I would like my 'Relay Power' to go 'False' / unlatched when the pulse is over.

How do I achieve this?

 

boolean_latch.PNG

0 Kudos
Message 1 of 11
(3,448 Views)

The local variable can be a read or a write.  I think what you want is to make a new local valiable that is a write and wire a false to it when the pulse is over in a case structure.

0 Kudos
Message 2 of 11
(3,426 Views)

Yes that is what i was thinking, but I am running into issues as to how to determine the single case is 'done'

 

I am trying to use 'Is task done?' but it is prematurely ending my logging, I probably have my single pulse functional global variable incorrectly created..

 

SinglePulse1.PNG

SinglePulse2.PNGSinglePulse3.PNGSinglePulse3_idle.PNG

0 Kudos
Message 3 of 11
(3,413 Views)

I believe the 'Task Done' returns True right after one iteration of the while loop in the 'Start Pulse' state?

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

When I set 'samples per channel' to 2, 'task done' returns true after the 2nd delay period.

hmmm

0 Kudos
Message 5 of 11
(3,397 Views)

It will only work for you if you have a task...and you want to know when it is done.  So if you can make your task be as long as you want then you can use it.

0 Kudos
Message 6 of 11
(3,394 Views)

But aren't I creating a task in my 'Start Pulse' case? 

0 Kudos
Message 7 of 11
(3,391 Views)

@belopsky wrote:

But aren't I creating a task in my 'Start Pulse' case? 


Yes and how long is that task going to run for?  With analogs it is much easier to tell.  If I have a finite read, then the task is over once that finite time is over.  If I have a continuous task it is never over, and if I have a single point task I believe it will be over once the first read has been done.  Your task is over once one cycle of your counter has been completed.

0 Kudos
Message 8 of 11
(3,386 Views)

I was under the impression one cycle of my counter was a HIGH and LOW state? 

Shouldn't my task be over after the LOW state?

0 Kudos
Message 9 of 11
(3,381 Views)

OK I think the issue is how my VI for the pulse is setup.

 

Upon starting, it is in the 'Start Pulse' but when it is done with 'start task' goes into 'Pulse Status' and returns true though it is not done?

0 Kudos
Message 10 of 11
(3,365 Views)