LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

combining channels in VI (ctr1 & ctr0)

Hi
I am using two different sensors (encoder and range sensor) and integrating throught DAQ 6024E there outputs are going in ctr-gate0 and ctr-gate1 . and they work almost fine seprately but now I want to put them in same code how can I do that once I have placed them togather it generates error message. how can I create multiple channels in same Vi . I still need to add one more channel since I need to measure the voltage aswell.
So in all I have to read three channels on DAQ card in same VI program.
See my Code as attachment
Thanks
0 Kudos
Message 1 of 15
(3,746 Views)
What error were you getting? I was able to run your program ok, all I had to do was change the second counter task to use CTR1, instead of CTR0. Just make sure you are using a different counter for each task.
-Alan A.
0 Kudos
Message 2 of 15
(3,729 Views)
I am getting message
" No DMA channel are available
either shut down other tasks
that might be using these channels
or consider changing your data transfer mechanism to interrupts"

I am using ctr0 and ctr1 and I have done the same in my Vi aswel.

What is be this problem and how to reset it.
Thanks
0 Kudos
Message 3 of 15
(3,725 Views)
You might want to try to set the transfer mechanism to be interrupts. You can do this with a DAQmx Channel Property Node. Use the following property: Counter Input>>General Properties>>More>>Advanced>>Data Transfer and Memory>>Data Transfer Mechanism. Set it to be interrupts.
-Alan A.
0 Kudos
Message 4 of 15
(3,704 Views)
sorry but being novice I was unable to locate the sequence you mentioned. wher to click first
Where is counter input?
Thanks.
0 Kudos
Message 5 of 15
(3,698 Views)
Here's a picture that should help you out!
-Alan A.
0 Kudos
Message 6 of 15
(3,691 Views)
Hi,
now after this step, how I set it to interrupt and where should I place this Vi in my code at the end after the while loop?

Thanks for your great help
0 Kudos
Message 7 of 15
(3,686 Views)
Place it before the DAQmx Start Task.vi
-Alan A.
0 Kudos
Message 8 of 15
(3,680 Views)
Hi,
it has not worked -- infact I will tell you little background of my project- I am working on a little robot which is controlled by basic stamp and has two motors, one encoder and range sensor. I have programmed everything in basic stamp editor and I am taking the output from sensors into ctrs to measure the pulse width for the range sensor and number of rising edges for encoder. my crux of basic stamp editor program is as fol:

FOR speed =0 TO 127
COUNT wheel, (Capture */ DurAdj), cycles
GOSUB Get_Sonar ' get sensor value
SEROUT 2, 84,[$80,0,2,speed]
SEROUT 2, 84,[$80,0,0,speed]


Now as you said I have done so and infact I tried to ran the VIs seprately for both the counters and it is generating the following error message
"data was over written before it could be read by the system, if data transfer mechanism interupts, try using DMA otherwise divide the signal before taking the measurement"

Now I have done both way with interupt and DMA it generates same error.

How to fix this error
Thanks
0 Kudos
Message 9 of 15
(3,673 Views)
I don't think you are getting the same error. The first one was about "No DMA channels are available", and the second was about "Data was not transferred fast enough". It appears that you have a bottleneck in your system. It is not fast enough to transfer the data via interrupts, and doesn't have the needed DMA channels to transfer the data via DMA. I would try what the error message suggests, "divide the signal before taking the measurement".
-Alan A.
0 Kudos
Message 10 of 15
(3,652 Views)