LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SIT Real-time data logging and passing data

Hello all,

 

I am pretty new to LabView real-time, so I just want to confirm a few things. I am also using the Simulation Interface Toolkit.

 

Let's take the Sinewave.vi from the SIT examples. I have modified it to use sinewave.dll, and run on PXI-8101. If my understanding is correct, when I click "Play", the entire Sinewave.vi is deloyed into PXI-8101, and therefore the entire VI is running at the same pace. The front panel I see on my desktop is slower snapshots of what is actually happening?

 

1) Let's pretend now that the sinewave model is time critical and must run every 10ms. How do I do that? I have noticed that within the "SIT_Indicator_Indices" loop, there is a Wait 50ms block. Is that accurate?

 

2) I have also added a time elapsed block that will change the Frequency and Amplitude inputs as a function of time. I made them update every 2ms. What clock are we running on? If my sinewave.mdl suddenly calculate integration (time dependent), can I use that elapsed time block as my timer to pass into the model?

 

3) How fast is the sinewave.vi running anyways?

 

4) Let's say I want a log of the sinewave output (a data point every 10ms). I don't need the log in real-time, I just want to do some analysis on it later. How do I do it?

 

Thanks.

0 Kudos
Message 1 of 5
(2,426 Views)

Hi Bladhart,

 

When running the in the Development Environment (pressing the run button on the Real-Time vi) there will be an extra thread to handle the front panel you see. This thread will be handled just like any other thread in Real-Time and will take processor time, thus slowing down your entire application to a certain extent.  

 

1. You would need to make sure everthing inside the loop can execute within 10ms and change the wait time to 10ms. Or you can use a timed loop set to run every 10ms and get rid of the wait time but again you would need to ensure everything in the loop can execute in under 10ms.

 

2. The elapsed time should be running off the Real-Time system clock. 

 

3. The time that the Sinewave.vi is running is system dependent, there is no set speed.

 

4. You can log the data by saving to a *.tdms file. You can then use the data from the *.tdms file to do processing later. 

 

<Brian A | Applications Engineering | National Instruments> 

0 Kudos
Message 2 of 5
(2,403 Views)

I have a follow up question on you first comment.

Since my front panel is not time critical, but my model is, is there anyway to tell Labview that I want it to not run the front panel thread unless the model calculation is done?

0 Kudos
Message 3 of 5
(2,400 Views)

Also, how do I set up the *.tdms file?

0 Kudos
Message 4 of 5
(2,390 Views)

You can use timed loops to set the priority of your time critical loops to a high value. Then it will execute those first then update the user interface if it has time. You need to be carefull with this though as you can get into cases where the high priority loop does not give any time to the user interface and then your system is esentially locked up. So if there is nothing internal to that loop to stop it or give more time to other resources you will have to reset your controller to stop it. 

 

As for saving to *.tdms files, there are several examples on how to acomplish this in the NI example finder under Fundamentals » File Input and Output. I would suggest looking at Write TDMS File.vi first as it is the most basic. 

 

<Brian A | Applications Engineering | National Instruments> 

Message 5 of 5
(2,384 Views)