LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate Digital Output (HSDIO NI PXI 6535) through two channels with a 90 degree phase shift

Solved!
Go to solution

Good evening, 

 

I have a question:  My requirement is as follows,

 

1. I have two DIO Channels (They're configured to outputs on the fly using DAQmx vis). 

2. I have to generate a 1KHz waveform with a 90 degree phase shift between the two. 

   (DO CH0 - High, DO CH1 - Low)

3. What is the correct way I can accomplish this? Is a software based .5ms delay between the digital output ON state sufficient? Or, Is there a better way of timing both these outputs using the DAQmx sample clock?

PS: If I am to use the sample clock, I will be using the onboard sample clock source. 

PPS: I am alright with fellow members not posting code samples. Just ideas are sufficient along with an illustration maybe since pictures are easier to understand. 

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

Capture.PNGThis is what I am currently trying. I would like to set the same frequency and number of samples to both channels and supply the input for 1 channel as [1,0] and the other channel as [0,1], effectively phase shifting them by 90 degrees when they are started together. However, I am not sure how to accomplish this. 

0 Kudos
Message 2 of 4
(2,551 Views)
Solution
Accepted by topic author newbieprogrammer

I would try a 4kSPS update rate, a two DO output cycling and send

1100

0110

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


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

Here is what I did: Created an array of binary numbers depicting different phases and used 4 lines just for testing. Looped up the samples and fed them to the digital write DAQ function U32 1 channel N  samples. Set the sample clock to finite samples and onboard clock for source. That basically took care of things. 

PS: Thanks for your answer as well Henrik. 

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