LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control the Timing of Table update

Solved!
Go to solution

I write a vi program to reed data from serial port and update a Table every 2 minute. whole program work successfully only need to know how to control the timing of table update without effecting the timing of main loop. when i use wait time function it slow the timing of whole loop.

0 Kudos
Message 1 of 3
(2,102 Views)
Solution
Accepted by topic author kg300

Hi kg,

 

I write a vi program to reed data from serial port and update a Table every 2 minute.

Use ElapsedTime set to count for 2min=120s and AutoRestart. Every time it says "time elapsed!" you update your table (using a case structure).

 

On your VI:

Why is the table a control when you want to use it as indicator?

Why is there a wait function in the loop? Your loop rate is determined by VISARead function…

There is no VISAClose function to cleanup resources after usage!

Why do you use InsertIntoArray instead of BuildArray?

There is no size limitation on your array data: how long will/should that VI run? How much data do you want to collect?

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(2,097 Views)
  • Your table is used as an indicator, so change it to an indicator (right-click...change to indicator)  and get rid of that local variable.
  • "Built array" is more logical than "insert into array" here.
  • You can place the table indicator inside a case structure and make it the active case occasionally (e.g. based on iteration count or elapsed time.)
  • Do you want to only add one entry every 2 minutes or do you want to update with all entries received during the previous two minutes. Place the case structure accordingly.
0 Kudos
Message 3 of 3
(2,096 Views)