From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
02-03-2017 06:42 PM - edited 02-03-2017 06:51 PM
Hi, I'm using the "index and bundle cluster array" in which I want to create a cluster of both of my arrays (Horizontal & Vertical). The problem is that after using this function the arrays don't retain their original names(labels) as can be seen in the attachment. Is there something that should be done in order to make them? I'm totally missing something, any help is appreciated.
A.
02-03-2017 07:58 PM
It is much easier for us to help you if you attach code (meaning files with the extension .vi) instead of pictures of code.
You have created a cluster, but one whose components are "anonymous", unnamed, only typed. If you have a cluster that has been defined by either being created (with named elements) or has a Type Definition ("TypeDef". having the extension .ctl), you can use the much-more-useful "Bundle by Name" (and, similarly, "Unbundle by Name"). There are only rare instances where "Bundle" and "Unbundle" (the "anonymous" versions) should be used.
Bob Schor
02-03-2017 08:26 PM - edited 02-03-2017 08:26 PM
Alright I just thought that it'll be messy since it a big code. by the way the bundle by name didn't work.
My goal: this vi draws with mouse movement and sends this to a Gcode interpreter, I want to add a more reliable movement (using the arrow keys) in which I created that code that I showed you. So I want to connect both of my inputs to the same graph but to get things right the x and y should be in a cluster and named Vertical & Horizontal.
If anymore info is needed just let me know, thanks.
PS: the code is in the lower right of the "Main" VI
A.
02-04-2017 01:15 PM
This is what I was talking about. Note that this image is actually a LabVIEW Snippet: if you open a LabVIEW 2016 blank VI, you can drag this image into the Block Diagram and it will automagically expand into working LabVIEW code.
The Control "Point" is a LabVIEW Cluster I created with Dbl elements called Horizontal and Vertical. What you should do is right-click this control, choose Make Type Def, then open the TypeDef and save it as a named Control (I suggest using the name "Point"). Now you can use the TypeDef as a constant instead of needing a Control that basically "does nothing" (except define the Cluster) on the Front Panel.
The first loop shows building an array of Points, each with a random Horizontal and Vertical element, and creating an Array of Points. The second loop takes this array apart, "re-packaging" all of the Horizontal elements into an X Array, all the vertical elements into a Y Array.
I'm surprised you didn't understand this. I gather you have not taken the time to view the LabVIEW Basics tutorials mentioned at the top of this Forum. I recommend you spend your time learning the basics.
Bob Schor
02-06-2017 10:41 AM
If you do not want to use the bundle by name and build an array then another option is to type cast the wire to an array of clusters with each cluster element named.
But that is more cryptic that build an array of clusters with proper names.
Ben
02-07-2017 01:43 AM - edited 02-07-2017 01:44 AM
@AHmedalnahdi wrote:
Hi, I'm using the "index and bundle cluster array" in which I want to create a cluster of both of my arrays (Horizontal & Vertical). The problem is that after using this function the arrays don't retain their original names(labels) as can be seen in the attachment.
Nope, that can't be seen in your attachment. What ever label you have on the wires on the left side (outside the picture) is their active name. What you call the indicator they connect to has no bearing on it.
/Y