LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

create pulse with 6542 card

Hi just wondering if you can create output pulses that are in sync with a clock in signal input (all TTL) with the 6542 PXI card?  For example control the pulse width and delay with reference to an input clock signal?  If so any examples, thanks.

0 Kudos
Message 1 of 18
(4,030 Views)

Have you taken a look at the specs? That card has numerous trigger sources. Have you installed NI-HSDIO? For LabVIEW there's a "niHSDIO Configure Trigger" VI to configure the trigger. NI-HSDIO does install examples, so you can use the Example Finder to find examples.

0 Kudos
Message 2 of 18
(4,020 Views)

thanks for the information, I was able to read data in using the PFI 3 line for a trigger source.  I am trying to create a small pulse aproximately 1 ms after the falling edge of the clock.  Can you control the pulse width of the output pulse? 

0 Kudos
Message 3 of 18
(3,991 Views)

@svt4cobra6 wrote:

.  Can you control the pulse width of the output pulse? 


Yes.  Set the appropriate clock frequency to get the desired pulse width.  1 mS pulse width is a 2mS cycle, assuming 50% duty cycle (1mS on and 1mS off).  This corresponds to a 500Hz rate,

- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 18
(3,981 Views)

thanks for the information, kind of just getting started but looking for a simular example, any idea what functions to use within labview?

0 Kudos
Message 5 of 18
(3,974 Views)

There are many DAQ examples for digital inputs/outputs.  Under the help menu, click on Find Examples.  Search for digital output.  You will see many example VIs.

- tbob

Inventor of the WORM Global
0 Kudos
Message 6 of 18
(3,966 Views)

Hey svt4cobra6,

 

Do you need the 1 ms pulse to go out on a PFI line? If not, I would recommend using one of the data lines on the 6542 to create your pulse. As smercurio_fc mentioned earlier, you can use the Example Finder, and browse by task, then go to the Hardware Input and Output -> Modular Instruments -> NI-HSDIO (High-Speed Digital I/O) folder. Here is where you can find a lot of examples specific to the HSDIO device you are using. For your application, it sounds like you want to do both generation and acquisition, so check out the folder that says Dynamic Generation and Acquisition. One good one you could use to kind of simulate the device you will eventually hook up is the "Dynamic Generation and Acquisition - Source Synchronous". This example is probably not going to do exactly what you need it to do, but you can get some ideas from it, like how to export a clock with your data, or input a clock from your DUT, and how to use a trigger for when to acquire data.

 

Now this source synchronous example uses Strobe as the Acq clock, but if you want to generate data based on an external clock, you will probably want to check out the "Dynamic Generation with External Sample Clock" example (found in the Generation -> Non-Scripted folder). If you are basing your pulse off of an external trigger and an external clock, you should check out the Specifications (Start -> Programs -> National Instruments -> NI-HSDIO -> Documentation -> Specifications) of your device for the Delay from trigger to digital data output, to make sure you can account for this if you need to.

 

For the acquisition of your serial data, that also has a chip enable, you could check out the Dynamic Acquisition Hardware Pause Trigger, if you want to acquire data when your chip enable line is high, and then not acquire (or pause acq) when that line goes low.

 

Now back to my recommendation for using the data lines as your pulse generator instead of a PFI line, you can use the onboard clock rate, let's say you use the max rate of the 6542, which is 100 MHz, which will generate samples every 10 ns, you can generate 0's until you are ready to output your 1 ms pulse, and then you would generate 1's, as many as you need for your 1 ms. I'll let you do the math. If you don't want to "oversample" this much, then you can slow down your clock rate to maybe 10 times your 1 ms pulse, which you would then output 10x "1's" for your pulse, and then however many 0's before and after your pulse. So basically all you are doing is using data (0's and 1's) to build your pulse. You could also use the Digital Waveform Editor to help you do so. One advantage of using a data line to generate your pulse is that you can vary the pulse width by adding or removing 1's, and when you are running at 100 MHz, you can get 10 ns steps of how much you want to change your pulse width.

 

Again, there will probably not be a specific example that does your exact example, but by using bits and pieces of the existing examples, you should be able to figure out which functions you will need to do what you want. Finally, if you are just getting started, I recommend not only looking at a bunch of the HSDIO Example programs, but also the NI Digital Waveform Generator/Analyzer Help document (or the online version), as there is a ton of great information in there about your HSDIO device, like how it works, what features it has, and how to program it. I hope this helps. Please let us know if you have any further questions or concerns. Thanks, and have a great day.

 

Regards,

DJ L.

0 Kudos
Message 7 of 18
(3,957 Views)

I think I can use the data lines on the 6542 to create the pulse.  Also it sounds like I can get the resolution required by the suggested approach.  I do need to sync the 6542 output pulse with an input clock signal (low clock rate).  Will this still work with the described method? 

Thanks.

0 Kudos
Message 8 of 18
(3,920 Views)

Hey svt4cobra6,

 

If you want to oversample your output data, which will be your pulse, and have that be based on your input clock, then you should consider using the CLK IN (on the front panel of the device) instead of Strobe, and then you can use this clock as a Reference Clock to your generation session, as well as a sample clock for your acquisition session. Look for the Dynamic Generation with Reference Clock example for help on how to do this. Again, you will have to combine all these things to get your code to work the way you would like. Hope this helps. Please let us know if you have any further questions or concerns. Thanks, and have a great day.

 

Regards,

DJ L.

0 Kudos
Message 9 of 18
(3,911 Views)

I have a minor issue, my clock signal that I want to feed into the clock in on the 6542 card is only around 6k but in the user manual it specifies 20k as minimum clock rate for clock in.  Can I use the strobe input instead?  I need to synchronize the output pulse with this clock input, thanks. 

0 Kudos
Message 10 of 18
(3,870 Views)