LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Log Specific Parts of a 1D Array

Hey everyone,

 

I inherited some code that uses an event driven Producer-Consumer structure.  It implements an ActiveX framework to read data from a special instrument.  The message that comes back is a 1D array of Hex.

 

The machine constantly streams 5 numbers and when something changes it sends between 6 and 10 numbers. I want to set up a way to ignore any data that contains less than 6 numbers and log anything ≥6.

 

Here's the main part of my code:

wide_code.PNG

 

Here's what I'm looking at in my front panel (I also snagged a screenshot at the wrong time. Please excuse the mistake in the first part of the picture):

wide_message.PNG

_____________________________

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

It looks pretty straight forward. Check for the array size before logging.

 

Do you have a question for us?

 

Rob

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

Array subset will get you there.  Just wire in a 6 to the index and leave the length unwired.  It will then give you everything after the 6th element.  If there are less than 6 elements, you will get an empty array.


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 3 of 5
(2,463 Views)

Thank you! That did exactly what I needed it to.

 

Now I'm on to the tricky part. I need to use the values it spits out to control an case structure. Is that possible? I know I've controlled case structures in the past using numerical controls. Would this be much different?

 

Edit: Originally said "event" when I meant "case"

_____________________________

0 Kudos
Message 4 of 5
(2,443 Views)

Any integer type (unsigned or not) can be used to control a case structure. I hope you don't have 65000 cases to define...

 

Rob

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