06-12-2007 10:16 AM
06-12-2007 11:08 AM
Taylor,
I did not dig too far into your problem however I have a few LabVIEW tips that may lead you to the solution:
1- Refrain from using local variables: If you want to reference a value the best way is to wire the terminal to the value desired. Refer to the attached file where I modified your code to implement this style in a few example cases. Wires should always be used because it ensures that the data flows correctly through your program (whereas if local variables do not ensure this because based on dependences values may arrive at different times). I'm guessing this is why you are having problems running your program.
2- Event structures: If you use an event structure it is good programming practice to place the the control which triggers the event inside the structure (as I did with the start control in the attached modified file). Even though the program will response the latching action of the control will not be implemented. So for instance with your start button it will not return to the off state when the program ends.
3- Search the NI Knowledge Base/Discussion Forums for answers to your questions. A lot of times there has already been an extensive discussion about your specific topic.
Let me know if these tips help or if you have any other questions/concerns.
Cheers,
Jonah Paul
Applications Engineer
National Instruments
06-12-2007 11:18 AM
Maybe run your code with execution highlighting to see what's really happening. Good luck! 🙂
06-12-2007 11:52 AM
06-12-2007
01:47 PM
- last edited on
02-26-2025
11:28 AM
by
Content Cleaner
Taylor,
Altenbach is right on, you should sit down and get a good LabVIEW fundamentals foundation before you continue. You can do this through numerous methods. I recommend going through the "New to LabVIEW" content in the Getting Started dialog box when LabVIEW initial boots up to get basic documetation. In addition there are hundreds of ready made examples that you can look at which also can be found in the Getting Started dialog box at the bottom right-hand side. Finally, National Instruments also offers Training classes that are an excellent way to get acclimated to the power of LabVIEW.
Once you have completed some training and have a little better handle I recommend that instead of using a timed loop to coordinate your program flow (I'm assuming that you will be running this in a Windows environment) you should use while loops with a "Elapsed Time" VI inside which will delay each state for as long as you want (in your case 2 or 2.5 sec). However you have to be careful about reseting the Elapsed Time VI as well delaying the while loop when using this design.
Please take some time to get a good base then go from there.
Cheers,
Jonah Paul
Applications Engineer
National Instruments