01-19-2016 08:55 AM
Hi everyone,
I'm getting a user event error 1 which states that I have an invalid input parameter and I don't know why it is happening. The VI initializes and then waits for 15 seconds for UUT to boot up and if I interupt during this time by clicking the stop button, the program generates a User Event Error1. However, if I don't interupt during this 15seconds, I'm able to stop the VI without the error message. Not sure if configured my dynamic events in the event structure correctly. Can anyone figure out what I'm doing wrong. I've attached the screenshots and code.
Thanks
01-19-2016 09:06 AM
Hi all,
I think I've figured out the problem with my code. I configured a separate user event and exit cases resepectively and that fixed the problem.
Thanks
01-19-2016 09:07 AM
Classic race condition.
Your upper loop completes as soon as you press the Exit button and then destroys the event. Then once the UUT bootup has completed, it tries to send the User Event. But the upper loop has already destroyed it.
The simple solution is to not destroy any of your references until both loops are complete.
01-19-2016 09:08 AM
I'm not able to look at the VI becuase I don't have LabVIEW on this computer but from the image you provided, I would guess that the following happens.
When you press exit, your event structure picks up on this and sends an "Exit" command but also stops the event handler loop. With your current dataflow, when the event handler loop stops, you will destroy your event reference. Then when you try to use that reference to fire and event you receive Error 1 because the reference no longer exists.