LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array to typedef cluster (is too slow)


@EMCCi wrote:

Ok, so reading what you have answered me, it seems that the big part of the waste is in updating the data by reference in a loop. I didn't know that write values by reference was slow... I'm doing it by first time.

 

Then, as Benoit said, I should first build the cluster with the "analog data", and then write this cluster once in the typdef cluster by reference? Like this?

image.pngBut the problems is how to build this cluster from the 2D array in an easy way?


Even better would be to send this cluster out of the VI through an indicator and connect it to the Front panel Indicator directly, and skip the reference.

(I see McDuff basically said the same)

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 11 of 29
(1,261 Views)

paul.ross: We do instrumentation of very big machinery. 57 is the number of different variables measured in this case. This is string array has been already processed programatically, and now has only the clean values of the variables. For example {"650.00", "On", 12, "Ready", "102.50", "Primary", etc.}

 

mcduff: In every loop iteration, I have to save the value in a different cluster element. In your example I can only save in one cluster element for each data type. If I have 2 doubles I won't be able to save them in different cluster elements. It will help if I upload the VI?

 

Best regards and thanks for your time,

 

EMCCi

0 Kudos
Message 12 of 29
(1,255 Views)

If you want it fast, avoid variant conversion. And of course 'value' property nodes.

 

String to cluster.png

 

This will not automatically adapt to cluster changes, but you'd probably get a broken wire in most cases. And it will be fast...

 

I'd consider avoiding the conversion, but there's not enough information to propose something.

Message 13 of 29
(1,251 Views)

@EMCCi wrote:

paul.ross: We do instrumentation of very big machinery. 57 is the number of different variables measured in this case. This is string array has been already processed programatically, and now has only the clean values of the variables. For example {"650.00", "On", 12, "Ready", "102.50", "Primary", etc.}


Putting variables in a cluster might not be the best choice. Nothing wrong with 57 (or 500 or 5000) variables. But not in a cluster.

 

You'd usually want a solution where you use either an array or a (variant attribute) set. This allows access to individual variables by either a type def'd enum or by string.

 

The array can often be based on floats, as it stores (most) integers, Booleans and floats well. If you require strings, you have to either make separate buffers, or store flexible data. That can be variants, the raw strings or flattened data strings. Then you can convert when you read the values.

 


@EMCCi wrote:

mcduff: In every loop iteration, I have to save the value in a different cluster element. In your example I can only save in one cluster element for each data type. If I have 2 doubles I won't be able to save them in different cluster elements. It will help if I upload the VI?


This would be soo much easier if you had some solution based on an array or set...

0 Kudos
Message 14 of 29
(1,245 Views)

wiebe@CARYA wrote:

If you want it fast, avoid variant conversion. And of course 'value' property nodes.

 

String to cluster.png

 

This will not automatically adapt to cluster changes, but you'd probably get a broken wire in most cases. And it will be fast...

 

I'd consider avoiding the conversion, but there's not enough information to propose something.


Wouldn't it be faster to just use Index Array and individual conversions instead of Array to Spreadsheet and Extract from string?

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 15 of 29
(1,241 Views)

@Yamaeda wrote:

wiebe@CARYA wrote:

If you want it fast, avoid variant conversion. And of course 'value' property nodes.

 

String to cluster.png

 

This will not automatically adapt to cluster changes, but you'd probably get a broken wire in most cases. And it will be fast...

 

I'd consider avoiding the conversion, but there's not enough information to propose something.


Wouldn't it be faster to just use Index Array and individual conversions instead of Array to Spreadsheet and Extract from string?

/Y


Maybe. I'm not going to test it Smiley Very Happy. This will be faster then variant conversion\value properties. Your suggestion would be (arguably) more complex, but if even more speed is needed, it would be worth a try.

 

My guess is that array of string comes from a string to begin with. Not sure, but if so that Array To Spreadsheet String won't be needed of course.

 

I don't think a cluster is right for this to begin with.

0 Kudos
Message 16 of 29
(1,234 Views)

@EMCCi wrote:

paul.ross: We do instrumentation of very big machinery. 57 is the number of different variables measured in this case. This is string array has been already processed programatically, and now has only the clean values of the variables. For example {"650.00", "On", 12, "Ready", "102.50", "Primary", etc.}

 


Very big is of course all relative. What to say about an application that processes around 14000 internal variables, with around 1000 external IO points from all kind of devices like EtherCAT, Modbus, RS-485, several TCP/IP devices and DAQmx?

 

But yes that application is nowhere updating a single control through value properties! Smiley Very Happy

Rolf Kalbermatter
My Blog
Message 17 of 29
(1,231 Views)

Yamaheda & wiebe@CARYA: I build a cluster because this data is send by mobile network. Doing it like this I can adjust the data type for each variable, which is necessary to save mobile data. I was searching a way to do what you both are proposing but in a for loop, making it easier to program and scale in the future. But seems like this solution do not exist, so I will do it like this.

 

rolfk: It's not a competition Smiley Wink

 

I have understood in this project that updating controls through value properties is not a good idea.

 

Anyone has the solution to index through a cluster to update the values without using references?

 

Thanks for your time and responses,

 

EMCCi

 

 

0 Kudos
Message 18 of 29
(1,218 Views)

@EMCCi

rolfk: It's not a competition Smiley Wink

  


I think his point was that just because you have a lot of variables, doesnt mean you need to (or should) put them all into one cluster. 

0 Kudos
Message 19 of 29
(1,201 Views)

I don't know if it is the best option, but I need to adjust individually the data type for more or less 200 variables in this project in order to save mobile data. This is why im grouping the variables in clusters. If anyone has a better option I'm open to listen it.

 

Regards.

0 Kudos
Message 20 of 29
(1,192 Views)