Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re : Re: CWgraph!!!!!!!!???????

15 views
Skip to first unread message

Eric_B

unread,
Nov 20, 2006, 6:40:14 PM11/20/06
to
Hi,
 
Here is what I've done to go around this problem:
 
I'm watching the input value for a data change before sending it to the graph. When I see one, I add a new point to the graph with a timestamp just prior to the data change and the old value. I'm sending it 1 second before the data change, but what I'm trending is a boolean input from an I/O controler. You mignt need a shorter delay, perhaps a few milliseconds would be better. After that, I send the new value I've got from the input with his own timestamp to the graph. That way, the plotted data has one point at the begining of his horizontal line and another at the end. No more triangles!
 
I hope this can help.
 
Have a nice day,
 
Eric Brousseau
Software developer,
AIA Automation Inc.

NI_DAQ

unread,
May 30, 2008, 5:10:09 AM5/30/08
to
Hi Eric_B !
                I am also facing the same problem.i mean i have a CWgraph and i want to plot the square wave according to the value getting fromt he card.how do i do that?.can u give me the example code in vb.
               please help me..its urget.
              i hope u will reply soon..
Thanx
Vijay
         

NI_DAQ

unread,
Jun 3, 2008, 10:40:14 AM6/3/08
to
Hi !
                But i don't get any example for getting square wave.there is one example code through which we can generate square wave.
i want to get.i don't want to generate.
 
for example there is one analog input channel through which i am getting 0V and 10V altenatively  with that i want to show square wave.
could u plz give an example code.
     its urget
hope reply soon...
Thanx.
Vijay
          
  

NI_DAQ

unread,
Jun 6, 2008, 11:10:08 AM6/6/08
to
Hi !
          Thank you Very much for your reply..
                              I want to measure the ON time and OFF time of PWM signal which is connected to digital pin.
         How do i do that?.
        Can u give me an example code in vb. what are all the function to be used.
i found one function called "DAQmxCreateCIPulseWidthChan"  but after creating this task how to get the puls width on time and off time.
what is the next function to get that.
 for example
 
1.Creating the task
2.
                   DAQmxErrChk DAQmxCreateCIPulseWidthChan(taskHandle,"Dev1/ctr1","PWM",1,500,DAQmx_Val_Seconds,DAQmx_Val_Rising,"")
3.?
 
after this..what is the next function to get the pw of that signal. and also i want on time and off time.
i am using PCI 6221 card.
 
but i don't want the counter value.
there is one example code but it is not working.....always it gives 0
but when i measure in oscilloscope i am getting the pwm signal.
 
plz...reply soon...its very urgent...
 
 
 
 
Thanx vijay
 
 
 

PBear

unread,
Jun 9, 2008, 1:10:13 PM6/9/08
to
Hi vijay,
 
You can use counters to measure pulse width, frequency, and other time measurements of digital pulses. The NI-DAQmx Visual Basic 6.0 type library is based on the NI-DAQmx C API. Therefore, in addition to the installed Visual Basic 6.0 examples, you can also refer to the NI-DAQmx C API examples when creating a new NI-DAQmx application in Visual Basic 6.0.
 
This should get you going on measuring pulse width. C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Counter\Measure Period or Pulse Width should contain great information
 
Also, if you're creating a pulse train, you should already know the pulse frequency and duty cycle in which you can calculate the on and off time of a PWM. If you set up your pulse train to output at 50kHz with a duty cycle of 25% you'll know that the ON time is 5u seconds and the OFF time would be 15u seconds.
0 new messages