01-21-2021 10:15 AM
@billko wrote:
is like forcing your car to fire its spark plugs at your discretion.
Long time ago, the spark advance was controlled by the driver 🙂
01-21-2021 10:16 AM
@VitekStepien wrote:
Bill, that makes sense. I guess my original question will remain unanswered, since Sequences are a taboo topic, but I appreciate your responses.
Thanks,
Vitek
It's not a taboo topic, it's bad programming. Why do you think NI went through all the trouble to hide it from the user in later editions? The answer is: "There is no good way to wire through a sequence file."
01-21-2021 10:17 AM
@Frozen wrote:
@billko wrote:
is like forcing your car to fire its spark plugs at your discretion.
Long time ago, the spark advance was controlled by the driver 🙂
Grrr... LOL. 😄
01-21-2021 10:19 AM
01-21-2021 10:31 AM
Here's the updated vi to bring everyone some joy - it's sequenceless.
I know it's outside of the scope of the original question, but if you don't mind answering another question: when I divide or multiply a complex variable by a double, it will always show the red coercion dot to bring my attention to that. Is it really worth manually putting a conversion to complex in such trivial case?
01-21-2021 10:37 AM
LOL you really know how to jump from one controversial subject to another, don't you? 😄
Contrary to what the CLD exam drills into your brain, there is nothing wrong with having coercion dots, AFAIK. I will occasionally explicitly coerce to a datatype for self-documentation to make it easier for the next developer to find potential trouble spots.
01-21-2021 11:44 AM
@billko wrote:
LOL you really know how to jump from one controversial subject to another, don't you? 😄
Contrary to what the CLD exam drills into your brain, there is nothing wrong with having coercion dots, AFAIK. I will occasionally explicitly coerce to a datatype for self-documentation to make it easier for the next developer to find potential trouble spots.
I generally try to avoid coercion dots as much as possible. While it won't cause an issue very often, it can cause issues depending on the coercion which is being done and those bugs can be hard to find. If you explicitly do all of the data conversion when switching between types you know exactly what is being done and there is nothing implied.
01-23-2021 05:34 AM
I would argue that explicit data type conversions add to readability, and data coercion can in rare situations affect memory usage and performance, however I concede that it's not usually a concern in most situations.
https://zone.ni.com/reference/en-XX/help/371361R-01/lvconcepts/coercion_dots/
Avoiding coercion dots could be considered a good habit to get into, based on the above.
01-23-2021 02:07 PM
@DG76 wrote:
I would argue that explicit data type conversions add to readability, and data coercion can in rare situations affect memory usage and performance, however I concede that it's not usually a concern in most situations.
https://zone.ni.com/reference/en-XX/help/371361R-01/lvconcepts/coercion_dots/
Avoiding coercion dots could be considered a good habit to get into, based on the above.
But then this, from the same link:
You can use Conversion functions to eliminate coercion dots. In general, Conversion functions have the same effect as coercion dots but take up more space on the block diagram. However, when you use a Conversion function inside a loop that generates an array, you can avoid the conversion of a large data buffer because the conversion takes place before LabVIEW creates the array, as the following block diagram illustrates.
And the picture it references shows an explicit conversion inside a FOR loop. To tell the truth, never considered this scenario, so that was actually a learning experience. I guess I never considered it because I always make sure generated data is already the right datatype.
99% of my coercions are from a typedef'd enum to an integer of the same representation. e.g., an 8-bit typedef'd enum to an 8-bit unsigned integer, or vice versa, so I don't bother doing anything to explicitly convert from one to the other.
So I don't really think that avoiding coercion dots is necessary, or a particularly good or bad habit to get into, but I will allow that it may be easier to do than to remember the explicit case where it would make a difference.
I still don't think it is as necessary as the CLD exam would have you believe. They make it sound like you will burn in NI Hell for having them.
01-24-2021 12:58 PM
Sequences are not a "taboo" topic. Indeed, after more than a decade of doing LabVIEW Development and swearing to (almost never) use a Frame Sequence (unless I'm doing Timing, and need to "sequence" a Timer before, and after, a sequence of code), I started using them recently when "learning something new", namely how to code using FPGA hardware to get the ultimate in speed and parallelism.
I'm pretty sure that if you search the Forums and the Web, you can find numerous White Papers and other posts that explain the drawbacks to Frame Sequences. Perhaps the major objection to them is esthetic -- they almost never are "necessary", and almost always cause clutter and make it harder to understand the "framed" code.
Bob Schor