LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delay VI execution until message box OK'ed

Solved!
Go to solution

I am quite new to LV and still getting to grips with it. I find it really hard to find answers as I normally do with other programming languages, so I am unsure of whether what I am going to ask is not possible or I'm not using the correct search terms. I have googled quite a lot, checked the NI training and searched on this community without any obvious success.

 

I need the user to perform a visual inspection of a piece of equipment and then confirm it is OK to proceed. In other programs I would do something like a modal message box, with the result hooked into an IF structure to control program execution. Is there anything similar in LV? 

 

I have created a message box which pops up when the VI is run, but I can't figure out how to get the rest of the VI to wait for the confirmation from it. The rest of the VI is performing a DAQMX acquisition, with the read part in a while loop until the stop button is pushed.

 

Thanks for any advice.

0 Kudos
Message 1 of 7
(1,194 Views)

@lv_newb wrote:

I am quite new to LV and still getting to grips with it. I find it really hard to find answers as I normally do with other programming languages, so I am unsure of whether what I am going to ask is not possible or I'm not using the correct search terms. I have googled quite a lot, checked the NI training and searched on this community without any obvious success.

 

I need the user to perform a visual inspection of a piece of equipment and then confirm it is OK to proceed. In other programs I would do something like a modal message box, with the result hooked into an IF structure to control program execution. Is there anything similar in LV? 

 

I have created a message box which pops up when the VI is run, but I can't figure out how to get the rest of the VI to wait for the confirmation from it. The rest of the VI is performing a DAQMX acquisition, with the read part in a while loop until the stop button is pushed.

 

Thanks for any advice.


By default the execution flow of LabVIEW is from left to right and also VI Block/Function will not execute until it receives all the necessary input nodes, So you can start acquiring the data after the Popup confirmation.

Wiring Error Cluster from popup Vi to DAQmx will solve your problem. 

 

Note: Its always better to share the code what you have tried so far to give better suggestion.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 7
(1,185 Views)

@PalanivelThiruvenkadam wrote:

@lv_newb wrote:

I am quite new to LV and still getting to grips with it. I find it really hard to find answers as I normally do with other programming languages, so I am unsure of whether what I am going to ask is not possible or I'm not using the correct search terms. I have googled quite a lot, checked the NI training and searched on this community without any obvious success.

 

I need the user to perform a visual inspection of a piece of equipment and then confirm it is OK to proceed. In other programs I would do something like a modal message box, with the result hooked into an IF structure to control program execution. Is there anything similar in LV? 

 

I have created a message box which pops up when the VI is run, but I can't figure out how to get the rest of the VI to wait for the confirmation from it. The rest of the VI is performing a DAQMX acquisition, with the read part in a while loop until the stop button is pushed.

 

Thanks for any advice.


By default the execution flow of LabVIEW is from left to right and also VI Block/Function will not execute until it receives all the necessary input nodes, So you can start acquiring the data after the Popup confirmation.

Wiring Error Cluster from popup Vi to DAQmx will solve your problem. 

 

Note: Its always better to share the code what you have tried so far to give better suggestion.


I need to correct this immediately.  LabVIEW does NOT flow left to right.  The relative positions of the node does not influence execution order.  The only reason why it appears that way is because inputs are usually on the left and outputs are on the right, so when you hook them up, they naturally align that way.  But if you don't mind messy wires, you can drag them around anywhere and they will execute in the order they are wired up.  And any nodes that aren't hooked up to anything can execute any time they want to (within dataflow rules).

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 7
(1,178 Views)

@billko wrote:

@PalanivelThiruvenkadam wrote:

@lv_newb wrote:

I am quite new to LV and still getting to grips with it. I find it really hard to find answers as I normally do with other programming languages, so I am unsure of whether what I am going to ask is not possible or I'm not using the correct search terms. I have googled quite a lot, checked the NI training and searched on this community without any obvious success.

 

I need the user to perform a visual inspection of a piece of equipment and then confirm it is OK to proceed. In other programs I would do something like a modal message box, with the result hooked into an IF structure to control program execution. Is there anything similar in LV? 

 

I have created a message box which pops up when the VI is run, but I can't figure out how to get the rest of the VI to wait for the confirmation from it. The rest of the VI is performing a DAQMX acquisition, with the read part in a while loop until the stop button is pushed.

 

Thanks for any advice.


By default the execution flow of LabVIEW is from left to right and also VI Block/Function will not execute until it receives all the necessary input nodes, So you can start acquiring the data after the Popup confirmation.

Wiring Error Cluster from popup Vi to DAQmx will solve your problem. 

 

Note: Its always better to share the code what you have tried so far to give better suggestion.


I need to correct this immediately.  LabVIEW does NOT flow left to right.  The relative positions of the node does not influence execution order.  The only reason why it appears that way is because inputs are usually on the left and outputs are on the right, so when you hook them up, they naturally align that way.  But if you don't mind messy wires, you can drag them around anywhere and they will execute in the order they are wired up.  And any nodes that aren't hooked up to anything can execute any time they want to (within dataflow rules).


Thanks for correcting, since we develop code in such a way that we control the execution flow in-order.

Though I understand that any function block will execute once it receives all the necessary inputs but this statement of Execution flow (from left to right) was in my mind always- Thanks again for this.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 7
(1,175 Views)

Thanks for the response. So something like this?

(hastily thrown together as I am at my desk pc)

lv_newb_0-1682435439400.png

 

0 Kudos
Message 5 of 7
(1,169 Views)
Solution
Accepted by topic author lv_newb

@lv_newb wrote:

Thanks for the response. So something like this?

(hastily thrown together as I am at my desk pc)

lv_newb_0-1682435439400.png

 


 You can remove error cluster from error code which you have used. Also, you can skip the DAQ Execution based on the output of Message if its not ok.

PalanivelThiruvenkadam_3-1682436436071.png

 

 

 

 

 

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 6 of 7
(1,163 Views)

Cool, thanks! I didn't consider a case structure as in my mind you only use that when you have multiple paths (e.g. a switch/select in text code). It seems that case in LV speak maybe covers both IF and SWITCH from text code.

0 Kudos
Message 7 of 7
(1,151 Views)