LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

generate Numbers

I have created a formula in Labview to calculate the temperature of cooled oil.
Now i want to simulate the hot oil, for example that labview generates numbers between 2 value's let's say that the temp. differs between 70 and 100°C how do i do that ?

This is the formula shown in the Vi.

The DBL with the name "Temp. Hete Olie" is supposed to vary between 70 and 100. in a continuous proces.

http://users.pandora.be/VanSon/Wamrtewisselaar.vi

Message Edited by John_B. on 02-05-2006 07:41 AM

0 Kudos
Message 1 of 11
(3,950 Views)

Are you trying to generate a random number between 70 and 100?  If so, take the Random Number (0-1) function in the Numeric palette, multiply it by 30, and add that result to 70.  That should give you a random number between 70 and 100.

Good luck,

-D

0 Kudos
Message 2 of 11
(3,922 Views)
Ok ty, that works, only it changes a bit too fast imo, can you slow down the speed of wich the numbers change ?
0 Kudos
Message 3 of 11
(3,913 Views)

If you're generating the numbers in a loop, use the "Wait" function in the loop.  Search the palettes for "Wait" if you can't find it.

Good luck,

-D

0 Kudos
Message 4 of 11
(3,905 Views)
Would it also be possible to genereate the numbers in the form of a sine ? so taht for example the numbers rise from 70 to 100, and then back to 70, etc.
cause now it goes from 70 to 80 to 75 to 95, hard to simulate a proces 🙂
0 Kudos
Message 5 of 11
(3,878 Views)

Hi John,

You have a few options here.  One option is to use the Simulate Signal Express VI (Express > Input  palette) to generate a Sine wave with an amplitude of 15 and an offset of 85.  You would have to convert this wave into an array and index a loop with its values.  Another option is to use the Sine function (search the palettes, as its location varies depending on your LabVIEW version) and do some math on the iteration value of your loop to have it return values in the proper range.  Still another option is to use the Waveform VIs...specifically, the Sine Waveform.vi (in the Waveform > Analog Waveform > Waveform Generation palette).

See which of these works the best for you.  You'll probably get the best performance by using the Sine function and doing the math yourself, but the other options would probably be easier to program.

Hope this helps,

-D

0 Kudos
Message 6 of 11
(3,871 Views)
You could use the simulate signal express vi to generate a sine wave.  Set it for an amplitude of 15 and an offset of 85 so that it ranges from 70 to 100.  You can adjust the frequency and sample rate to simulate your process.  It will even allow you to add noise.  Simulate Signal can be found on All Functions | Analyze | Waveform Generation
----
I am the founder of CnCSoftwareSolutions. When not cleaning up baby drool, I write about test data or work on Vision, a tool for understanding your test data. Visit me at www.cncsoftwaresolutions.com
Message 7 of 11
(3,870 Views)
Hey, i used the sine waveform.vi but now i try to compare it's value, like if it goes above 80, it has to change something. but with the comparison 'greater' it doesn't work, i think because i want to compare a waveform with a number. how do i convert it ?
Message 8 of 11
(3,856 Views)

Hi John,

The waveform output of Sine Waveform.vi will have a t0 value, a dt value, and a Y array that contains all the points in your sine wave.  You can use the Get Waveform Components function (in the Waveform palette) to get the Y array, then you can index those elements in a loop and check them one at a time against a scalar value...alternatively, you can wire the Y array into the top input of the Greater Than function, and wire the comparison number into the bottom input, and the Greater Than function will output an array of booleans indicating which values were greater than the comparison number.

Hope this helps,

-D

Message 9 of 11
(3,843 Views)
I have another question. i have a numeric control where i put in a value, but if the temp rises, wich i detect with greater then or so, i want to increase the value of the numeric control. is there any way to do it ? i can't find it.
0 Kudos
Message 10 of 11
(3,825 Views)