01-16-2010 09:33 AM
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?
Blog for (mostly LabVIEW) programmers: Tips And Tricks
Solved! Go to Solution.
01-16-2010 09:45 AM
01-16-2010 09:53 AM
When I ask to install a simulated device, the only cDAQ option available to me was NI-9172 chassis.
MAX 4.6.2
Blog for (mostly LabVIEW) programmers: Tips And Tricks
01-16-2010 09:54 AM
you could not have separate tasks with the same resource.
But what "resource" is it referring to?
Blog for (mostly LabVIEW) programmers: Tips And Tricks
01-16-2010 10:00 AM - edited 01-16-2010 10:03 AM
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.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
01-16-2010 10:12 AM
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.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
01-16-2010 10:17 AM
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.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
01-16-2010 10:20 AM
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.
01-16-2010 10:29 AM
Blog for (mostly LabVIEW) programmers: Tips And Tricks
01-16-2010 10:46 AM - edited 01-16-2010 10:46 AM