12-09-2016 04:11 AM
Consider a vi with two main tasks:
1- Handling the user interaction with some controls
2- Performing iterative tasks
For example, a program may have several controls, menu items and ... which could be handled with an event structure easily. Parallel to this, some data should be tranferred periodically (e.g. via VISA Read/Write). The iteration time is low, i.e. 1 or 2 ms.
Which structure is better to implement such tasks:
1- One event structure. The iterative task is performed in Event Timeout call.
2- One event structure + a parallel while loop, each performing one of above-mentioned tasks. The while loop may be controlled (i.e. transfer start or stop) with a flag variable, which is set in the Event structure.
3- Using a while loop and state machine. Event handling is more complicated by this way.
12-09-2016 04:22 AM
@iman_h wrote:
Parallel to this, some data should be tranferred periodically (e.g. via VISA Read/Write). The iteration time is low, i.e. 1 or 2 ms.
That should be all the information you need. If it's supposed to happen in parallell, put it in a parallell loop. 🙂
/Y
12-09-2016 04:23 AM
I would suggest a Queued Message Handler.
12-09-2016 04:27 AM