10-05-2006 01:45 AM
10-05-2006 08:33 AM - edited 10-05-2006 08:33 AM
Your indicator is outside the for loop so it won't get updated until the for loop finishes. You're also writing to a property node and that's about the slowest way to update something. Why aren't you writing to the indicator directly? You've got local variables and while the use of them is probably not necessary, that would be faster than a property node. How long does the for loop take to run?. You might just want to leave the code alone as long as it finally finishes. If you really need to see the indicator update with each iteration, move the indicator inside the loop. You can preallocate an array and with a shift register and Replace Array Element get the indicator to update as each new value is obtained.
Just wanted to also say that indexing that local variable array with each iteration and having it wired to the Bundle By Name is really not necessary either. Just create a constant (Right click>Create Constant) and wire that to the Bundle By Name. Bundle By Name does not require an input with data - just and input with the correct data structure.
Message Edited by Dennis Knutson on 10-05-2006 07:37 AM
10-05-2006 10:33 AM
@Dennis Knutson wrote:
Just wanted to also say that indexing that local variable array with each iteration and having it wired to the Bundle By Name is really not necessary either. Just create a constant (Right click>Create Constant) and wire that to the Bundle By Name. Bundle By Name does not require an input with data - just and input with the correct data structure.
Actually, the above statement is only true for the plain "bundle" as used here, not for the "bundle by name". If you would use "bundle by name" you can choose to only write a subset of the cluster elements and the culster input defines the values for all elements that you don't write.
A few more comments to your code.
If you want, please attach your entire program so we can better see how to improve things and make suggestions.
10-05-2006 11:21 AM
@altenbach wrote:
Actually, the above statement is only true for the plain "bundle" as used here, not for the "bundle by name". If you would use "bundle by name" you can choose to only write a subset of the cluster elements and the culster input defines the values for all elements that you don't write.
Small clarification: Even for the plain "bundle" node, the cluster input might be important IF not all element inputs are wired. All unwired elements retain the data of the cluster input.
In the case discussed here, all inputs are wired, so you don't need all that code gymnastics. 😉
If you were to optimize the code using shift registers instead of locals, wiring the original cluster might also save a data copy in some cases. This would need to be tested of course.
10-06-2006 03:58 AM
10-06-2006 06:29 AM
10-10-2006 03:05 AM
10-10-2006 03:31 AM