LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wiring data through multiple frames of a Flat Sequence

Solved!
Go to solution

@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 🙂

---------------------------------------------
Certified LabVIEW Developer (CLD)
0 Kudos
Message 11 of 24
(944 Views)
Solution
Accepted by topic author VitekStepien

@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."

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 12 of 24
(943 Views)

@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.  😄

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 13 of 24
(942 Views)

@billko wrote:

@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.  😄


We know what you meant. LOL

---------------------------------------------
Certified LabVIEW Developer (CLD)
0 Kudos
Message 14 of 24
(938 Views)

Here's the updated vi to bring everyone some joy - it's sequenceless. 

rk4.png

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?

 

0 Kudos
Message 15 of 24
(930 Views)

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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 16 of 24
(929 Views)

@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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 17 of 24
(918 Views)

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.

0 Kudos
Message 18 of 24
(866 Views)

@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:

Conversion Functions

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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 19 of 24
(857 Views)

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

0 Kudos
Message 20 of 24
(845 Views)