LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SIMPLE PID ERROR - Resource is being used

Hey guys,

 

I'm a beginner in using LabView, and currrently I've written a huge program, which is infact pretty simple, that takes an analogue input from the hall sensors of a BLDC motor I am running, and uses a PID block to output (via analogue output) the calculated values. I have uploaded an image of the program to this post. But I'm getting the following error when I try to run this:

 

The device resource is being occupied.

Please make sure that no other analogue output operation is running within the device.

 

As you can see I have only initialised the pin 1 on both the analogue input and analogue output, and am not too sure what this error is suggesting.

 

Any help is much appreciated, as I have my final year project deliverable in about a week. It's just this glitch that I have to sort out and I'm done.

 

Cheers

0 Kudos
Message 1 of 4
(2,118 Views)

What is the resource you are using?  I see two resource constants that are both labeled "1".  That doesn't make sense because you said one is an input, the other is an output.

 

What functions are you using?  Something doesn't look right with them.  Are they old Traditional DAQ functions?

0 Kudos
Message 2 of 4
(2,113 Views)

Hey Ravens Fan,

 

One resource constant is the Analogue Input (channel 1), and the other is the Analogue Output (channel 1).They are traditional DAQ AI and AO functions found in the User Library for the Advantech DAQ I am using.

0 Kudos
Message 3 of 4
(2,108 Views)

Do those cards show up in Measurement and Automation Explorer (MAX) ?

 

Using a VISA resource implies that they do.  But since they are both called 1, it has to be referring to the same channel.  Usually there is more to the name that distinguishes an analog input channel from an analog ouput channels such as AI1 vs. AO1.  The 1 is just an alias to a particular channel.  And two different channels can't have the same alias, otherwise how does LabVIEW know which channel to communicate with?

 

Check how they show up in MAX.  I don't think you can legitmately name them the same.  For grins, eliminate the analog output part of your code and see if you get an error.  Then put it back in and eliminate the analog input part of your code and see if you get an error.

0 Kudos
Message 4 of 4
(2,102 Views)