From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-08-2018 08:06 AM
Hi,
I am a new comer to LabVIEW program. I have finished the basic training of LabVIEW Core 1, 2 online but still have problems when I start to program in LabVIEW. I am having a project now to use LabVIEW to control the laser diode system, drive a translation stage with power meter to measure the power at different positions, while triggering the camera to take images, triggering the spectrometer to measure the spectrum and then save all the data and move to the next position. This procedure goes on until the end position and then turn off the laser system and return back to the home position.
The problem is I am having difficulty to organize my thoughts on deciding which structure is most efficient to put different functional VI together (like whether to use while loop, case structure or sequence structure or combination of them). I would like to ask for the general suggestions on how to design and start programming in the LabVIEW. Should I search and follow the existing LabVIEW examples as the starting point or should I just start to design without any reference. Thanks!
Solved! Go to Solution.
10-08-2018 09:18 AM
10-08-2018 09:54 AM
@gongchao8295 wrote:
Hi,
I am a new comer to LabVIEW program. I have finished the basic training of LabVIEW Core 1, 2 online but still have problems when I start to program in LabVIEW. I am having a project now to use LabVIEW to control the laser diode system, drive a translation stage with power meter to measure the power at different positions, while triggering the camera to take images, triggering the spectrometer to measure the spectrum and then save all the data and move to the next position. This procedure goes on until the end position and then turn off the laser system and return back to the home position.
The problem is I am having difficulty to organize my thoughts on deciding which structure is most efficient to put different functional VI together (like whether to use while loop, case structure or sequence structure or combination of them). I would like to ask for the general suggestions on how to design and start programming in the LabVIEW. Should I search and follow the existing LabVIEW examples as the starting point or should I just start to design without any reference. Thanks!
Think about what you are doing. You're doing a bunch of stuff over and over in the same order before finally quitting. To me, this seems like a good fit for a state machine. It's up to you how you want to break it down, but usually, each "thing" you want to do is a state.
If you plan to have some user intervention - even if it's just an abort button - then think about the Queued Message Handler (QMH) design pattern.
This might be the hardest part for a beginner because it takes experience - either through trial and error or through benefiting from someone else's, as you are doing here - to make the "right" choice.
And "right" is in enclosed in quotation marks because, sometimes, the solution that is right for someone else may not be right for you. This is because everyone eventually develops their own "style" where they might prefer a different design pattern to satisfy a set of requirements than someone else.
So dive in and let us know how you're doing. Show us your successes as well as your failures so we can help to guide you. As a beginner, it might be that some of your successes are actually failures waiting to happen. Heck some of my successes turn out to be failures waiting to happen. You can only hope that the more experience you have, the less likely this is to occur.
10-08-2018 10:10 AM
Hi Bill,
Thanks so much for your reply. This is very helpful to me.
Best,
Chao