LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate digital square wave with PXI-6251?

Solved!
Go to solution

Hi gents,

 

I am trying to generate two square waveforms and my only requirement is to set frequency up to 1 kHz. Nothing more. But I tried lot of DAQmx concepts and I don't understand the principle of different forms here. If I should use some digital waveform and send it to the DAQmx write function, how to use sample clock (if even use). Basicaly I tried things with intuition, but I miss here the principles. Can you please guide me to some point or architecture I can use?

 

Thank you in advance a have a nice day!

 

Martin

0 Kudos
Message 1 of 10
(4,378 Views)

Hi Martin,

 

create a counter output task to generate a pulse trail. You can set it's frequency quite easily then…

(There also are example VIs in the example finder that explain such a DAQmx task.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 10
(4,377 Views)

But how I can create two signals with different phase then? There is no option for standard DIO without using counter?

0 Kudos
Message 3 of 10
(4,365 Views)

Hi Martin,

 

But how I can create two signals with different phase then?

I love it when the OP puts all requirements on the table right in the first post… (Sarcasm! :))

 

There is no option for standard DIO without using counter?

Well, there are surely example VIs that explain the use of "simple" DO channels. Did you examine them?
Yes, you could output digital waveforms too…
 
Btw. why do you think two counters will be "in phase"?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 10
(4,343 Views)

Hi GerdW,

 

thank you for putting more light into this problem so far. I was not able find these examples before. *Blind*....

Anyway, I am now finding out, that I do not know how to properly set the clock source. I have got this error when using refClock and if I use Onboard clock, it returns error too...

 

DO_signal.png

I am using PXI-6251

Martin

0 Kudos
Message 5 of 10
(4,311 Views)

Hi Martin,

 

do you really need to start with a sample rate of 10MHz?

As the error message clearly says you are beyond the hardware limits here.

 

For learning purposes you might start with sample rates of 1kHz!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(4,306 Views)

Yes, you are right, but then I would get this error...

 

DO_signal.png

 

Martin

0 Kudos
Message 7 of 10
(4,303 Views)

Hi Martin,

 

does the example VI use a "10MHzRefClock"?

Don't wire the clock input for a test (or try a different clock)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 10
(4,301 Views)

Well, I am force to have there source. First, it is done in this example and second, it does not work without it.

0 Kudos
Message 9 of 10
(4,298 Views)
Solution
Accepted by topic author mzema

So for this case with PXI-6251 there are two options for digital output with internal clock I tried:

 

  • to use 100 kHz timebase with possibility to dived this timebase by 1-16 ratio
  • to use counter internal clock as recommended above - with Lines PXI1Slot2/port0/line0:1 and data write array (U8 data) for creating reqired signal pattern (0 - low state on both lines; 1 - high state on line0; 2 - high state on line 1; 3 - high state on both lines 0,1)

DO_signal.png

DO_signal2.png

Martin

0 Kudos
Message 10 of 10
(4,276 Views)