10-29-2007 05:04 PM
10-29-2007 05:14 PM
10-29-2007 05:27 PM
10-29-2007 05:54 PM
10-29-2007 06:03 PM
10-29-2007 06:19 PM
@DJDDA wrote:
"Do you actually need shift registers? Can't you make some sort of variable? Why is there even a while loop around all of this, isn't it just tying up processing time?"
Shift registers are often useful, but not always needed. Depends what you are doing.
LabVIEW has local and global variables. They break dataflow and can thus lead to race conditions. They can also cause extra data copies in memory. Typically, the wire is the variable. 😉
A loop is NOT tying up processing time unless it is spinning. A properly designed while loop only spins when needed (e.g. a control changes, in timed intervals, etc.). A typical beginner mistake is to make a while loop that does not contain any wait primitive oe event structure. This means the loop will spin as fast as the processor allows, using 100% CPU doing absolutely nothing useful.
If your data is in shift registers, and the old data disappears when you restart the code, it means you are using initialized shift registers. If you want to retain data in shift registers, don't initialize them.
@DJDDA wrote:
I've been putting everything I make in a while loop (because otherwise it stops running when I try to test it, and values aren't saved between iterations if I hit "run continuously").
@DJDDA wrote:
Is this necessary for a real program?
Yes, a typical toplevel program that interacts with the user needs a while loop. Often a state machine architecture is a good design template. There is nothing wrong with that!
@DJDDA wrote:
Really, can anyone just give me a general overview of what the program does while running, and what my users will see?
For that we need to see the code.
What happens currently when you run it? The user sees the front panel of the toplevel VI and any other panels of subVIs that are configured to show the panel. Do you know who designed the code?
These are all very basic issues. I would recommend to start with a LabVIEW tutorial.
10-29-2007 06:43 PM
"Often a state machine architecture is a good design template."
State machine architecture?
"For that we need to see the code. What happens currently when you run it?"
It runs like I want it to, but I don't know whether the running of a program by an end user has the same functionality as me hitting the "Run" button, as a general rule. While I posted my VI, I'm really asking "in general" here.
"Do you know who designed the code?"
You designed about 2/3 of it, I did the rest.
"These are all very basic issues. I would recommend to start with a LabVIEW tutorial."
I did the tutorials that came with the program, I'm just not clear on what my VI's will look like while being used. I thought that the while loops should be running constantly, albeit with time delays and such, but someone else suggested that perhaps there should be no while loop and the program should stop completely when not being touched.
10-29-2007 07:46 PM
Wow Altenbach, perhaps you should have designed Three thirds of the application.
@DJDDA wrote:
"Often a state machine architecture is a good design template."
State machine architecture?
"For that we need to see the code. What happens currently when you run it?"
It runs like I want it to, but I don't know whether the running of a program by an end user has the same functionality as me hitting the "Run" button, as a general rule. While I posted my VI, I'm really asking "in general" here.
"Do you know who designed the code?"
You designed about 2/3 of it, I did the rest.
"These are all very basic issues. I would recommend to start with a LabVIEW tutorial."
I did the tutorials that came with the program, I'm just not clear on what my VI's will look like while being used. I thought that the while loops should be running constantly, albeit with time delays and such, but someone else suggested that perhaps there should be no while loop and the program should stop completely when not being touched.
10-29-2007 07:57 PM
10-30-2007
10:57 AM
- last edited on
03-20-2024
02:33 PM
by
Content Cleaner
Hi,
I'm glad everyone has been so helpful with debugging your application. Sounds like you have been learning a lot! I hope that you've enjoyed programming in LabVIEW. If you'd like to become more proficient in LabVIEW, we do offer customer education courses, offered in many locations. You can check them out here. More specifically, I would recommend our LabVIEW Basics course to get up to speed on LabVIEW programming architecture and lingo.