02-25-2009 12:16 AM
02-26-2009 01:15 PM
Hi JamesDean,
Because this can be done with an E-series, it can be done with an M-series, because essentially all you need is 2 counters and a Freqout line, which your device has.
Regarding your fears that this method will only affect the first pulse, and then the other pulses will be in phase: the frequencies of the counters are set to be the same, so the only thing that the Gate pulse does is make the second pulse train start later. This way, you're not cutting in half one of the pulses (as your picture shows), but rather you are starting the first pulse of the second counter later.
The links that you posted are some of the best resources we have. Although someone is bound to have done this before, we unfortunately have no record or code for it. I believe that you could modify the example Gen Dig Pulse Train-Dig Start.vi to include your Freqout and other counter. You would need to somehow trigger your second counter off of a digital pulse from your Gate, and then set your two counters to use the same frequency. I've also been playing with this code, but don't have anything yet that works or is worth posting- if I get this worked out though, I'll be sure to post the code for you on the new NI community . I encourage you to try it out, and post to the community as well if you get something working. Have a good one!
aNItaB
Applications Engineer
02-26-2009 06:40 PM
Hi JamesDean,
I have successfully programmed what you are asking for. The wording of the documents you pointed to are a bit confusing. Ctr0 will actually be triggered off the pulse coming from Ctr1, it will not be gated, which is the situation you described.
I'll clean up my code and submit it to the Developer Zone Community. I won't be able to do it until early next week as I will be out of town.
Hopefully that will help you out!
Brian Spears
NI Certified LabVIEW Developer
NI Certified Professional Instructor
03-03-2009 05:02 PM - edited 03-03-2009 05:03 PM
Encoder | ||
Ctr0 out | PFI 12 | pin 89 |
freqout | PFI 14 | pin 93 |
Counter | ||
ctr0 A | PFI 0 | pin 1 |
ctr0 B | pfi 1 | pin 2 |
03-05-2009 06:49 AM
Hi Brian,
I'm curious if you get the same result when you use a property node to set the frequency as well. Also, are you only seeing this for the 6250 output, or is every pulse train double the frequency that it should be? I noticed that there was a CAR filed on a slightly similar issue a while back for a previous version of DAQmx/LabVIEW, however, if you're only seeing this for the 6250 Hz signal, the two could be related. The program looks great though- thanks for posting it!!
aNItaB
Applications Engineer
National Instruments