LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI-6602 multiple PWM outputs

I'm trying to Source multiple PWM signals using PCI-6602 card...unsuccessfully.

I have a subVI that outputs 3 PWM signals, on ctr 0,1 and 2, and allows the user to adjust the positive duty cycle on the fly.  This works fine when outside of the main VI.

Once placed into the main VI, which also contains a subVI for digital out from the 6602 among other things, only ctr 0 and 1 run properly of the three PWM outs.  The third signal, ctr 2 flashes momentarily on the scope immediately after starting the main VI, then vanishes never to be seen again...until the next start...for a brief moment.

There are no warnings or errors.  All three signals are defined in the same task. 

I read in some prior posts that each signal needs to have its own unique task.

 This is my first project in LabView and the multiple-PWM-output ISSUE with 6602 has definitely shaken my confidence and enthusiasm in LabView. 

Any help and suggestions would be much appreciated. 

Thanks.

0 Kudos
Message 1 of 5
(2,641 Views)

Hi martzak,

 

My first thought as to why a couple of the counter outputs are working an the third is not is because the ctr2 OUT might be sharing that line with one of the DIO lines that you have configured in your Digital I/O task. On the 6602, some of the PFI lines are shared by counters and the 32 bit digital port. You can see this specified on the device pinout. If you go into Measurement and Automation Explorer and find your 6602 under the Configuration window on the left, you can right click that 6602 and select "Device Pinouts." Take a look at the overlapping pin assignments, specifically for pin 32, which is CTR 2 OUT/PFI 28/P0.28. If there are overlapping pin assignments issues will arise. This could also explain why this subVI works when run on its own and not while the DIO subVI is running as well. Also take a look at the 660x user manual for any other questions about pin assignments and counter information.

 

Chris W

0 Kudos
Message 2 of 5
(2,629 Views)

Chris,

 

Thank you kindly for your prompt response. 

I looked at my pin assignments, there are no apparent conflicts. 

My 6602 PWM out (counter out) assignments are:  ctr 0 (pin 5), ctr 1 (pin 9), ctr 2 (pin 32).  My 6602 Digital out assignments are: DO 0 through 7 (pins 10, 44, 45, 12, 13, 47, 48, 15, respectively).

After looking through the 6602 user manual I found nothing that would indicate why my PWM subVI does not work inside the main VI.

 

...While readying my VI files for your review I took out the 6602 DO subVI and voila my 6602 PWM out subVI works, all three PWM out signals.

That begs another question, looking at the above pin assignments, how can I determine if there is a conflict between my 6602 DO and PWM out?  There are no obvious pin conflicts.  The only thing different about ctr 2 from ctr 0 and 1 is that ctr 2 also has P0.28 assignment, Port 0 line 28, I'm assuming--same port as my DO channels.  Since all of 6602 DIO are located on port 0 does this mean I cannot use any DIO when using PWM out above ctr 1, so any one or all of ctr 2 through 7?  

If that's the case, it's a serious card limitation that I think should be clarified in the manual.

Please advise.

Thank you.

0 Kudos
Message 3 of 5
(2,620 Views)

HI martzak,

 

It still sounds like there is a conflict between the port and the counter 2 out. When you say you are using DO lines 0 - 7, do you mean you are using them in one task? If you've specified in this task something like, "port0/line0:7" then it actually is using the whole port and masking the lines higher than 7. The manual does mention that there is one 32 bit DIO port on the 660x boards. You can get around this by having 8 individual DO tasks in your DO subVI. 

 

Chris W

0 Kudos
Message 4 of 5
(2,601 Views)

Hi Chris,

 

I think I understand now what is happening...for the most part. 

I created two tasks for 6602 DO, one for the DO0.0 line and one for the DO0.1 line.  When using only the task for line 0.0 in the main VI, the 6602 PWM out and DO appeared to be working correctly.  However, as soon as I added the another 6602 DO subvi for the 0.1 line.  My ctr 2 of 6602 PWM 'vanished' as in the original problem.

After that taking out the line 0.1 line  DO subVi did not alleviate the problem.  I progressively took out both of the 6602 DO subVIs from the main VI, and the corresponding tasks and channels from my project until all trace of 6602 DO was gone from my project and main VI, all along the way checking my 6602 ctr 2 output.  Only when all 6602 DO channels and tasks were removed did my 6602 ctr 2 return.  Not sure why this is happening, but at least now based on your explanation and my experience with 6602 DO I will NOT use 6602 DO and PWM out lines at the same time  Fortunately, I was also using 6723 card in my system and ended up using its DO lines, successfully.

Thank you once again for taking the time to dissect this problem and suggesting troubleshooting tips.  Your responses were very helpful.

 

0 Kudos
Message 5 of 5
(2,591 Views)