01-11-2008 07:44 AM
01-11-2008 10:40 AM
Hey,
Maybe the following example of a PWM for an M-Series (out of devzone) will give you some hints or could be used to build up on it.
Christian
01-11-2008 01:08 PM
01-11-2008 01:45 PM
I don't have LV handy and can't look at the example. Also not much time. Just a couple quick notes:
1. Since you know the pulse specs ahead of time N*(L1,H1,L2,H2), it certainly should be possible to use correlated DIO on an M-series board. Crude example: let's round all time to the nearest microsec and then use a counter to generate a 1 MHz sample clock. You just generate an array containing quantity L1 of "F" followed by quantity H1 of "T", then L2 "F"'s and H2 ("T"'s). Then append this array on itself repeatedly until you've got N total patterns.
2. Later when you try to generate 3 independent outputs, you'll need to be careful about the timing resolution. If your first signal's times always rounds to the nearest microsec, but the next one rounds to the nearest 0.1 microsec, you'll need to recalc the first signal's array to be in terms of 0.1 microsec resolution. In the end, ALL 3 SIGNALS will share the same counter sample clock timebase. The pulses that transition less often will just require you to define longer runs of constant "T" or "F" values.
-Kevin P.
01-14-2008 07:35 AM
01-15-2008 05:37 AM
01-15-2008 08:16 AM
01-15-2008 10:51 AM
Rob: I looked at your example earlier when I was near my LV machine. From memory:
1. I think I recall that you specified PFI 2 as the sample clock source for the digital task while using CTR 0 to generate the clock. According to this doc, the default output pin for CTR 0 is "terminal" 2. However, that does NOT turn out to be another name for PFI 2. Rather, terminal 2 is designated as PFI 12 as can be seen here. (This stuff is also visible in MAX when you select your device, right-click and choose "device pinouts").
2. I recall you used a U32 array version of DAQmx Write. You may need to use the U8 version on your 6220 board. Also, the init values you wrote before the loop alternate between 255 (all bits high) and 0 (all bits low). The values you write inside the loop alterate between 1 (LSB high, all other bits low) and 0 (all bits low).
3. You defined the digital task for finite generation, filled its buffer before the loop, then attempted to keep overwriting it inside the loop. These are not mutually consistent. If you want finite generation, fill once only. If you want continuous generation, it'll take some care not to overwrite too soon.
4. Minor nit: It may not matter in your app, but often its best to start up the digital task before starting the counter task that generates its clock. You can accomplish this by simply routing the error cluster from the digital task's DAQmx Start up to the counter task's Create Virtual Channel.
I'm not near LV now to look at the recent example from Christian M. Hope it suits your needs...
-Kevin P.
01-15-2008 10:52 AM
01-16-2008 02:08 AM
Hey,
I'm wondering about this error but attached you will find the ConfigPulse.vi modified according the KB you posted.
Christian