07-22-2010 02:05 PM
I am using PCI-6229 DAQ card.
1) I want to generate a signal 2. It change from low to high. I want the rising edge only happens at the area where Signal 1 is high.
Also, the rising edge of signal 2 must heppens 2us or more later than the moment Signal 1 rise.
Signal 1 is a 20H Hz, 30% duty cycle digital signal. I use P0.0 to generate this signal.
2) Similar to 1). The difference is Signal 1 is a digital input channel. Also 20K Hz, 30% duty cycle.
Thanks
07-23-2010 04:41 AM
Hi Ossoo,
Is the input signal a dynamic signal or will it always be the same frequency?
The answer to this problem is almost certainly going to involve using the counters on your card, software will not be able to time that close. If the signal will always be the same we could generate a totally independent signal for the output but use the input signal to trigger the start. We can set a delay for the start so if we set the correct delay at the start and neither signal changes then the delay should remain constant.
For example code open the example finder and look in Hardware Input and Output>DAQmx>Generating Digital Pulses>Gen Dig Pulse Train-Continuous-Dig Start.vi. You may need to use the ticks option to create the channel to get the level of precision you require, then set the appropriate start delay for the Create Virtual Channel.vi and set the appropriate trigger line for the start trigger.
If the signal is to dynamic and they need to be more tightly coupled then we can look at a retriggerable pulse generation but this is a simpler method.
Regards,
07-23-2010 12:46 PM
Hi James McN,
Thanks James. I write the VI following you suggestion, which is in the file attached.Gen Dig Pulse Train-Continuous-Dig Start_Counter_2.vi
I think I may not descibe my question clear enough. So I draw the instruction. You can find it the file attached: Des.doc.
But still have problem. It seems the delay time doesn't work.
Could you help me to modify my VI? Also, I have another question. Is it possible to use digital output channel to work as signal 2, rather than a counter?
thanks
Ossoo
07-26-2010 03:39 AM
Hi ossoo,
Thanks for the instructions as I think I may have misunderstood, what is the frequency etc. of the output signal? If it is different then this could be tricky as there is no way to program that 2us limit into the device, only start the signals in such a way that it does not occur. What is this signal connected to?
It is possible to route the counter output to any of the PFI lines if this is what you mean. This is done with the DAQmx channel property node and writing to counter output>pulse generation>output terminal. It would be very tricky to do with a digital task in the first place although if the output waveform is constant we may be able to. This is done with the DAQmx channel property node and writing to counter output>pulse generation>output terminal.
I will have a look into why that delay isn't working, it may be that you can only use the time function to a certain resolution, if so we can set it up using ticks and one of the faster time bases on the card.
Regards,
07-26-2010 05:28 AM
Hi ossoo,
I have confirmed that the timing should be possible using the initial delay by creating the attached VI. This generates a 20kHz pulse train which represents your input signal. This triggers another 20kHz pulse train which starts 2us after the first. This delay will be constant as the two frequencies are the same, there is no corrections after the start.
This at least proves that the delay VI can delay at this accuracy. I think a description of what you are trying to do overall e.g. what are these signals connect to would help me to understand the best solution to this problem. Key really is the relationship between the two signals other than this delay e.g. same frequency? If we can fix the relationship then we may be able to use the method in this VI, or do something with the retriggerable method that you have identified.
Regards,