LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Alternative to Event Structure

Hi,

 

I am an EE intern creating a testing program for an antenna pedestal.  I am using LabVIEW Base Version 11.0.1.

 

I am using an LV-Link VI provided by an example from the download for the Data Translation 9836 module that my company is using.  Currently, I have an array correctly storing data when the user presses the "Start/Stop" button for the first time.  I am working on the section of my VI where I prompt the user to "Save Data to File?" so that I can make the VI either save the data when the user clickes "yes" or stop acquiring data and not saving the data when the user clicks "no".

 

My current problem is that in my implementation, when the user clicks the "Start/Stop" button for the 2nd time to stop acquiring data, the user prompt will continuously come up because the "Start/Stop" button is in a false state as long as the button is "unclicked", and will remain that way until the user clicks "Start/Stop" again.  I do not have the event structure at my disposal because I only have LabVIEW Base which does not include the even structure(I did give a kudo to whoever was suggesting that the event structure be put into every level of LabVIEW).

 

I saw another thread with a similar problem here: http://forums.ni.com/t5/LabVIEW/Simulate-event-structure-in-LabVIEW-base/td-p/1008900, but I am having a hard time understanding what exactly is going on since I just learned all of the basics and am figuring out LabVIEW as I go along.  If someone could help me simulate an event-structure-like situation in my VI that I have attached, it would be greatly appreciated.

 

Thank you,

 

Aki

0 Kudos
Message 1 of 7
(3,252 Views)

The attached quick modification will only give you a TRUE for the second case if the boolean just switched from false to true. See if this suits your needs.

 

(You need quite a few more tweaks, for example the loops needs a small delay so it does not consume all CPU while doing nothing. There should also be a mode to clear the accumulated data from the shift register, etc....)

0 Kudos
Message 2 of 7
(3,238 Views)

Thank you very much for your quick modification.  It is definitely what I needed.

 

I started creating this program a few days ago, and I am learning LabVIEW from scratch as I go.  There are so many functions I need to implement and so many tweaks I need to make before I get even close to finishing this program.  Thank you for helping me scratch one of the countless things on my to-do list.

 

Thanks again,

 

Aki

0 Kudos
Message 3 of 7
(3,233 Views)

Hi,

 

I saw that one of the tweaks you were talking about that I need in my program is to clear the shift register every time the user tries to acquire data.  I could not find the "mode" you were talking about.  Could you point it out to me?  I am sorry if this is a very basic mode.

 

Thank you,

 

Aki

0 Kudos
Message 4 of 7
(3,173 Views)

At the moment, the code is still way too scattered. I meant one of multiple states of a state machine. From the current code, I cannot really tell what you want.

 

Maybe all you need to do is delete the orange wire in the FALSE case of the upper case structure and make the output tunnel to use default if unwired. (but make sure you don't lose the data).

 

Attached is a quick modification that gives you another additional true whenever the button changes. Used it to either clear the array or execute the "save" case once. 

0 Kudos
Message 5 of 7
(3,167 Views)

Hi,

 

Thank you again for the modification.  Your modification works, but I was wondering how exactly that case structure that is supposed to clear the shift register works.

 

Thank you,

 

Aki

0 Kudos
Message 6 of 7
(3,122 Views)

The output tunnel is set to "use default if unwired" (right-click...) and it is unwired in the TRUE case. The default value for an array is an empty array, so that's what you get.

0 Kudos
Message 7 of 7
(3,115 Views)