LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to remove elements of a cluster like removing/deleting rows/columns of a 2D array?

I want the ability to dynamically delete elements from the cluster.  So I'd have to make a type def cluster for every scenario.  And with the number of elements in our cluster, that's a very daunting task.

0 Kudos
Message 11 of 14
(188 Views)

Hi Knight,

 


@LuminaryKnight wrote:

I want the ability to dynamically delete elements from the cluster.  So I'd have to make a type def cluster for every scenario.  And with the number of elements in our cluster, that's a very daunting task.


Clusters are defined at edit time, so they aren't "dynamic".

Instead of creating a cluster for each possible subset of elements you might think about organizing your data in a different way?

What about an array of "elements", where each "element" describes an item of your cluster? And with each "element" there could be a boolean "property" that is labelled "log?" to define the inclusion in a log file…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 14
(177 Views)

@LuminaryKnight wrote:

I have a single array of cluster.  I want to write the single array of cluster to file (maybe some of you remember this from last week).  But it's possible I don't want all the data in the cluster written to file.  But I also want to maintain the datatypes.  Is the following madness?  Deleting elements of a cluster?  Do clusters just not work that way?


First of all, you did you even explain how you write your array of clusters. I assume you would use lowlevel binary file IO with the correct datatype. A "file" is just a long linear array of bytes and all the magic is in the data structures that needs to be known when reading it back.

 

I already told you that you simply need to invent your own file structure and code that writes and reads partial data and also keeps metadata in the file so it knows what parts should be saved or restored. This is just menial programming work, but not difficult. Just create two subVIs.

 

In your earlier work, you also wanted to be able to read the file in other programming languages, so write appropriate code there too.

 

After that, start thinking and decide is you really want to do all that. HDs are fast and storage is cheap. Micromanaging file IO that probably needs to change two weeks from now anyway is just a waste of time.

 

0 Kudos
Message 13 of 14
(165 Views)

@altenbach wrote:

@LuminaryKnight wrote:

I have a single array of cluster.  I want to write the single array of cluster to file (maybe some of you remember this from last week).  But it's possible I don't want all the data in the cluster written to file.  But I also want to maintain the datatypes.  Is the following madness?  Deleting elements of a cluster?  Do clusters just not work that way?


First of all, you did you even explain how you write your array of clusters. I assume you would use lowlevel binary file IO with the correct datatype. A "file" is just a long linear array of bytes and all the magic is in the data structures that needs to be known when reading it back.

 

I already told you that you simply need to invent your own file structure and code that writes and reads partial data and also keeps metadata in the file so it knows what parts should be saved or restored. This is just menial programming work, but not difficult. Just create two subVIs.

 

In your earlier work, you also wanted to be able to read the file in other programming languages, so write appropriate code there too.

 

After that, start thinking and decide is you really want to do all that. HDs are fast and storage is cheap. Micromanaging file IO that probably needs to change two weeks from now anyway is just a waste of time.

 


We put together a header that instructed the other language on how to read the binary file.  We've proven we can ingest and properly interpret the binary file (which, from LV's point of view, is a cluster of varying data types).  But for the sake of file sizes, we're discussing having options to remove elements from the cluster.

 

I've been going down the typecast to array of U8 route, but I didn't think of the Endianess problem.  I still want to pursue this path, but now need to come up with a VI that arranges the data to mimic Little Endian if it were in its original data types.

0 Kudos
Message 14 of 14
(162 Views)