LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Beginner question re: case structures

Solved!
Go to solution

@RTSLVU wrote:

@altenbach wrote:

@stevem181 wrote:

I’m going to go against the crowd here, so feel free to ignore this post.


I don't think anyone discouraged the use of an event structure, we just did not want to overload the beginner programmer with additional concepts. 😄


Actually I kind of did as I can't say I have ever found a real use for event structures. I have tried them out hear and there, but I guess they just never clicked <Mouse-Down Evented> with me.

 

To me they brake the dataflow paradigm so I tend to tell new programmers to avoid them


Fixed that for you. Smiley Happy

 

I generally just think of the event structure as a convenient way to avoid polling for user interaction in an idle state.  Makes it easier to add new functionality and keeps overhead lower (sleeps while waiting).  If you think of them as a case structure that depends on user interaction they're pretty easy to get your head around.  And, of course, you'll need to understand them to easily read/modify other peoples code.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 31 of 37
(1,623 Views)

@NIquist wrote:

@RTSLVU wrote:

t say I have ever found a real use for event structures. I have tried them out hear and there, but I guess they just never clicked <Mouse-Down Evented> with me.

 


Fixed that for you. Smiley Happy

 

I generally just think of the event structure as a convenient way to avoid polling for user interaction in an idle state.  Makes it easier to add new functionality and keeps overhead lower (sleeps while waiting).  If you think of them as a case structure that depends on user interaction they're pretty easy to get your head around.  And, of course, you'll need

to understand them to easily read/modify other peoples code.


LOL, good one. 

 

Yeah, I know I need to figure these things out but they just never even cross my mind. But a case taht depends on user interaction is a good way to think about them. 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 32 of 37
(1,620 Views)

The event structure is still my favorite structure and most of my programs have one. Of course my programs are more UI driven and don't really need to do anything unless the user wants something.

 

In classic data acquisition or instrument control, sensors need to be read at regular intervals anyway, so polling a few controls does not add anything and an event structure is no longer really needed.

 

It really depends on what kind of programs you are writing.

0 Kudos
Message 33 of 37
(1,608 Views)

Hi again,

 

Still no luck getting the programming the way I want, & I'm running out of time. May have to skip all of the case event structure stuff for this one.

 

Can anyone please tell me how I can have a photo as the background, and not have my controls slide all over the place if the window is resized, or the scroll bar is used while the VI is NOT running?

 

I have played around with all of the "move to back" & other options. But I can't "bake" in the position.

 

Thanks,

 

George

0 Kudos
Message 34 of 37
(1,575 Views)

Hi Geoge,

 

Background Images move with the scrollbars. Not what you want.

Try just dragging the image from file explorer onto your front panel.

Then you can actually click on and select it (and use the Move-to-back

selection).

 

steve

 

 

--------------------------------------------------------------------------------------------------------------------------
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
--------------------------------------------------------------------------------------------------------------------------
0 Kudos
Message 35 of 37
(1,564 Views)

Hi Steve,

 

Thanks for the tip. Every single time I do that, the second I try to move the photo after dropping it on the front panel, Labview crashes. I tried this about 20 times. I have a fast computer so I don't know why this is happening. It drops on the front panel just fine, I can select it, but as soon as I go to move it, the program crashes.

 

Any ideas?

 

I've attached the 2 files if you wanna give it a try?

 

George

Download All
0 Kudos
Message 36 of 37
(1,556 Views)
Solution
Accepted by topic author gsrokmix

So after playing around, I finally was able to get the background photo to move to the back. The trick was to not try & drag it around with the mouse, but use the arrow keys to get it into position. After I figured that out, everything else worked as it should. I was able to group & lock everything, so now you can't move any of the controls out of place. I also made the controls I created to select the soda transparent, so now the controls appear to be the ones in the photo.

 

Now if I could only get the case structures to do what I want............

 

Thanks again!

 

George

0 Kudos
Message 37 of 37
(1,539 Views)