From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

i am trying to generate an array of 30 random numbers. after every 5 readings a new vi should open and tell the user that 5 readings has been completed. and again carry on with the generation of array.

Solved!
Go to solution

since i do not have a transducer now, i am currently generating an array of 30 random numbers. after every 5 readings a warning should be given to the user that 5 readngs are complete. this cycle should repeat. the array size is 30.

please help me out,  waiting for reply asap.

 

once i have the transducer, i will be taking 30 analog samples and then after every 5 smaples that wraning will be displaye din a new VI

0 Kudos
Message 1 of 10
(3,921 Views)
Solution
Accepted by fdsfdsf

Use a while loop with a time delay representing your sampling period.

Use the count terminal to check if equals 4, so 4th iteration=5th sample.

Use a case structure. The true case will only be executed on the 4th iteration.

In the true case place a subVI  with your desired message in the front panel. Go to the VI properties window and set "open front panel when called".

The closing condition of the warnign is not giving in your description.

 

Consider that rather than usign a subvi for this, you could use the "One/Two/Three button dialog" or "display message" vis at the "dialog and user interface" pallete.

 

Please give it a try and send your own VI. Do not expect us to provide a working solution.

Regards,

Message 2 of 10
(3,911 Views)

Pls, I need a similar assistance. I have my setup which generate certain bits randomly base on certain condition satisfied. Now, I want the generated bit to form an array of bits which are display as string at the end of the simulation. 

 

How can I go about this. Kindly help as this has been giving me a lot of headache for the past few day.

 

Thanks

0 Kudos
Message 5 of 10
(3,784 Views)

@odiseo123 wrote:

Use a while loop with a time delay representing your sampling period.

Use the count terminal to check if equals 4, so 4th iteration=5th sample.

Use a case structure. The true case will only be executed on the 4th iteration.

In the true case place a subVI  with your desired message in the front panel. Go to the VI properties window and set "open front panel when called".

The closing condition of the warnign is not giving in your description.

 


(replying to the old message from 2012.)

Since you know the total number of iterations before the loop starts, a FOR loop would be more correct.

Since you have an array of 30 random number, you can even autoindex on it.

This will only open the dialog on the fifth iteration and not at later multiples of it. Use Quotient and remainder instead to repeat every fifth.

It would probably sufficient to simply use a one button dialog instead of creating your own subVI.

0 Kudos
Message 6 of 10
(3,775 Views)

@taiwoa4u wrote:

Pls, I need a similar assistance. I have my setup which generate certain bits randomly base on certain condition satisfied. Now, I want the generated bit to form an array of bits which are display as string at the end of the simulation. 

 

How can I go about this. Kindly help as this has been giving me a lot of headache for the past few day.

 


Your question is not very similar, so you should have started a new thread instead of adding to one that is already marked as solved.

 

How do you want to display "bits" as text (e.g. zeroes and ones? T&F?).

What is the datatype of your "bits"? (e.g. integer displayed as binary, boolean array, array of 0, and 1, etc.)

How many bits are there? (fixed amount? Pages and pages?)

 

It would be easiest if you would attach a simplified version of your code. You don't provide sufficient infrmation to help you.

0 Kudos
Message 7 of 10
(3,769 Views)

Thanks alot sir and sorry for the way the question was posted as I am new on the forum and could not site a 'button' for posting the question as a new one.  

 

I mean my setup is generating bit "1" or '0" upon meeting a certain condition. The number of bits generated depends on the number of iterations and i would like to make that flexible. Now I would like the generated bits to form an array, i mean a sequence of bits of length based on the number of iterations (number of bits generated). I would like the output to look like the attached image.

 

Thanks  alot sir

0 Kudos
Message 8 of 10
(3,738 Views)

You have not answered all my questions.

0 Kudos
Message 9 of 10
(3,715 Views)

 

 

question; How do you want to display "bits" as text (e.g. zeroes and ones? T&F?).

 

 

answer:   I mean the final result display will be in number bit  "0" and "1"   as shown in the previously attached image and not "zero" and "one"

 

question:   What is the datatype of your "bits"? (e.g. integer displayed as binary, boolean array, array of 0, and 1, etc.)

answer:   the data type is actually a sequence  of "0" and "1"

 

question;   How many bits are there? (fixed amount? Pages and pages?)

answer:  let say 20 bits

 

what I mean is that as the bits are being generated, they are arranged sequentially in order of their generation as shown in the previously attached image. That is, the first generated bit takes the first position  from the left, follow by the second generated one and so on. my problem is how to display the result like that.

Thanks a lot sir

 

0 Kudos
Message 10 of 10
(3,654 Views)