Create an indicator, and I get a subarray out. So I’ll create a constant, and I’ll also make this two. It says disabled, but that’s only because I don’t have anything wired into right now. You see I have Index Row, and Index Column. Well, what if I were to go and put a zero in the top input? It says it’ll return the element or subarray of a n-dimensional array. The context help can tell me what I’m seeing.
What happens if I take that same index array and wire a 2D array up to it? Look what happened: it changed. Create a constant, and what number am I going to put in here? Remember that array is zero indexed, so zero, one, two. I take my array, wire it into the Array Input, and below I see the Index Input. Why is it valuable? Well, let’s say in my code, I want to get ahold of this element and use it, maybe to multiply by another value. One of the most valuable is the Index Array function. How do I grab a single element out of a 1D array? Or a row/column out of a 2D array? And what is array polymorphism? It’s time to take a couple minutes and find out.įor more on programming in LabVIEW, check out the Sixclear Lucid LabVIEW Fundamentals Training (formerly Sixclear LabVIEW Fundamentals) course at Experience level: Basic Now we’re looking at one of the most common array functions: Index Array. In VI High 25 we were manipulating some 1D and 2D arrays with some simple functions.
#Labview array series#
This episode is part of a VI High series focusing on arrays that runs from VI High 24-32.
#Labview array how to#
We only recommend using the third method in cases where it is not practical to manually create individual event handlers.VI High 26 - How to Use the Index Array Function in LabVIEW The first is a bit cleaner, but the second will work just as well. We recommend using either of the the first two solutions where possible. When running multiple Phidgets through the single event handler, you can determine which one caused the event by comparing the phid terminal from the EventExe VI to the Phidget IDs (Device In/Device Out) of your Phidgets. When using this method, it might be tempting to add multiple event handlers, but keep in mind that events only occur once, in whichever handler sees them first.
vi to something else and then use those two different subVIs in your program. To get around this you need to copy the offending subVI, then change the name of the cluster object in it from "Event" to something else (your choice), change the name of the. This causes the events in C to output to the same event in LabVIEW. The pointer is identical in the case where two events of the same type are passed from a single function.