11-28-2018 07:33 AM
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.
Solved! Go to Solution.
11-29-2018 07:14 AM
This 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.
11-30-2018 04:08 AM
I would try a 4kSPS update rate, a two DO output cycling and send
1100
0110
11-30-2018 06:20 AM
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.