LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

generating swept sine wave

Is there any other way to generate these data in real time?
0 Kudos
Message 11 of 16
(1,335 Views)

For synchronization purposes, you'd probably be better off with one loop.  However, to maintain synchronization with two loops, you'll want one to wait on the other until a flag is set/reset.  This will introduce handshaking in your loop which would at least ensure that you don't miss your data points.

 

What is your actual end-goal with this?  That may lead to some better ideas.

Regards,

Jared Boothe
Staff Hardware Engineer
National Instruments
0 Kudos
Message 12 of 16
(1,304 Views)

thanks for the reply. goal of my vi is to acquire 3 signals continously in a while loop and then process those signals ( filter them and multipying those signals with some gain). and then i want to create custom function ( impulse ) in realtime and add it to processed signal and output the result to a motor using daqmx ( system should run continously untill user stops). I am using daq assistant  express vi to aquire and generate in one while loop. I have posted my code before.
0 Kudos
Message 13 of 16
(1,299 Views)

suni,

 

Is your custom function different every time the loop runs, or will it be the same function, or the same set of functions based upon some parameters?  If you are needing to continuously acquire but also process and then output, I agree that the two loops might be the better way to go.  You might look at a producer-consumer style architecture.

Regards,

Jared Boothe
Staff Hardware Engineer
National Instruments
0 Kudos
Message 14 of 16
(1,290 Views)
Thanks for the reply. custom made function depend on the prameters that user inputs before the simulation begins. After that they stay the same. problem i am having right now creating thease custom functions in real time. i want this system to run in real time. I am acquiring data from three sensors continously using daq assistant express vi 100s/s and 50 samples per channel. Is this the best way to do real time system? right now system react slowly for when i change joy stick input ( one of the sensors). is there any othere good procedure make system respond faster?
0 Kudos
Message 15 of 16
(1,278 Views)

suni,

 

If the functions only depend on the inputs before the simulation begins, you can create this function outside of your main while loop.  Then pass the functions to the while loop and use them when you'd like.

 

Also, as far as "Real-Time" - your system will not run in true 'Real-Time' unless you are on a RTOS.  If you are using the Windows OS, you will not be 'Real-Time'.

 

As far as the system reacting slowly to your inputs, this is entirely dependent upon when those inputs are being read.  There is going to be delays through your program, and if you need a particular input to be as fast as possible, then that reading should be in its own separate while loop so that its speed does not depend on other factors.

Regards,

Jared Boothe
Staff Hardware Engineer
National Instruments
0 Kudos
Message 16 of 16
(1,258 Views)