LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to produce the digital random generator,which counts 0 and 1 randomly

hi , i want to generate the digital random generator for my project,which counts the 0 and 1 randomly. can anybody help me in doing this.
0 Kudos
Message 1 of 13
(6,580 Views)

Hi ravi bagade,

i'm not sure if i completly understand what you mean, but if you only need 1 OR 0 randomly, then you can use the attached example.

 

Mike

0 Kudos
Message 2 of 13
(6,567 Views)
thanks... i  want to generate the serial 10 bit digital random data ,so that i could see it on digital graph. The block which you have sent produces the 0 and 1, but it is not digital, as it cannot be plotted.  
0 Kudos
Message 3 of 13
(6,555 Views)

Sorry,

but i don't understand it.

If you have a number which type ever, then you can create the digital representation out of it. In your case i think you need 0 to 1023. You can create these numbers randomly with the random block, shown on the image from previous post and multiply the result by 1023. Round it to U16 and create your digtial data from it. After this you can plot it on a digital graph.

 

Try to help.

Mike

0 Kudos
Message 4 of 13
(6,549 Views)

Hi Ravi,

 

random digital signal.png

 

This will create a random digital waveform. Just need to set the Bits, 10 in this case, and sample rate.

 

Rgs,

 

Lucither

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 5 of 13
(6,487 Views)
sir i have generated the serial data. no i am facing problem in sending that data to the daq 6251. also i use the scb 68 cionnector. i want the code do that.
0 Kudos
Message 6 of 13
(6,431 Views)

If you want a boolean out instead of a numeric,

 

Take Mike's first reply (Random -> Absolute Value) and Add an "=0" comparisson on the end, this will give you an array of T/F.

 

Edit:

 

Alternatively If you want it as a different representation, use the adapt to type functions to chane the type.

 

You can always ensure it is whatever numeric range you want if you use the boolean method wired to a T/F comparrison and wire the constant values you want to the inputs. 

 

James

Message Edited by James W on 05-10-2010 11:26 AM
CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 7 of 13
(6,408 Views)

Arghh

Timed out when I was editting again to add a pic

 

James

Digital_value.PNG

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 8 of 13
(6,399 Views)

Your question has been phrased in a way to cause confusion to what you actually want to achieve. Are you trying to display the random generator like a bit stream on a graph ie:

 

Random Graph FD.JPG

 

If so then this vi will do that:

 

Random Graph.png

 

Every time you press the 'Generate' Button it will create a digital array according to the 10 bit random number generated and display on a graph.

 

There is a way of doing this using a 'Digital waveform graph', i personally have never used it and after about 5 minutes of just looking into it for you gave up Smiley Sad It is something i should spend the time to look into as it presents your digital data nicely, showing the 0's and 1's within the graph.

 

If i have misunderstood what you want again i apologise

 

Rgs,

 

Lucither

Message Edited by Lucither on 05-10-2010 06:27 AM
------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 9 of 13
(6,378 Views)

ravi bagade wrote:
hi , i want to generate the digital random generator for my project,which counts the 0 and 1 randomly.

 

 
 A digital random generator does not "count", but "generate". Your question makes no sense.
 
To generate random 0,1 data, have a look at the "Bernoulli Noise" from the signal generation palette.
0 Kudos
Message 10 of 13
(6,375 Views)