LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why is there such a delay writing and reading a PWM signal to digital input?

Solved!
Go to solution

Hello!  I am trying to read in and take measurements on a PWM signal.  The equiptment I will have access to: 9201, 9425, and a NI cDAQ 9172 chassis.

 

This is kind of what I'm experimenting with now (I am testing with a USB 6211 device).  Does anyone have a better idea of how to do this?

 

The problems I am encountering:

1) there seems to be so buffering issues?

2) It is taking too long.

 

Attached is my vi.

 

Thanks in advance for any help you can give.

 

Also, in my final application, I will not have to create the PWM signal - that is just to test the aquisition currently.

 

0 Kudos
Message 1 of 7
(2,884 Views)
Solution
Accepted by topic author ALTCengineer

Try using the DAQmx functions directly instead of the DAQ Assistant.  They're a little more work to learn but are more efficient.  Your 6211 can generate a PWM signal in hardware, so use that (see the LabVIEW examples).  Finally, of course there's going to be some delay in your code.  You're reading at 1.5k samples at 1k/second, so each loop cycle will be 1.5s.

 

EDIT: by the way, why do you write 1k samples, and then read 1.5k, both at 1k/second?  That means your output isn't going to be generating any signal for long periods of time...

0 Kudos
Message 2 of 7
(2,873 Views)

Hi ALTC,

 

are you in any way related to JPISU?

Using the same hardware on the same problem asking questions at the same time in the same forum?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 7
(2,867 Views)

And to add to my last message:

Using a very similar VI with the same ExpressVIs, the same badly formatted BD elements, the same approach of pulse detection, the same table display...

 

Why not ask in the same thread, why not work and act as a team?

 

 

Better ideas:

- don't use ExpressVIs

- when it "takes too long" you should use smaller number of samples at reading

- can't look into the DAQ assistents right now but I bet there's the problem...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 7
(2,861 Views)

I have this timing set up because there was a greater buffering problem otherwise.  Would you reccomend generating fewer samples then checking?

0 Kudos
Message 5 of 7
(2,834 Views)

I guess another overarching question would be: what is a better way to be doing this?  using an analog or a digital input?

 

ALTCengineer

0 Kudos
Message 6 of 7
(2,831 Views)

GerdW,

 

Previously on this thread, someone said the same thing - why would you reccomend NOT using express vi's?  Just efficiency?  I have a modest background in programming, though I admit the visual representation is throwing me for a loop!

 

Thanks for your help in this matter and have a pleasant day 🙂

 

0 Kudos
Message 7 of 7
(2,819 Views)