From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

control block diagram from fron panale

I want to use Write to spread sheet function inside while loop but I do not want to write all the data sets. I want to have an icon in fron panel when I click it enables the write function for one time. I tried with if function but I need to do another click to disable the  write function. Any simple idea?

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

@Husain111 wrote:

I want to use Write to spread sheet function inside while loop but I do not want to write all the data sets. I want to have an icon in fron panel when I click it enables the write function for one time. I tried with if function but I need to do another click to disable the  write function. Any simple idea?


Did you even make an attempt?

 

 

0 Kudos
Message 2 of 11
(3,396 Views)
You obviously have the incorrect mechanical action for the Boolean. Change it and review what you should have learned by taking some of the free tutorials.
0 Kudos
Message 3 of 11
(3,377 Views)

here is the VI I coded. It works but I have to switch the if case my manually while I want it to switch automatically after one iteration. 

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

Okay, we are back on track.

 As stated above, you have the wrong mechanical action.  You have it set for Switch when pressed.  That means you click to turn it on, and then have to click to turn it off.

 

You want Latch when released.  Then you click to turn it on, and it will pop back up automatically to off once the control terminal is read.

 

The difference between when pressed vs. when released is that when pressed means it becomes true when you click down on it.  When Released means it becomes true when you let off of the mouse button after pressing down.

 

When Released is generally the preferred behavior and matches the way most buttons work in the operating system.  It gives you a chance to slide off the button and release the mouse without it triggering in the event you made a mistake by pressing down on it to begin with.

 

Learning the mechanical actions of buttons is a basic LabVIEW lesson. 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

 

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

I learnt LabView on the go so I am not suprised if I missed some basics. Do you think IF structure or event structure is the way forward?

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

There's no such thing as the IF structure.  So, that's definitely not the anwer.

 

If you use the correct mechanical action, you'll do fine with the Case Structure.  Until you understand how this works, you shouldn't take a step into the Event Structure.  Understand the more basic concepts before trying to use the more complex ideas as they tend to build on each other.  If you're able to wait for events in an intelligent way within the architecture you've built, the event structure will be more efficient.

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

Can not the evenet  be clicking an icon on the front panel?

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

Yes.  But event structures are intended for code to wait until an event happens.

 

You don't need that for your code since you want your code to run continuously and only have a decision as to whether to log it or not.

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

Do you think the state machine is the best solution?

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