From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Switching between channels

Hello.

 

I have a problem with building a test system. I need to be able to excite the system with two different channels in various ways but I can't get it to work.

 

The problem is that I need to be able to switch between the two different channels in real-time with as little delay as possible. I've tried to do it as shown in the attatched VI and that gets me an -50103 error. I get that it is because I'm using two different tasks for the same card when I try to use both tasks at once, but do I also have to release the tasks when I only use one channel? I would really prefer if there was a way to do this without releasing and initiating the tasks over and over since the system needs to be as fast as possible.

 

So the question basically is this:

 

Can it be done and what can I do to get it to work? 

 

Any help with this would be gratly appreciated.

 

Oh yeah, I'm using a PCI 5361 for output and a PCI 4462 for input on a windows 7 computer with LV 2009. 

Download All
0 Kudos
Message 1 of 7
(2,502 Views)

Forgot to mention that I've already looked at several older posts on this issue, but none of them seemed to fit.

 

Not that I wouldn't appreciate any links to other threads that can help me or anything, but just so that I don't get the whole "read before you post"-speech from someone 😃

0 Kudos
Message 2 of 7
(2,501 Views)

What is the error you receive?

I assume that it is something like "device already in use". You configured both AOs for the same channel on the same device (Dev1/ao0). This seems to be wrong....

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 7
(2,496 Views)

Ok, well the channels should of course be ao0 and ao1, sorry about that. The program doesn't work either way.

 

The error i get is 50103: "The specified resource is Reserved". I've looked it up and the knowledgebase says that it is because I use the same card for two different tasks. I can get this in the case of the two tasks running at the same time, but does that apply for the case when one task is stopped and the other one running? 

 

What I want to know is if it is possible att all to do something like this, with switching channels, without having to re-initiate the tasks every iteration.

 

Regards,

Felix 

0 Kudos
Message 4 of 7
(2,481 Views)

Felix,

 

you can put both aos into a single task. You have to configure them not to work regenerative. Therefore, you have to make sure, that the outputbuffer is filled correctly during runtime.

If a channel should stop "working", you have to pass an appropriate value (e.g. 0) to the channel which means your 2D array for the output channel has to contain a DC voltage value.

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 5 of 7
(2,474 Views)

Ok, that makes sense. Thank you.

 

How do I make sure that the buffer is filled correctly? Is it possible to flush the buffer after every run or something similar?

0 Kudos
Message 6 of 7
(2,468 Views)

Felix,

 

you can look into the example finder for continuous output. It is not possible to flush the buffer, but this is something you cannot do in your example as well.....

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 7 of 7
(2,463 Views)