LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I am trying to create channels twice on the same card, ie 4 counter inputs and 3 counter outputs

I am trying to create (initialize) channels for 4 counter inputs and 3 counter output on the same card, but I get the error message that the card is resevered.  How do I solve this problem? See attached image.NI_code_question.JPG
0 Kudos
Message 1 of 12
(4,983 Views)

Hello,

 

Are you trying to use the same counter as both input and output? This is what is causing your error.

 

You have an auto-index on your for loop tunnels, this is creating a task for every item in your array. However the input array constants for both your counter input and counter output tasks are the same! 

 

If you want to use 3 counters that are different counters to the 4 input counters, then change your array constant to the correct counters. 

 

If you want to use the same counter as both an input and output, then you cannot do this at the same time- you'll do it sequentially by starting a task as input, running it, stopping it, then reinitialise it as an output and restarting it.

 

I hope this helps!

 

Mark

0 Kudos
Message 2 of 12
(4,969 Views)

I have 7 PXI-6602 counter cards, for 2 of those cards I am trying to use four counters to read a pulse and 3 counters to write a pulse on the same card.  Is it not possible to read and write on the same card even though I am using different counters, (this is what I understand from your last sentence)? 

 

For a previous application I have been able to read 32 Analog inputs and write on 2 analog outputs on the same card using a structure similar to the figure I have provided.  Why wouldn't I be able to do the same with counters is my main problem?  Thanks for the help.

0 Kudos
Message 3 of 12
(4,966 Views)

Hello,

 

I now see what you are trying to do now! Thanks for explaining. What I now understand is that you are trying to use different counters on the same card. Could you post the VI for me to look at?

 

Thanks

0 Kudos
Message 4 of 12
(4,953 Views)

Please see attached.

 

Whilst you are using these 3 channels in the next step of the sequence, not in the same step, the task is still reserved because it hasn't 'stopped'

 

I hope this helps

Message Edited by macaba on 07-28-2009 03:48 AM
0 Kudos
Message 6 of 12
(4,916 Views)

I have tried removing the sequence and letting all task create at the same time though I get the same error message that the card is reserved (error message -50103).

0 Kudos
Message 7 of 12
(4,895 Views)

Hello,

 

Sorry, I didn't suggest a solution in my last post- please try removing the last 3 channels from one of the array constants. I circled the 3 channels in my last screenshot. 

 

I hope this is clearer!

 

Thanks

0 Kudos
Message 8 of 12
(4,883 Views)
I understand that will fix the problem, but I need to use those three channels for that task. If I remove them I fix the problem but create a situation where I don't have all the channels I need.  I need to know if this is a limitation of my PXI-6602 card where I can't call a task from the card more than once. 
0 Kudos
Message 9 of 12
(4,881 Views)

Hello,

 

That is fair enough!:

 

- If you want to Count Frequency and Generate Frequency at the same time on the same counter, then the hardware will not allow this.

 

But as you used a sequence in your original code, I think it is more likely this answer applies:

 

- If you are trying to take a frequency measurement then generate a frequency in the next frame of the sequence after some time; before starting your Counter Output task, make sure the Counter Input task for the counters you are sharing are stopped, using this:

 

daqmxStopTask.PNG

 

This will unreserve your counters to be used for the next task. 

 

0 Kudos
Message 10 of 12
(4,873 Views)