LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

random function generation

Hello,
I am currently using the function generator. vi, available as an DAQ example. What I am trying to develop is a program in which instead of standard signals such as sine, ramp, square, i can generate a random signal. For example, if I want to input a voltage signal with values such as 0.1V, 0.2V,0.3V,5V,7V,10V,2V,0.8V etc. How can I adapt this function generator program for generating a random signal. Or do I have to write a new program. Or is there any other program which is closer to what I need. I dont need the signal to be periodic, I have certain values of voltages which i need to generate in near realtime and once they are generated, the signal need not be periodic. Any help regarding how to develop such a program will be really appreciated.

I am using LabView Express 7.0.

Thank you.
0 Kudos
Message 1 of 11
(4,438 Views)
To build an arbitrary waveform, I would use the Simulate Arbitrary Signal Express VI to build the arbitrary waveform and replace the Compute Waveform.vi in the example with this Express VI. I know that some people have not really used the Express VIs, but this a very useful one.

Hope that this helps,
Bob
0 Kudos
Message 2 of 11
(4,413 Views)
Use the random number generator function in a loop. See Attached VI.

Lynn
0 Kudos
Message 3 of 11
(4,414 Views)
I think, I have not put forth my problem correctly.
What I need to do is to develop a program which will output specific values of voltages one after the other and I should be able to change these specific values. By random function i did not mean, random numbers, what i mean is that the specific values of voltage wont consititute a specific waveform ( such as sine, ramp, square). So i restate, the user ( me) should be able to write specific values of voltages and once all those 15-20 values of voltages are written by the user, the labview program should output voltages in near real time. I think its close to the write-n-update example.
Please help.
0 Kudos
Message 4 of 11
(4,403 Views)
So what you are looking for is a set of DC levels? Send one DC level until you select the next one, right?

Attached is a modified version of the Function Generator.vi example program that should do what I think you are looking for.

Sorry about the misunderstanding.
Bob
0 Kudos
Message 5 of 11
(4,379 Views)
2 things:

1) I was not able to open the vi you sent me in your reply because i am using a 7.0 version which is older than the version you are using. can anything be done about this?

2)You said this vi goes on outputing a particular DC voltage level until i give the next level. Actually i dont want it that way. What i want is the following:
I should supply a set of voltage levels say in the form of a table/array. Then once i run the vi, the VI should take these specified values one after the other and output them one after the other. The preferable lag between output of 2 consecutive voltage levels should be in the microsecond domain. ( something like 5 or 10 microsecond).

Thank you

Ujwal
0 Kudos
Message 6 of 11
(4,369 Views)
Hello Ujwal:

First off, I wanted to clarify that you are trying to build a fairly deterministic operation which Windows is not capable of. You require microsecond resolution while Windows can only do millisecond. This is basically because the program that you write is completely software timed until the command actually reaches your DAQ board. While you are writing these voltages, Windows could easily allocate resources to another embedded program and cause your application to take more than 10 microseconds between each voltage out value. Infact I can almost guarantee you that this will happen because 5 micro seconds is extremely fast. I would advise you to look in to real time systems. You can also obtain one of our high end DAQ Analog Out boards that actually allow you to load the buffer with the samples that you require and then outputs those samples (voltage values) to the respective channel in hardware time. This I believe is the route you should take.

I have however created an example in DAQmx (I am not sure which board or driver you are using) that does exactly what you want to do barring the time constraints. You can open Measurement and Automation Explorer (MAX) while you run this program to view the voltage fluctuation. Also, before you do this, wire the analog out channel (the program uses ao0) to an ai channel and make sure you select that channel in MAX.
0 Kudos
Message 7 of 11
(4,314 Views)
Thanx dimensionfinder. I think if windows allows me to do 1millisec then for now I am ok with it. So, will windows do it in 1 microsecond. I will try out the vi you have sent and will get back with the feedback.
Thanks again.
-Ujwal
0 Kudos
Message 8 of 11
(4,149 Views)
I am trying to generate 2 random numbers between 1 and 50 simultaneously, every 30 seconds.
Can someonehelp me with this? I think I can use the Random() function but I am not sure it let's me generate 2 numbers. Can I use the "sleep" function for the 30 seconds period?

Thanks!
0 Kudos
Message 9 of 11
(4,267 Views)
Not only should you have posted this question to a new thread, I think you posted to the wrong forum. LabVIEW does not have Random() or Sleep. It has a Randowm Number Generator on the numeric palette and the Wait(ms) function on the Time & Dialog palette.
0 Kudos
Message 10 of 11
(4,255 Views)