06-06-2012 07:28 AM
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:
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):
06-06-2012 08:31 AM
It looks pretty straight forward. Check for the array size before logging.
Do you have a question for us?
Rob
06-06-2012 09:45 AM
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.
06-07-2012 11:58 AM - edited 06-07-2012 12:00 PM
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"
06-07-2012 12:46 PM
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