BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

What's wrong with dynamic data?

I am starting this thread to showcase what I might call "dynamic data abuse": The use of dynamic data where it has no business to be used (does it ever?).

 

Everybody is invited to contribute with their own examples!

 

One of the problems when operating on dynamic data is its opacity. We can never really tell what's going on by looking at the code. It also seems to hide serious programming mistakes by adapting in ways to mask horrendous code and making it seemingly functional, glossing over the glaring programming errors.

 

 

To get it all started, here are a few recent sightings:

 

 


(A)

 

 

(Seen here). No Kidding! The users joins a scalar with a waveform, then wires the resulting dynamic data to the index input of "replace array subset". He cannot see anything wrong, because the program actually works (coercing the dynamic data to a scalar will, by a happy coincidence, return the value of the scalar joined earlier. I have no idea what thought process led to this code in the first place (maybe just randomly connecting functions until the result is as expected? :o).

 

 


(B)

 

(seen here)

What's wrong with simply branching the wire???

 


(C)

I don't remember the link, but here's how somebody transposed a 2D array a while ago (bottom part of image). No way to tell from looking at the code picture! (The "FromDDT" and "ToDDT" need to be configured just right ...). 😄

 

 

 

ARRRRGH!

Download All
Message 1 of 15
(15,452 Views)

Here's another one for you.  Found here:http://forums.ni.com/t5/LabVIEW/Program-unresponsive-after-a-dialog-box-input/m-p/2447608#U2447608

 

Put a bunch of booleans into a Combine Signals and then do a Dynamic Data to Boolean Array.

 

I supplied the much more cleaned up version of the code below.

 

EDIT:  I just realized I needed to subtract 1 frm the power before using the Scale by Power of 2.  Oops.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 15
(15,339 Views)

@altenbach wrote:

I am starting this thread to showcase what I might call "dynamic data abuse": The use of dynamic data where it has no business to be used (does it ever?).


Okay this probably should be a new thread but really...when would I use the dynamic data, data type?  It seems useless and is a little frustrating that NI spends so much time supporting it and adding features that use it, but yet I have not found a use for it in my 9 year of LabVIEW experience.  The only time I've even used it is when I am making a quick demo using an express VI (DAQ Assistant) and I need to convert it back to something useful.

 

To be clear I'm not saying that dynamic data is useless, I'm just saying I haven't found a time when I would use.

 

EDIT: Add "Dynamic Data" to my list of features in LabVIEW I never use, along with "Units" when using doubles.

Message 3 of 15
(15,315 Views)

And another seen here

 

Lets change a DAQmx read from an array of DBLS to a waveform type coercing back to array of DBL at the input to "To DDT"

 

What happened to all the timing information?

 


"Should be" isn't "Is" -Jay
Message 4 of 15
(15,266 Views)

You wanna know what's wrong with it? Well, you're going to have to ask someone else. I can't answer what's wrong with it because I simply don't understand it. Never have.

 

Maybe all those automatic coercions make perfect sense, but since I never saw anyone explaining any advantages the DDT has, I just assumed that it doesn't have them (or that they exist mainly if you build one of the three icon demos NI marketing likes) and simply proceeded with the data types I actually understand.


___________________
Try to take over the world!
Message 5 of 15
(15,244 Views)

OK, stupid question time.... Like Super Adventure Time but less cool....

 

What's the difference between dynamic data and waveforms?  I ask because I just used my very first waveform datatype today to display a mix of digital bus and analog voltage info for debugging an FPGA application.  It's pretty neat actually (the display side at least).

 

So what's dynamic data?

Message 6 of 15
(15,220 Views)

Intaris wrote:

What's the difference between dynamic data and waveforms?

 

So what's dynamic data?


Dynamic data is simply a thin wrapper around a select group of datatypes (which includes waveforms).  These datatypes are the ones that would be commonly used in simple DAQ applications and the DDT seems like it is there to provide pseudo-polymorphism.  You could in principle get the same effect with variants, this way I guess they get a blue wire to match the Express theme.

 

If you want to sling a couple of wires and see a meaningful FFT on your graph then I guess these are your guys.  They are useful, but they can obviously make it easy to create performance killers.  Coercion dots look bad on marketing pamphlets so those blue wires seem to happily plug in to a lot of places, you get no clue what conversions and copies lie beneath.  It is like Build Array that makes it look nice and clean to prepend elements to your array repeatedly.

 

As to split and merge signals, I am a bit sympathetic here.  The targeted user base are those hardware guys who are looking to automate their testing.  They are sold on the analogy of LV code to the wires they are familiar with.  If you guys built hardware the way you code LV (branching wires all over the place), you would be rightfully mocked.  Fanouts and buffers are commonly used, so split signals looks like something they are familar with.  Branching wires or traces is just not wired in to their brains.  Go easy on them, I can often see the hardware analogy to what they are doing.  Others, of course are doing things that do not belong in either hardware or software.

 

Short answer, if you are a LV person, there is really nothing for you in the DDT except code obfuscation.  If you are a hardware guy who just wants his FFT axis to have the proper values, it can make it simple.

 

Now why is something that you can only configure when you drop it on the BD called 'dynamic', that is a mystery of the universe.

Message 7 of 15
(15,210 Views)

Let's take a strictly typed language and suggest to all our new users to use a loosely defined data type. 

 

Who thought that was a good idea? 

0 Kudos
Message 8 of 15
(15,144 Views)

Greg,

 

Please watch your language!   "loosely defined"?  Where did you find a definition?

 

Maybe the thread title should be "Can anyone think of a good use case for DDT?"

 

I think the U.S. government banned DDT because it was killing off eagles, ospreys, and other top predators.  Let's extend the ban to this newer type of DDT.

 

Lynn

Message 9 of 15
(15,138 Views)

@johnsold wrote:

 

Please watch your language!   "loosely defined"?  Where did you find a definition?

 

 

Lynn


I think I meant weak typed (although this may not be a good use case of that term anyways, but it seemed to fit). I didn't mean to get you excited about being able to find where they are defined! Smiley Surprised

0 Kudos
Message 10 of 15
(15,122 Views)