LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mystery Error -50103

Solved!
Go to solution

OK, so I'm finally up to LV2009f3, doing some cDAQ work.

 

I'm adding code for devices, one at a time and checking them out.

 

(I'm using simulated chassis, and simulated devices - thank you, NI, for this capability!) 

 

When I add the strain gage (NI-9237). I start getting an error (-50103 - resource is reserved).

 

MAX says the board works fine, and gives me the simulated sinewave.

 

I boil my code out of my program, and it works fine by itself.

 

But when I try to do BOTH module 4 (9201) and module 6 (9237), I get the error.

 

The attached snippet (I like snippets, BTW) shows the code.

 

Before I added the error wire to force the strain gage module to configure AFTER the voltage module, I would get the error every time.

 

But, sometimes it would occur on the VOLTAGE module, and sometimes on the STRAIN module.

 

I could run it several times, and the error would come from one or the other, but it would occur every time. 

 

So what are the rules here?  They are completely different modules, yet something is temporarily tied up when I try to configure them in parallel.

 

It's some sort of race, judging by the error happening on one or the other.  One chain is claiming this "resource", and the other finds it busy and complains.

 

Yet the error is attributed to the START TASK vi. 

 

What am I missing?  What are the rules about this? 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Download All
0 Kudos
Message 1 of 28
(4,580 Views)
What chassis are you simulating? The earlier models only had a single, shared convert clock so you could not have separate tasks with the same resource.
0 Kudos
Message 2 of 28
(4,571 Views)

When I ask to install a simulated device, the only cDAQ option available to me was NI-9172 chassis.

 

MAX 4.6.2 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 3 of 28
(4,569 Views)

you could not have separate tasks with the same resource.

But what "resource" is it referring to? 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 28
(4,567 Views)

More info:

 

IN the snippet I showed, running the things serially removed the problem.

 

In my real code, I do the CONFIG at one point, and the START at another.

 

IOW, in the CONFIG operation, I  CREATE CHANNEL, set DAQ TIMING and set BUFFER SIZE for two modules, in parallel, getting two TASK IDs that I remember.

 

In the START operation, I START both tasks in parallel.

 

Forcing the CONFIGS to run sequentially does NOT fix the error.

 

Forcing the STARTS to run sequentially does NOT fix the error.

 

Forcing them both  to run sequentially does NOT fix the error.

 

Even adding a 1-sec delay between STARTS  does NOT fix the error. 

 

IOW, it appears that I have to START one task before I can CONFIG the other, a state I don't understand. 

 

 

Message Edited by CoastalMaineBird on 01-16-2010 10:02 AM
Message Edited by CoastalMaineBird on 01-16-2010 10:03 AM
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Download All
0 Kudos
Message 5 of 28
(4,564 Views)

I just now realized that the snippet I provided has the first task completely shut down before the 2nd one starts.

 

I tried in my real code to configure and start task one, THEN configure and start task two, but it STILL complains.

 

IOW, I cannot run these two tasks because they use some common "resource", but LV is not smart enough to tell me what. 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 6 of 28
(4,554 Views)

Apparently I can add the STRAIN GAGE channel to the same task as the other 8 VOLTAGE channels and do away with the 2nd task.

 

When I READ from that task, I get nine values, meaning the strain gage is in there.

 

I was thinking that a different module should have a different task. 

 

But I still don't understand what I did wrong. 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 7 of 28
(4,551 Views)

I'm surprised.  I though you had been around the forums long enough to see that error come up before.

The error is based on two different tasks trying to share the same sample clock.  One or the other is raising the error.  When you combine the channels into one task, then all the channels use that sample clock and there is no resource conflict.

0 Kudos
Message 8 of 28
(4,548 Views)
OK, I haven't used cDAQ enough to realize that there is only one sample clock for the whole shebang.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 9 of 28
(4,544 Views)
The current 4 and 8 slot chassis (9174, 9178) have separate timing engines so you can actually have multiple tasks for different slots. You did not mention what version of DAQmx you are using. The latest might allow you to use a different chassis.
Message Edited by Dennis Knutson on 01-16-2010 09:46 AM
0 Kudos
Message 10 of 28
(4,533 Views)