LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Handling circular buffers

Hello Raghunathan,

It sounds like you have quite a bit going on in your program.  The -50103 error occurs when you are trying to start multiple tasks that use the same resources at once, as described in the following KnowledgeBase article:

Causes of NI-DAQmx Error 50103 "The Specified Resource is Reserved"
http://digital.ni.com/public.nsf/allkb/04BEDD9E9E91ED3486256D180048116D?OpenDocument

From the sounds of it, you are dealing with case 2 in the article.

Especially with a lot going on, you may want to name your tasks to make it easier to determine which one is causing the error.

Regards,
John Bongaarts
0 Kudos
Message 11 of 14
(882 Views)
Hello John,

Thanks. I figured out my mistake - the Main was doing a AI sampling inside of a Timed loop that was being fired by a Create Timing Source and the Ctr0 was being used for this. Then in the Sub.vi I was trying to read an encoder with the same Ctr0. After I reconfigured sub.vi to use Ctr01 things are fine.

But then I want to ask this while on topic :

- The Main is acquiring AI channel samples at the rate of 200 / ch at 10KHz rate. The Timed loop is fired by the Timing source using Ctr0 once the required samples are acquired and thus runs at 20ms timing.

- This VI calls a sub.vi which has many tasks defined to acquire digital inputs and an encoder using Ctr01 once every 50ms inside a timed loop. It also  updates  AO and DO  from inside the timed loop once every 50ms.

Question is : Is the above set up a stable one ? There is no effort to synchronize when the sub.vi  is called and the Main vi might be in the middle of  acquiring one batch of samples. Will there not be a conflict ?

This whole Task affair is quite a challenge to come to grips with 😉

Regards

Raghunathan


Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 12 of 14
(860 Views)
Hi Raghunathan,

Is this being done on a real-time system?  That would give much better stability than using timed loops on a Windows machine.

From the looks of it you probably need to stop some tasks to free resources for others, which involves software timing.  Anytime you get software involved, you have to deal with the fact that your operating system decides when things get done.  Your application may run fine when it is the only thing running, but if you open another application, it may affect the timing of your application.

In the end, you have to look at the big picture of what you want to accomplish.  Whether or not it can be done with your current setup depends on your application.
Regards,
John Bongaarts
0 Kudos
Message 13 of 14
(826 Views)

Just got time to look at your example. I hope you're not using this exact code for each subpanel. You're calculating the averages for all of the AI channels and then only selecting the output of the channel you're interested in. You would be performing 10x the number of averaging calculations necessary.

B/T/W, you could simplify the part where you are converting the Timestamp to a date/time record and performaing the h/m/s mutiplications by just converting the output of current time to a double and wiring that directly into the property node, then set Formatting for the x axis on the chart to absolute time (hide date if not needed).

0 Kudos
Message 14 of 14
(821 Views)