LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Could someone break this program down for me?

Solved!
Go to solution

I really really need to understand this program. 5f91ec944bd5b62a827772ae21f78601.png

 

Now I've made queue data structures in other programming languages. I understand loops and the case structures. I don't get the invoke node function, even after reading the docs. I'm not too focused on what the program is actually doing so I don't want you guys to waste your time on that but just need to know what some of these key elements are doing. Some of the things I don't understand are:

Why is there a flat frame inside a stacked frame? Are frames analogous to sub routines or functions in other languages?

Why do my two main inputs (sense mode and measurement unit) get wired all the way through the cases and then to the other side of the loop box?

Why does there seem to be sequential numbers 1-4 littered through the main while loop?

Where are my messages getting enqueued from?

How does the sense mode and measurement unit variables get set?

I try to find functions pertaining to my specific instrument but nothing shows up in search, even though this program compiles fine.

 

0 Kudos
Message 1 of 5
(2,580 Views)
Solution
Accepted by topic author crash_override

Would have been better if you attached the VI.

 


@crash_override wrote:

Why is there a flat frame inside a stacked frame?

 


I assume you are talking about the upper loop that Queue Message Handler. If so, that flat frame is an event structure. It responds to "events", like the value of a control changing, or somebody clicking a mouse button etc. This frame allow LabVIEW programmers to capture screen events without having to write polling loops.

 


@crash_override wrote:

 

 Are frames analogous to sub routines or functions in other languages?

No, there are just pieces of the program. They could be a function.

 


@crash_override wrote:

 

Why do my two main inputs (sense mode and measurement unit) get wired all the way through the cases and then to the other side of the loop box?


That is a shift register in the loop, by going through all cases, the most recent value is passed to the next iteration of the while loop. Shift registers can be thought of local variables within a loop. They allow the the current iteration of the loop to have the previous iterations value for the variable, like i = i++, etc.

 


@crash_override wrote:

Why does there seem to be sequential numbers 1-4 littered through the main while loop?

 


Don't know, you only showed a picture.

 


@crash_override wrote:

 

Where are my messages getting enqueued from?

 


From queue functions. Look at the tutorials listed in this forum and in the example finder for queues. One loop is enqueuing the messages, the producer, and one loop is reading the messages, the consumer.

 


@crash_override wrote:

How does the sense mode and measurement unit variables get set?

 


It looks like those are two controls on your front panel; the user sets those. BUT I only see a picture.

 


@crash_override wrote:

I try to find functions pertaining to my specific instrument but nothing shows up in search, even though this program compiles fine.

 


Look in the instrument driver downloads, get the programming manual from the manufacturer. I have no idea what you are asking here? Just because the program compiles does not necessary indicate that all of the functions you need are contained in that program.

 

Attach your vi!!

 

mcduff

0 Kudos
Message 2 of 5
(2,556 Views)

Thank you very much for you response. This cleared quite a bit up. I've attached the whole VI if that helps. I did not know you could do that before.

0 Kudos
Message 3 of 5
(2,535 Views)
Solution
Accepted by topic author crash_override

I guess the question that follows should be, do you still have any questions?

They're likely to be much easier to answer with the VI in hand, but it looks like mcduff covered most of your questions already.

 

Regarding the 1-4, I think you're talking about the small yellow boxes (block diagram comments)?

If so, I'd say they're markers for the explanation at the bottom:

 

1. Setup the Queud Message. Only allow one event to Queu.
2. Display error to user so they know what is happening. Clear this error after it occurs so program can progress uninterrupted.
3. Wait for a message to be delivered from Queud Message Handler Loop.
4. Perform necessary action requested from user interaction. Case statement is CASE INSENSITIVE.


GCentral
0 Kudos
Message 4 of 5
(2,530 Views)

That about answers everything mcduff and cbutcher, thanks you. I will make a new thread if I get stuck again, hopefully I won't have to.

0 Kudos
Message 5 of 5
(2,438 Views)