취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

Event Structure in Timed Loop

해결 완료!
솔루션으로 이동

Quick question about timed loops\event structures

 

Is it a good or a bad idea to use Event structures in timed loops - as opposed to while loops.?  I guess I like the idea of timed loops - since you can set their priority - so if there is important stuff you need 100% priority in the background - but for ui you can set it to run slower\or run at a different priority level.

 

Just wanted to check there isn't a reason why i shouldn't be doing this - since all the examples don't do this.

 

JP

0 포인트
1/5 메시지
3,783 조회수

It wouldn't make sense to put an event structure in a timed loop unless the event structure had a timeout. That will cause a switch to the UI thread. You probably don't want any code in your timed loop to run in the UI thread.

=====================
LabVIEW 2012


0 포인트
2/5 메시지
3,774 조회수
솔루션
주제 작성자 wideofthemark이(가) 승인함

I don't think this is a good idea. Your timed loop can stop completely waiting for an event. There is no benefit of placing the event structure in a timed loop. It is possible to assign priorities to other objects besides timed loops. For instance, you can assigned priorities to subVIs. I'm reasonably sure that the event structure can run at other priorities provided you are not doing any UI activities. Perhaps someone from NI can confirm this.

 

But the purpose of a timed loop is to have a deterministic periodic task. The event structure should be used for asynchronous events. The two are at odds with each other if they are in the same task.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
3/5 메시지
3,767 조회수

@wideofthemark wrote:

Is it a good or a bad idea to use Event structures in timed loops


bad.  +1

0 포인트
4/5 메시지
3,748 조회수

Thanks everyone for the advice.  I guess I understand things better now - I think you are right that it doesn't make sense to have the two things together - although I have to say it doesn't really seem to have made a significant difference to how anything is running at the moment in my code.

0 포인트
5/5 메시지
3,700 조회수