LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Random pulse width generation

Hi everybody,

 

is there some proper way how to set some deviation to pulse generator and generate pulse train with random pulse width?

 

  • I know I can make it with array pattern (I would not prefer this option)
  • I was thinking about nonstop initialization of DAQmx task with different pulse width (little bit scrapy I would say

Is there more "proper" way how to do this? I need to simulate real sensor output with different length of "switch ON"

state.

 

Thanks a lot for some recommendations! 😉

 

Martin

0 Kudos
Message 1 of 9
(5,117 Views)

What hardware do you have available? What output levels do you need? better yet what sensor are you simulating?


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 9
(5,084 Views)

I am using PXI- 1033 and I just want digital output (5V) pulses with frequency up to 1 kHz with some deviations... So Pulse width of length 1 ms is max requirement and with some deviation up to 10%, so for example random generation of pulses with 0.9 - 1.1 ms with 10 us resolution would be nice.

0 Kudos
Message 3 of 9
(5,061 Views)

Hi mzema,

 

the PXI-1033 is just a chassis, which provides 5 slots for DAQ devices.

What's inside those slots?

 

I just want digital output (5V) pulses with frequency up to 1 kHz with some deviations.

When you want "up to 1kHz" then you will not get "pulses of 0.9ms"…

How much "randomness" do you need?

 

random generation of pulses with 0.9 - 1.1 ms with 10 us resolution would be nice.

Use a card capable of outputting digital signals at 100kHz and send a boolean waveform using DAQmxWrite…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 9
(5,058 Views)

PXI-6251... Sorry for that 😄 I know it is just "bus chasis" for cards... But it is early mornign here, you know...

 

When you want "up to 1kHz" then you will not get "pulses of 0.9ms"…

How much "randomness" do you need?

 

Well, you can. It depends on duty cycle...

With randomness... I wrote "deviation up to 10% with step 10 microseconds".

 

Use a card capable of outputting digital signals at 100kHz and send a boolean waveform using DAQmxWrite…

I need an array first, right? Means I have to exactly define this pattern and deviation first..

 

I was just thinking if there is some function I do not know about... That you have some type of DAQmx task, where you do not just set pulse width, but even that deviation.... But I guess you are right and I will have to go this way...

 

My post was more about find out if there are different and easier ways. Would be nice to have such a function. Maybe that would be nice idea to program such a VI and share it here.

0 Kudos
Message 5 of 9
(5,053 Views)

Hi mzema,

 

Would be nice to have such a function.

I don't agree!

You have functions to output data on DAQ devices (all those DAQmx functions). And you have functions to create/define/generate signals. All you need to do is to combine them as needed…

Why/how should NI embed such "randomness" into a well-defined hardware driver like DAQmx?

 

With randomness... I wrote "deviation up to 10% with step 10 microseconds".

Which kind of "randomness" aka noise? Gaussian? Brownian? White? Pink? Any other color?

That's why I disagree with your "nice to have"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 9
(5,047 Views)

I said I need random pulse width... So I think I defined my problem pretty well.. But I am getting used to this forum and the effort of exaggerated critism.

 

Anyway. Thank you for your input.

0 Kudos
Message 7 of 9
(5,044 Views)

Hi mzema,

 

I said I need random pulse width... So I think I defined my problem pretty well.

And I think you haven't defined your problem so well.

There are a lot of different kinds of "randomness"!

 

the effort of exaggerated critism.

I don't criticize you!

I just tell you where you don't provide enough information to be able to provide good answers… 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 9
(5,037 Views)

Kudo for that!

0 Kudos
Message 9 of 9
(5,033 Views)