LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

mult thread criteria and timing in program

 I am newbie in LabwindowsI know multi thread means multi-tasking. But I really do not know practically what part of the of the program to be threaded.

 

Suppose I want to build a User interface with Labwindows for  seeing the data(input/output, parameters, variables. flags) of a  microprocessor of an embedded system,  and edit variable and parameters and send it to the  microprocessor and update value again to be shown in the user interface.  Then  does it need to be multi-threaded and what part of the program to be threaded and why  and what are the criteria. How timing  to be  calculated for the entire project to considering the multi thread.

 

If anybody please explain, it will be great help.

 

Thank you.

0 Kudos
Message 1 of 4
(3,456 Views)

Multithreading is a powerful addition to applications, as it permits to divide the program into separate activities that can run independent from one each other. Nevertheless, it is an advanced technique that requires a good programming knowledge to be implemented in a proper way. If you are new to CVI I personally suggest not to approach multithreading among the first things; you should go through single-threaded programming and use of timers and asyncronous timers before this, in order to achieve a good skill on fundamental instruments CVI offers before switching to a multithreaded framework.

 

In case you want to approach multithreading programming, CVI comes with a good application note which you can find useful to understand some concepts of this technique and how they are implemented in CVI: the document is called MultithreadingOverview.pdf and is located in "bin" subfolder in your CVI installation.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 4
(3,452 Views)

Hi Roberto,

 

Thank you for your reply and advice. I already read that document.  But still if you can really a little explain me regarding in my case that would be great.

 

 

0 Kudos
Message 3 of 4
(3,423 Views)

The easiest way to get started with, and see the benefits of multi-threading in CVI is to build and play with the async timer example in the sample projects directory.

 

You run your user interface in the main program thread and do you timing critical work in the async timer thread.  Simple, clean, and effective.

 

Back in the days of CVI 4 multi-threading was usually more trouble than it was worth, but now with multi-core processors common, its really the only way to go.

 

0 Kudos
Message 4 of 4
(3,390 Views)