11-21-2008 02:09 PM
Hello,
I've read a couple of posts that mention separate threads do not have to be created in LabVIEW like in/for text based applications, but does that also apply to locking? I have to work on re-writing a client-side application from C++ to LabVIEW. New to LV. Thanks in advance.
11-22-2008 09:53 AM
If you're new to LV, you should start by looking at some tutorials or books. LV is considerably simpler to use than C++, but that does not mean it doesn't have a learning curve at all. If you don't have it yet, you can download a fully functional version here which will function in evaluation mode for 30 days. You can then see some code examples for what you want by looking in the example finder (Help>>Find Examples).
As for your question, LV is a data flow language. Sections of code will execute in parallel if they have no dependency between them. It's as simple as placing several loops or functions on the diagram without connecting them to each other. All the thread and mutex handling is done behind the scenes. Usually, locking will only be required if both sections write to the same resource like.a serial port, a TCP connection or a memory location (which in LabVIEW will not be represented by a pointer, but by some abstraction which can take any number of shapes).
Personally, when I do TCP comm, I prefer limiting the actual comm to a single loop or process and let that loop send and recieve the data to and from other loops. In some cases, the loop also takes care of converting the data to meaningful data structures.
11-22-2008 05:40 PM