11-22-2013 12:28 PM
Hi.
I need to generate 2 digital waveforms. each waveform is 1 bit.
the 2 waveforms need be shift by 90 degree (like in AB encoder output).
I managed to do it by using signal generation and then converte it to digital waveform.
In order to create in this way two digital waveform shifted i need to use X4 time sampling rate to enable the conversion save the phase.
I would like to generate directly 2 digital waveform 1 bit each with 90 degree phase.
is it possible?
Thanks.
11-25-2013 10:28 AM
Hi barak
I'm not 100% sure of exactly what you're trying to do, but to generate two square waves with a 90 degree offset, I would use the "Signal Generator by Duration" VI.
It allows you to set the signal type (square wave), the frequency, and the phase.
See my code below for a simple example of what I think you're trying to do.
Hope this helps.
11-25-2013 11:59 AM
Hi,
Thanks for your answer.
What I want is to create a digital waveform without generate first analog(your code) and then convert it.
There is a digital pattern generator function that doesn't have the phase parameter, so if i use it there is no way to create 2 waveform with different phase but to generate first analog waveform.
I want to create dircetly digital waveforms with phase without generate analog waveform first.
Thanks..
11-25-2013 12:44 PM - edited 11-25-2013 12:46 PM
Alright, so unfortunately, I don't know of a way to do that eloquently, but I came up with a hack that should generate the waveform you're looking for.
It involves deconstructing the digital data, performing some array functions, and then putting it back together.
Additionally, if you want the waveforms to be separate, you can just use the two 1-D arrays instead of building them into a 2-D one.
Try it out, play around for a bit, and see if this is a possible workaround.