Jump to content

Multithreading?


nistam

Recommended Posts

Ok, i have an application that reads data from serial port. In the meanwhile the user must click a button that shows up a dialog, where he must enter some information. During that time the application stops reading data and waits for the dialog to close. In Visual Basic this kind of task can be accomplished by using API functions.This way you can have a dialog box displayed, and at the same time the timer display on your main form keeps on. I guess this is multithreading, but i know that labview IS multithreaded. I thought of using Call by reference or Open VI by reference. Any ideas or thoughts?

Link to comment

Far far far simpler than that, use a separate while loop for your dialog box and a separate loop for your serial port stuff. This is classic LabVIEW and one of the powers of LabVIEW over other languages. use globals (as a starting point) to transfer data between your loops. More advanced mechanisms for this transfer (queues, notifiers, semaphores, etc) are available but not necessary.

BTW, this is not multi-threading, so since both while loops are running in the same loop. So I like to refer to this as multi-fibred. LabVIEW is multi-threaded but for 99% of the world's programs you can get away with just doing the fibre thing.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.