LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

synchronizin timed loop

Hello all,

I have few simple questions. I am using Crio-9076 with input card NI9234 and output card NI9263.

You can see my program below.

I have three timed loop. In first loop I am trying to generate chirp signal and send it to analogy output. In second loop I read data from acc. Third loop is UI.

  1. Any idea how I can synchronize 1. and 2. loops so they sample at same time.
  2. Any idea how to get the time (in second) for chirp signals without using elapsed time function.
  3. Is it possible to take timed loop’s time and when it reach some time in second stop the loop ( I am trying to avoid elapse time function)
  4. Any idea to improve my program

I am very thankful in advanced for your helping (example would be very helpful)

Mikko

 

 

0 Kudos
Message 1 of 2
(2,233 Views)

Hey, here are my thoughts:

 

1. There are several things to get synchronization setup, and there are some articles that cover it really well. They discuss how to start the loops together, and how to give them the same timing source so they stay together:
https://www.ni.com/docs/en-US/bundle/labview/page/synchronizing-the-start-of-timed-structures-real-t...

https://www.ni.com/en/shop/labview/timing-and-synchronization-in-ni-labview.html

2. Since you have timed loops, they have a loop period.  You could use loop period and iteration count as one method for determining how much time has passed.

3. Sounds like you want loop 2 to stop loop 1?  You could do that yes, just check to see in there if the time you want has elapsed, and use that to stop loop 1 by writing to the stop2 variable (make a local of it).

4.  I'm not really sure how you are using this program over all (like is there a host VI too that receives data?).  But my suggestions would be that right now it looks like this is a one shot application, you start it up and then there is no way to retrigger your input without just re-running the VI.  I would recommend building some type of state machine so that you can run multiple tests without having to keep starting over the application.  (again though, I really don't know how you plan to use this, I'm just guessing).

0 Kudos
Message 2 of 2
(2,173 Views)