How to generate a random number with at least 6 digits?

Hi all,
All is in the question. :-)
I would like to generate a random number but the function "random
number" in Labview isn't accurate enough.
Do you know an algorithm to generate a random number of 6 or more
digit?
Thanks,
PF

Hi PF,
It's simple. Use 2 random number functions in the same process. Now you
should have 2 distinct random numbers that have the same accuracy. Let's say
LV gives accuracy up to the thousandth (0.XXX), now if you divide one number
by 1000 and then add to the other number you should then have something like
0.XXXXXX. Actually, LV random number function can give up to about 17 digits
(decimal). If you are looking for more digits (>17 digits), the idea above
may not work, then the last thing you may want try is to generate two or
three random numbers then convert all these decimal numbers to fractional
strings chop off the 0 and dot then concatinate them together. After all
it's still a random number. How many digits do you want to get? Make sure
the indicators acce
pt that many digits?
Good luck
Louis.
P-F wrote in message
news:[email protected]..
> Hi all,
>
> All is in the question. :-)
>
> I would like to generate a random number but the function "random
> number" in Labview isn't accurate enough.
>
> Do you know an algorithm to generate a random number of 6 or more
> digit?
>
> Thanks,
>
> PF

Similar Messages

  • How to generate a random number within a specified tolerance and control that tolerance.

    I am trying to simulate data without using a DAQ device by using a random number generator and I want to be able to control the "range" of the random number generated though.  On the front pannel, the user would be able to input a nominal number, and the random number generator would generate numbers within plus or minus .003 of that nominal number.  The data would then be plotted on a graph.  Anyone know how to do this?  Or if it's even possible?
    Just for information sake, the random number is supposed to look like thickness measurements, that's why I want to simulate plus and minus .003 because the data could be thinner or thicker than the nominal.  
    Thanks in advance!!
    Solved!
    Go to Solution.

    You can create a random number with a gaussian probability profile using two equal distributed (0...1) random numbers and applying the Box Muller transform.
    I wrote one many years ago, her it is. (LabVIEW 8.0). 
    Message Edited by altenbach on 04-12-2010 09:13 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    BoxMuller.vi ‏10 KB

  • How can you generate a random number?

    Say I have a timer, and I need it to choose a random number between 100 and 1000. How would I do that?
         timer.delay(***RANDOM***);Thanks!

    I have this, and it's working for me:
    int j = rand.nextInt(500);
    But I actually want it to generate a random number between 100 and 500, not 0 and 500. How could I do this?
    ~Dac

  • How generate a random number that is between 0 and 15! (0-15)

    how generate a random number that is between 0 and 15 ??? (0-15)
    pls tell me, thx!!!!!!!!!!!!!!!!!

    import java.util.Random;
    Random r = new Random();
    int mynumber = r.nextInt()%16;
    For (2^1)-1 number use:
    -> int mynumber = r.nextInt()&15; // speedup

  • How to Build a VI that generates a random number between 1 and 80 ....Help!!!!

    Build a VI that generates a random number between 1 and 80 
    Divides the random number by a number specified in the front panel.
    If the inputted number is zero, the VI program should turn on a LED in the front-panel to indicate a divide by zero error.
    Solved!
    Go to Solution.

    One quick question Edward, was the answer just in time for your monday morning class.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Generate a random number

    How do you generate a random number?

    You can also check out Math.random() which returns a
    double value between [0..1)You could, depending on your needs, but if you do want ints then you're better off using nextInt from java.util.Random, as outlined by the author here:
    http://java.sun.com/docs/books/effective/excursion-random.html
    (and what was wrong with 125?! I thought that was a perfectly fine random number...)

  • How to get a random number in a range?

    as title
    how to get a random number in a range?
    like 2000~3000 thks :)

    int between 10 and 20 with the method Math.random():
    public class Rnd
         // Test
         public static void main(String[] args)
             int start=10, end = 30;
             for (int i = 0; i < 10; i++)
                int n = (int)(start + Math.random() * (end-start));
                System.out.println(n);
    }best regards.

  • How to generate sequence no increased with an increment in o/p file name

    Hi all,
             I am doing a file to file scenario in which my output file name consists of a sequence number which is increased by fixed increment.i  thought of proceeding with variable substitution by writing one udf involving Dynamic Configuration object (the udf describd in Micheal blog).However my problem is that i am unable to generate the sequence number with a fixed increment .plz guide me how to proceed to achieve the desired output filename with sequence number.
    For ex:o/p file name:chxx.bcdtspd.00000002.<datetimestamp>.dat
                                  :chxx.bcdtspd.00000003.<dattimestamp>.dat           
    The scenario is FTP so we cant use addcounter.Plz help as its urgent.
    Regards,
    Saurabh Sharma

    Hi,
    What you can do is.
    U have to use the counter which increment everytime ur mapping is executed.
    Steps which needs to be followed.
    1) Maintain one table at R3.
    2) Pass the control to R3 and update the table value with one.
    3) For the second time fetch the counter value from the table and add 1 to it and again update the table with the increment value.
    4) pass the incremented value to XI and use that counter value for ur file name.
    Here u have to always pass 1 value to R3.
    The method is called as lookup.
    Just go through the below weblog:
    Lookup - /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    Thnx
    Chirag
    Thnx
    Chirag

  • Urgent How to generate a random code such as registration code?

    I would like to ask that how to generate a random code?
    For example, when you register a E-mail account, you need to enter the code for activation. I would like to create a java Bean to do this job. Would you help me?

    In fact, I would like to set a 10 digi codes randomly (such as FH654CS081, MKO624VG9f) for user input when they register the forum account. This random code will be sent to the user's email. User have to input this code to a JSP web site. Also, the code which is inputed by user will be matched with the database. If user input success, the forum account will be activated.
    By generating this 10 digi codes, I want to handle this generation by using java bean.
    1) Any thing else i need to import ? (such as <% page import="java.......?")
    2) Any functions can handle this task?
    3) Any example can be my reference?
    Thank you very much

  • How to generate a random session variable in php

    i want to generate a random session variable and insert the variable in a mysql record to use later to validate an account set up.
    person fills out form to create account and submits; inserts form information in mysql record.
    i want the random variable to be inserted from a hidden field and the page sends an email with a link to click on to compare the variable to validate the user.
    Not sure how to generate a random session variable and get that to the hidden field value to be inserted with the other form information.
    thanks for your help,
    Jim Balthrop

    To insert the key I would personally do something like...
    $key = md5($username . $password . $salt);
    Insert that into your MySQL database, then send them a email with it, my next code shows how to activate it.
    This is to activate the account.
    <?php
    $key;
    $errors = array();
    if(isset($_GET['key']){
         $key = $_GET['key'];
         $sql = 'SELECT * FROM users WHERE key = \'' . $key '\' LIMIT 1';
         $result = mysql_query($sql) or die(mysql_error());
         if(mysql_num_rows($result)){
              $sql2 = 'UPDATE users SET active = 1 WHERE key = \'' . $key '\' LIMIT 1';
              $result2 = mysql_query($sql2) or die(mysql_error());
              if($result2){
                   //successfully activated account
              else{
                   //Something Went Wrong!
         else{
              $errors[] = 'Invaild Key, Please try again!';
    else{
         $errors[] = 'Invaild Key, Please try again!';
    ?>

  • Generate a random number and make it STAY after "save"

    I searched around this forum and found that I can use this code to generate a random number:
    //this.rawValue = Math.round(Math.random() * 1000000);
    Works great. only problem is, once I practice on the "real" form and save, close, and reopen - it changes the random number every time. I need to figure out a way to make it save the 1st number it generates when someone opens the form and types info in it....then they save and close, etc.
    Can anyone help me? Thanks!!

    Example steps:
    1. Add a hidden field to the same subform with name 'hiddenField'.
    2. First time you open 'hiddenField' rawValue will be null.
    3. where ever you run the code to generate random number use scenario like this.
    if (hiddenField.isNull) {
    this.rawValue = Math.round(Math.random() * 1000000);
    }else {
    this.rawValue = hiddenField.rawValue;
    Hope this thelps.
    SekharN

  • Random Number with No Repeate

    Hi, I have made a new class to generate random number with no
    repeate between some x and y number. I want to share with all this.
    let me know incase of any problem. so that i could change this.
    To call the following class you just need to call class as
    follow:
    var randomObj:Random = new Random();
    var newArray:Array = randomObj.getRandom();
    Now this newArray has all the diffrent numbers in each
    location till its length.

    Nothing you say makes much sense. Can you post in your native language and maybe google can translate it better.
    You have more than one structure: a loop and two stacked cases. You have not fully define all possible outcomes:
    number is less or equal 45 and button is not pressed
    number is less or equal 45 and button is pressed
    number is larger than 45 and button is not pressed
    number is larger than 45 and button is pressed
    What does "appear" mean? Should the number disappear if the switch is changed again?
    In your first post you say you want two different numbers, but later you say you only want one number. Please explain.
    LabVIEW Champion . Do more with less code and in less time .

  • How to trace purchase order number with respect to Purchase requestion numb

    Hi friends,
    Can u please help me how to Trace purchase order number with respect to purchase Requetuion  number. Is there any standard report  available in R/3

    Hi Vamsi,
    Thats what!!!
    Goto SE16 - EBAN - Give PR number in the iput screen.
    In the output screen you will have to do field selection from Menu - Settings - formatlist - choose fields.
    There you choose Purchase Order.
    So the output will display for you POs for the PR that you entered.
    Regards,
    Vishal

  • How to generate new perner number using Abap Code in pa0002. what is the fu

    how to generate new perner number using Abap Code in pa0002. what is the function Module used.

    hi
    define internal number ranges for ur implementation then when u run PA 40  do not input any employee number , system will generate the employee number automatically.
    Regards
    sameer

  • How to generate a PRBS signial with arbitrary generator HAMEG HMF2525

    hi, i need help to make the acquisition and signal generation from HFM2525 HAMEG.
    and how to generate a PRBS signial  with arbitrary generator HAMEG HMF2525?

    fafil82,
    What have you done so far?  What NI products are you using?  If you're using ELVIS how does your setup look like?  What is your overall application?
    Jonathan R.
    Applications Engineer
    National Instruments

Maybe you are looking for

  • Windows XP no longer boots

    Sorry I have very little info on the offending PC. Please ignore my sig - that's my own PC, the problem is on a friend's: Have just replaced a faulty Gigabyte GA-8STXC MB with an MSI 845PE. Installation no problem, BIOS no problem, MEMTEST-86 passes

  • Problem finding Gmail website

    Hello, everyone. I am having some issues with Gmail, and one of the possible solutions is to go to Gmail.com, under settings and change some label settings. The only problem is, when I go to Gmail.com, I get this window asking me if I want to sign up

  • Document upload with new authorization type

    Dear All, A document "x" has been loaded in the system with the authorization group "MEIN" . Now the same document is to be loaded in the system with another new authorization type "SWE".While doing so, the version is being taken as "Version 2" .Whea

  • Best practice for adding images to a RH8 HTML project?

    I'm working on a Word to RH8 HTML conversion. The images in Word are SNAG images but the resolution is poor and some of the images may need to be recreated from scratch again. Going forward I imagine I should work on getting them right in Snagit9. An

  • How to write an on card installer

    I am a newer to java smartcard. I need write a on card installer, what is the first step should i do? Can this program be written by c? Where can i find some samples? Thanks!