Quote:
Originally Posted by Los Frijoles
... - I had to use Case statements to simulate an if () {} sequence
- The equivilent of var++ was an add 1 to a value sequence which involved several numeric constants
- Sometimes the wires get tangled and are hard to distinguish...is there any way to change the color? Right now it is based on the type of the variable being passed down the wire (green = bool, blue = #)
- The control/tools/modules/whatever panel got in the way of programming in the block diagram view and got quite frustrating with having to move it around. Is there any way to circumvent this?
|
Congrats on your first LV program. You already have some responses, but let me add my own.
1. Case statements aren't really inefficient. They are a more structured, but equivalent way of doing conditional code. You might want to try switching out on numbers, or enums, errors, or strings. All of those work and quickly simplify code used to turn stuff into booleans. You build the ranges of values in the case such as (1..3, 6) and (default) for numbers.
2. As Thomas mentioned, the +1 node will help a bit, but also be sure you aren't using local variables and UI elements on your panel as programming storage. One of the trickier things to unlearn when trying LV, is to avoid naming things and referring to them by name. So, A-->+1-->X, is better than reading A, incrementing, storing back into A, then assigning X from A.
3. The color is tied to the type, similar to syntax coloring in other tools. Using white space to separate and group the wires is usually a more effective technique. Also, if you have many wires, bundle them into a cluster, then unbundle them again later.
4. Currently, LV has many windows, floaters, and menus. It soon becomes second nature to control them, but it can be intimidating at first -- kinda like vi or emacs, or any other editor that has accumulated features over a couple decades.
If you have more specific LV questions, fire away, here or on the ni.com/community/first site.
Greg McKaskle