LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -50103 when calling VI for second time

Solved!
Go to solution

I have a main VI which, after initial setup, calls a VI that reads and writes multiple times to a DAQ (USB 6356). This sub VI is called multiple times for each of the program steps. On the first pass through, there is no problem. On subsequent calls to the sub VI, however, it throws error -50103. I have identified the task that this error addresses. I have made sure to do an auto-cleanup on the task, create the task outside of any loops, and stop and clear the task after all iterations are done. In order to test whether it is solely subsequent calls that cause the error, I created a simple VI that just ran the sub VI twice in a row, and there were no errors.

 

Any ideas on what is causing my issue or why it only occurs on subsequent calls in my more complex VI?

 

Attached is an image of the frame and task that is giving me the issue.

 

Thanks!

0 Kudos
Message 1 of 9
(3,406 Views)

Please include a Snippet of your code, or attach your VIs, so that we can better assist you. We are here to help, but won't spend all day recreating your code from scratch. The screenshot doesn't include all of the code because there's another sequence frame after the one shown, right?

 

At which VI does the error get thrown? Is the screenshot from the subVI or the main VI?

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 2 of 9
(3,393 Views)
A stacked sequence structure and excessive use of locals is just a recipe for disaster. Consider cleaning up your code before posting again.
0 Kudos
Message 3 of 9
(3,368 Views)

@nrpratt wrote:

 

 

Any ideas on what is causing my issue or why it only occurs on subsequent calls in my more complex VI?

 

Attached is an image of the frame and task that is giving me the issue.

 

Thanks!


Yes, You did an Auto-Cleanup  That is good.  You really need to get rid of the Stacked Sequence Structure (As has been mentioned)

 

Then we might be able to disecect the code and find whith sequence local contentents are failing to contain what you want them to contain.  Its probabably  simple but, we need code rather than pictures.

 

OK?


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 9
(3,342 Views)

Here are snippets from the main VI (Main Transient) and the subVI where the error is occurring (Take Transient). I replaced all stacked sequences with flat sequences in the subVI and most of them have been replaced in the main VI. In the main VI, the call to the subVI has been highlighted in yellow, and in the subVI, the task that is throwing the error has been highlighted. 

 

I apoligize for the messy coding. I cleaned it up as much as possible, but this was recently converted from LabVIEW 6 and still is using some old coding styles.

Download All
0 Kudos
Message 5 of 9
(3,252 Views)

I replied to my own post with snippets of both the main and subVI. The subVI is the one throwing the error and it has been highlighted in the snippet.

 

Thanks

0 Kudos
Message 6 of 9
(3,249 Views)

Holy wall of code, Batman. You need to make some more subVIs in there man.

 

I think I found your issue with this specific task. You clear it where that error occurs, but then you open up a task for those analog channels again right afterwards without closing the task the 2nd time. The task wire cuts out where I found this Analog Input VI:

Analog Task.PNG

If you clear the task after that, your problem should be fixed. This is definitely a bandaid solution, though, when you should really visit the ER.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 7 of 9
(3,241 Views)

I had actually been playing around with that bit before. I just tried it again with a stop and clear task outside the loop for that task. Also, prior to creating the virtual channels for that task, I added a create task with auto-cleanup enabled. I am still, unfortunately, getting the same error as before, on the "prescan" task, which is a seperate task from the one being manipulated.

0 Kudos
Message 8 of 9
(3,229 Views)
Solution
Accepted by topic author nrpratt

I finally found the issue, though it was not with the task that LabVIEW had identified. The problem task was within a separate subVI that was called from the main VI and the subVI that was throwing the error. I got this task stopped and cleared and it doesn't look like it's having the issue anymore.

 

Thanks to everyone who contributed.

Message 9 of 9
(3,211 Views)