Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic square wave generator with PCI-6509

G'day all,

 

I've spent the last day and a bit setting up my new (to me) PCI-6509. I have MAX setup and running, and have successfully tested digital output on a number of pins using the Test Panels. I've not used Labview before, so this next part is where I come unstuck.

 

I've currently got a trial version of Labview NXG installed, as well as the required NI-DAQmx drivers, etc., which is working as desired (i.e. I can create a Digital Output task in Labview and toggle a pin on the 6509 as HIGH or LOW). What I'm looking to create is a pulse/square wave generator, which simply toggles the pin output HIGH/LOW at a specified frequency and duty cycle. I've come across examples both online and in the Labview (and Labview NXG) example set, but they tend to use hardware counters, of which my PCI-6509 has none.

 

As such, can anyone recommend or link me to a software-driven digital pulse generator VI that I can setup in Labview NXG without too much fuss? The aim is to review how a functioning generator works before I start developing further for my needs.

 

Thanks!

0 Kudos
Message 1 of 4
(2,388 Views)

Hey Jars,

 

I suppose there are a couple way's but here is a way from LabVIEW Current Generation on how to do it.  You may consider converting the code to NextGen and seeing if it fits your needs.

 

Otherwise, I would just setup the DO task in LabVIEW NextGen and have a control on the loop rate for controlling the digital frequency and then just toggle between true/false to create the pulses.

 

-Bear

Regards,

Ben Johnson
ʕง•ᴥ•ʔง
0 Kudos
Message 2 of 4
(2,361 Views)

Thank you very much for your input, it's greatly appreciated!

I've reviewed the linked example on the NI website, and it appears to make sense. Unfortunately none of the elements in the provided Diagram screenshot from LabView are recognisable or make any sense to me, so I don't think I'll be able to recreate in NXG. If the example had an attached .vi I'm sure I'd be able to sift through the detail and make sense of it.

Your recommendation to simply toggle a TRUE/FALSE write makes the most sense, and is what I'm currently trying to build. I've setup a While Loop, and connected my Digital Output Task to a DAQmx Write (Digital Bool 1Line 1Point) function. I've added a simple Switch as the data input to the DAQmx Write function to confirm it works, as I can manually create the square wave by physically toggling the switch ON/OFF with my mouse cursor.

I've been trying to automate the toggle ON/OFF but haven't yet had any luck. Can anyone recommend a way to toggle a suitable Digital Bool value at a specified frequency?

0 Kudos
Message 3 of 4
(2,355 Views)

Never mind, I've now got this very rudimentary square wave generator functioning successfully 🙂

 

 

0 Kudos
Message 4 of 4
(2,354 Views)