06-20-2023 05:05 AM
Dear LabView community: I am running into the following problem: I have a main Program, which includes several buttons to start certain measurements. My SubVI is a simple counter which works just fine, when used as a standalone program. But when I call it by an event structure it does perform the measurement but keeps in some idle state instead of finishing the execution and returning the measurement values (Run button says "SubVI waiting to run").
06-20-2023 06:13 AM - edited 06-20-2023 06:14 AM
Hi Sentec,
@SentecDE wrote:
when I call it by an event structure it does perform the measurement but keeps in some idle state instead of finishing the execution and returning the measurement values (Run button says "SubVI waiting to run").
When the subVI is "waiting to run" then it waits for a call from its MainVI!
So the real question is: does your MainVI work as expected and does it call your subVI as expected?
06-20-2023 07:38 AM
The SubVI is executed when pressing the assigned button in the main VI frontend. It performs the measuring task and as far as I can observe it using the "highlight execution" method, the output values are further processed but are not passed through the frame of the event case.
06-20-2023 07:58 AM
Hi Sentec,
@SentecDE wrote:
The SubVI is executed when pressing the assigned button in the main VI frontend. It performs the measuring task and as far as I can observe it using the "highlight execution" method, the output values are further processed but are not passed through the frame of the event case.
THINK DATAFLOW: When the subVI has finished execution the calling VI (aka your event structure) can continue to execute and so it should receive/process the data.
As you didn't provide any code we cannot verify your experiences…
(When attaching code I would prefer LV2019. Use "Save for previous" to save for older LabVIEW versions.)
06-20-2023 07:59 AM
I'm glimpsing another Event Structure in your main VI. A loop should only ever have 1 Event Structure. Many argue there should only be 1 Event Structure in a single VI. But unless both of your Event Structure run, your loop is stuck waiting for everything to complete before it can iterate.
06-20-2023 08:02 AM
Please provide us real (editable, executable) LabVIEW code, which means (all the) files with the extension ".vi". We cannot "see" or understand "pieces of pictures of code" that are static images.
It also helps if you "save for previous version" (from the "File" menu) and choose LabVIEW 2019 or LabVIEW 2021, which most of the more experienced Forum users are using (while most of the "first-timers" are using LabVIEW 2023, which we can't open, yet ...).
I see a structure in your "picture" which suggests you were using an Express VI (possibly the Dreaded DAQ Assistant), and "blew up" its "express" personality. When you do this, you make it a little harder for us to tell how you configured the Express VI.
If you are working in a LabVIEW Project, I strongly recommend that you attach the entire Project. The easiest way to do this is as follows:
Bob Schofr
06-20-2023 10:03 AM
Others have already pointed out some glaring mistakes. However we need to full set (caller and all dependencies) as described to troubleshoot, not pictures!
06-21-2023 09:08 AM - edited 06-21-2023 09:08 AM
Maybe your event structure returns the measured values, but your next event does erase them, as you have 'use default values if unwired'.
For a quick test you can place a case structure around the output (Co60 & Co60ZR) and a true constant to activate this case.
Else you have enough ideas here.
06-22-2023 03:27 AM
Here I have the two files attached for 2019.
I deleted all other event cases as recommended and simplified the whole program to the necessary features.
I actually found out it passes on the measured values correctly, but only if the respective cells in the array are "activated" e.g. by manually writing in some values. (Can I actually have those 6 entries of the arrays activated by default?)
But, as the Sub-VI is not closed the timer is not reset, and if I call the Sub-VI again it instantly stops the measurement as the current time already exceeds the time-limit.
06-22-2023 04:08 AM - edited 06-22-2023 04:10 AM
Hi Sentec,
your main VI should rather look like this:
Apply better programming rules on your VI: