LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing the pulse width of a counter on-the-fly - ?

I'm seeing strange behavior when trying to change the pulse width of a counter while it is running continuously.  Using the property node I can set the DAQmx Channel Properties "Low Time" and "High Time" when the values are changed by the user (see attached VI).  The first change is ignored initially, but then applied when a second change is made, i.e. the changes are applied one step late.  If I read the respective properties the values are what is set but not what is being generated and seen on an o-scope.  I added a condition of watching the property "Ready For New Value" before applying the change, but that doesn't alter the behavior.  What am I missing?

Windows XP
LabVIEW 7.1
DAQmx 7.4.0f0
PCI-6251

Thanks,

DTL
0 Kudos
Message 1 of 4
(3,017 Views)
Hello Pioneer,
Here is a great tutorial on PWM with NI-DAQmx, and changing pulse specs on-the-fly.  Oh, and one thing I noticed about your program, it isn't updating the pulse specs on the first iteration because all it does is read the values (with the global variables), then pass those values to the next iteration of the loop with the shift registers.  So the way the logic is set up now, it should update the pulse specs on the second iteration after they have been changed.  Hope this helps.
-Alan A.
0 Kudos
Message 2 of 4
(3,001 Views)
Alan,

Thanks for the reply.  I don't know if I explained in well in my previous post, but I'll try to confuse again: The issue is that the property node change is reflected on the hardware (pulse output) one change delayed.  Example: Start the VI with time value A.  The user sets the time to value B, the property node read for the time will read value B, but the output pulse (hardware) stays at value A.  Then the user sets the time to value C, the property node read is C, but the output is now B, and so on...

I've worked with the DAQmx Write, as the example you pointed to shows, and it will work properly (reflect the change immediately on the hardware).  If one replaces the DAQmx Write to a Channel Property Node it will start working as I described above (change reflected one change delayed).  Note: A subtle additional change is that I have changed everything to Time (High, Low) instead of Frequency (Duty Cycle,  Frequency) - ?.  Note 2: DAQmx Write doesn't bring out all the properties - what if I have to use a property node?  Do I need to "double pump" the values?

FWIW,

Don
0 Kudos
Message 3 of 4
(2,996 Views)
Hello Don,
I'm not exactly sure what is going on with the property nodes.  I would suggest going with the DAQmx Write method for updating the pulse specs.  There shouldn't be any type of pulse train that you wouldn't be able to create with that method (maybe some math involved).  🙂
-Alan A.
0 Kudos
Message 4 of 4
(2,980 Views)