04-25-2023 09:34 AM
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.
Solved! Go to Solution.
04-25-2023 09:47 AM
@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.
04-25-2023 09:55 AM
@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).
04-25-2023 10:01 AM
@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.
04-25-2023 10:11 AM
Thanks for the response. So something like this?
(hastily thrown together as I am at my desk pc)
04-25-2023 10:27 AM
@lv_newb wrote:
Thanks for the response. So something like this?
(hastily thrown together as I am at my desk pc)
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.
04-25-2023 11:04 AM
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.