キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Labview

解決済み
解決策を見る

Hi friends,

 

How much time one iteration of while loop?

 

Have a nice work.

0 件の賞賛
メッセージ1/10
4,637件の閲覧回数

It completely depends.  What is in the loop?

 

In short, a While Loop cannot iterate until EVERYTHING inside of it completes.  So if you have a wait for 1 second inside of your loop, the loop will iterate at around 1 second.

 

3 Hour Introduction
6 Hour Introduction
LabVEW Basics
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training
Learning NI
Getting Started with NI Products



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 件の賞賛
メッセージ2/10
4,632件の閲覧回数
Please use something other than 'LabVIEW' for a subject. Every post here is related to LabVIEW.

Your question does not make much sense. The iteration time is dependent on what is inside the loop as well as the processor in the pc. It is also something that you can easily test yourself. Do you have a specific VI?
メッセージ3/10
4,628件の閲覧回数
解決策
受理者 star-123

Do you want to measure the loop time of an existing while loop?

 

try this:

 

0 件の賞賛
メッセージ4/10
4,615件の閲覧回数

Is the code for one iteration?

0 件の賞賛
メッセージ5/10
4,575件の閲覧回数

Did you try it?

 

(Learning by doing is a concept often used… :))

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 件の賞賛
メッセージ6/10
4,570件の閲覧回数

@1085 wrote:

Is the code for one iteration?


It updates with each new iteration, measuring the time difference since the same code was called the last time, i.e. in the previous iteration.

 

I typically use a custom format of "%.2ps" or similar for the time display. (right-click...display format...advanced editing mode). This way it displays in nice si units (200.00ns, 12.40ms, 3.12s, etc) 

0 件の賞賛
メッセージ7/10
4,520件の閲覧回数

Also note that execution times depend a lot on the system you use if you have no wait times included in the loop.

 

Long story short:

You cannot tell in advance how fast a single loop iteration is on your machine until you test it.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 件の賞賛
メッセージ8/10
4,513件の閲覧回数

In addition the loop time can change from iteration to iteration depending on what background processes are running on your PC.  A virus scanner starting up or an OS auto-update can slow down your loop significantly in some cases.  If you need deterministic operation you'll need a Real-Time PC/OS.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 件の賞賛
メッセージ9/10
4,479件の閲覧回数

I think you guys are way overcomplicating the discussion. There was never a question on how to reliably keep a fixed loop time or how to run (or not run) the loop as fast as possible.

 

All he wanted is to measure the actual loop time (e.g. for benchmaking or validation, I guess).

It was a measurement question, not a control question and consisted of only eight words! 😄

 

Once the actual measurment results turn out to be puzzling (e.g. too much jitter, longer than expected, etc.) we can revisit this disucssion.

 

0 件の賞賛
メッセージ10/10
4,471件の閲覧回数