Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI-6221 Digital Output Not Working

Hi,

I am currently trying to create a VI that will output a digital waveform created in LabView using a PCI-6221 with LabView 2018. I also have fed the signal to an oscilloscope and have not observed any signal. To give more context, I’m currently reading in an external clock (confirmed to be working with an oscilloscope as well) through PFI0 and then outputting the digital waveform through P0.0 (Port 0 Line 0). I have confirmed that the hardware connections are not the issue by using NI-MAX’s Test Panels with the Digital I/O tab functions which correctly display a change in voltage on the oscilloscope (5V). I have also used the Hardware Input and Output example in DAQmx: Digital – Continuous Output.vi which did not output anything either. There don’t seem to be any issues with the LabView VI either. In any case, I have attached a VI with what I’m trying to do. Any help would be appreciated and thank you.

0 Kudos
Message 1 of 7
(263 Views)

Yes there are issues with the vi you posted.  Immediately after you start the task, vi execution will end.  LabVIEW's auto-cleanup will then kick in and stop & clear the task.

 

You need to keep your vi executing long enough for the task to do its thing.  Look closer at the shipping example you cited -- that's why it has a While loop after starting the task and before stopping / clearing it.

 

 

-Kevin P

0 Kudos
Message 2 of 7
(234 Views)

Thank you, but even just using the example, there is still no signal being output. I have also attached another vi with the loop as suggested that does not output any signal.

0 Kudos
Message 3 of 7
(228 Views)

That's the same code, still no loop.  As to the example, have you confirmed that the external signal at PFI0 can be recognized as TTL/CMOS digital logic by your device?  You only mentioned confirming it on a scope, which might show the *presence* of signal that isn't necessarily *compatible* with your board's specs for external digital signals.

 

You could try using MAX or a different Counter example to count edges or measure frequency at PFI0.

 

 

-Kevin P

0 Kudos
Message 4 of 7
(213 Views)

Sorry about that. I have attached a new revised version by just modifying the example's write data with a simple square wave which like the example, does not output anything. If the external signal at PFI0 being read in is compatible, the code I attached should output something, correct? I will try to check with the board's specs and compatibility as well. I'm thinking this might be the issue because I'm able to output pulses without the sample clock present with a button like the test panel on MAX which I have also attached. Thank you.

0 Kudos
Message 5 of 7
(54 Views)
Highlighted

I actually found an example program which I also attached to this post with the functionality I'm looking for: https://forums.ni.com/t5/Example-Programs/Write-a-Digital-Waveform-With-a-Specific-Pulse-Width-and-D.... Now I'm not sure if the external signal is the issue because this program still does not work for me despite utilizing a counter. I was able to verify the counter signal was actually being output by checking the signal with an oscilloscope on PFI 12 Pin 2 of my PCI-6221 (68-Pin). There was nothing coming out Ports 0 Line 1 or 2 still. Would the card I'm using be the issue? Thank you.

0 Kudos
Message 6 of 7
(46 Views)

The code you posted in msg #6 "Example_Online_..." looks like it ought to function and generate some changing DO signals.

 

I would normally start suspecting the board at this point, but you've already reported in msg #1 that the board is able to generate DO changes when running in software-timed mode via MAX.

 

The internal clock routing involved in the posted example rules out most other points of suspicion.  Could the board be damaged in a way that allows for static DO but not for hw-clocked DO?   I *suppose* so, but it frankly seems awfully unlikely.  I've not heard of that symptom around here before.

 

 

-Kevin P

0 Kudos
Message 7 of 7
(20 Views)