LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting old code to be scalable and more efficient

Hello all,

 

I was looking for some help on this .vi. The goal is to update the .vi due to the following comments. I spent some time but my solution was not working out. Could anyone provide a solution so I can see how it is done. I have attached the block of code that needs updated. Thank you in advance.

 

1. Unnecessary use of memory. For loop shift register should be replaced with the iteration terminal.
2. Replace string output with a cluster of numerics to not have to parse the string values.

 

Thanks,

Phil (Working towards CLAD)

 

 

0 Kudos
Message 1 of 5
(2,234 Views)

A short description of what this vi does, some sample input data, and a better description of what your output needs to be would help a lot. 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 5
(2,200 Views)

If I've decrypted your code correctly, that entire mess can be replaced by this:

mess.png

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 3 of 5
(2,191 Views)

I would recommend against a cluster of numerics.  Instead, use an array of numerics.  This would be a lot more scalable.

 

But here is how I would do the task.


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
0 Kudos
Message 4 of 5
(2,179 Views)

This will get you the same format as your original VI, inspired by @paul_cardinale. However, me thinks it's best to follow crossrulz's advice.

 

The logic below can be simplified if you always know you have an even or odd amount of bytes.

 

mcduff

 

PS: Note that the type cast ALWAYS makes a memory copy, if you have a big data stream, make not be so good.

 

snip.png

0 Kudos
Message 5 of 5
(2,170 Views)