Go to Post Pictures are worth a thousand words... cell phone pics are worth 750. - kramarczyk [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-02-2009, 19:16
Mr.Macdonald Mr.Macdonald is offline
Registered User
FRC #2272
 
Join Date: Jan 2009
Location: Conejo Valley Robotics
Posts: 26
Mr.Macdonald is an unknown quantity at this point
Clustering in Labview

I can't seem to get this clustering to work, here is a several screenshots

Labview is very annoying
Attached Files
File Type: zip images.zip (324.5 KB, 101 views)
  #2   Spotlight this post!  
Unread 10-02-2009, 20:14
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: Clustering in Labview

"Labview is very annoying"? Them's fightin' words

I happen to find clusters to be SUPER AWESOME! When properly designed and packed with the data that you need for a given "object", they can be incredibly useful.

A few recommendations (I'm not exactly sure which issues you're finding most problematic) -
1) your case structure doesn't have a control to select true vs. false, that's one error
2) your case structure doesn't have a value to pass out when set to "false", that's the second error
3) select the error in the error window and press "show error" to highlight the specific issue
4) use "bundle by name" and "unbundle by name" instead of "bundle" and "unbundle" - you'll have user-friendly tags to identify what wires go where
5) when using the "by name" variants, you'll need to "input" a cluster to allow the function to know what the datatypes and names are (you could use, for example, a local variable as the "input" to the bundle - right-click on the variable-create-local variable-change to read)

After a few years of programming LabVIEW without using clusters, I was playing around one day, found out how powerful they can be and haven't looked back since.

Once you get past the above hurdles, you could even consider creating a custom control to define your cluster. If your custom control is set to "strict type def", you'll be able to modify the cluster in the .ctl custom control file and "push it out" to every VI that uses it. This is a more advanced LabVIEW concept but really not too hard to use once you get the hang of it.

Russ
  #3   Spotlight this post!  
Unread 10-02-2009, 21:01
Mr.Macdonald Mr.Macdonald is offline
Registered User
FRC #2272
 
Join Date: Jan 2009
Location: Conejo Valley Robotics
Posts: 26
Mr.Macdonald is an unknown quantity at this point
Re: Clustering in Labview

I was using Case structures to be "Functions"

how do I return a cluster
  #4   Spotlight this post!  
Unread 10-02-2009, 21:22
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: Clustering in Labview

I'm not sure that I understand what you're trying to do. Unless "objects" in C++ that include both data and functions, clusters in LabVIEW are really more related to structures in C/C++ (ie a simple grouping of possibly disparate datatypes).

If you're trying to get a subVI that can be called from other VIs, the easiest technique to use is to highlight the "code" that you wish to make a "function" from and select "edit-create subVI". This will automatically gather up the software and create inputs and outputs for you.

The old-school technique is to right-click on the icon in the upper right of your front panel and select "edit icon" to change the icon and "show connector" to display the connector pane for the VI. With the connector pane displayed, you can use the wiring tool to select the inputs and outputs for the VI. After saving the VI, you can use it as a subVI in any other VI.

Is this what you're looking for?
Russ
  #5   Spotlight this post!  
Unread 10-02-2009, 21:27
Mr.Macdonald Mr.Macdonald is offline
Registered User
FRC #2272
 
Join Date: Jan 2009
Location: Conejo Valley Robotics
Posts: 26
Mr.Macdonald is an unknown quantity at this point
Re: Clustering in Labview

I know its like a struct, and in C you can return structs

I have already built functions, just not clusters
  #6   Spotlight this post!  
Unread 10-02-2009, 21:41
XXShadowXX's Avatar
XXShadowXX XXShadowXX is offline
They call me Cody.
no team (None currently :\)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Pontiac; MI
Posts: 408
XXShadowXX has much to be proud ofXXShadowXX has much to be proud ofXXShadowXX has much to be proud ofXXShadowXX has much to be proud ofXXShadowXX has much to be proud ofXXShadowXX has much to be proud ofXXShadowXX has much to be proud ofXXShadowXX has much to be proud ofXXShadowXX has much to be proud ofXXShadowXX has much to be proud of
Re: Clustering in Labview

You have two identical things coming in, (wheel, and then it's mirror minus the cluster/bundler thingy). The issue is (beside the case structure errors), that you have more inputs then outputs...
You have every input doubled, so you need to double every output, that should (big should work)...

you have all the wheel stuff taken care of (your original input i think (the big clustered thing)), but then you add all the other stuff, and you are only outputting you wheel info, and nothing else.
__________________
Is now an engineer thanks to FIRST.

Last edited by XXShadowXX : 10-02-2009 at 21:43.
  #7   Spotlight this post!  
Unread 10-02-2009, 21:56
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: Clustering in Labview

Are you trying to build a cluster? If so, I'd recommend that you use "bundle by name" and check out its examples and "context help". If you're trying to modify a single element within a cluster, do something like the attached.
Attached Files
File Type: vi cluster example.vi (15.1 KB, 60 views)
  #8   Spotlight this post!  
Unread 10-02-2009, 22:04
Mr.Macdonald Mr.Macdonald is offline
Registered User
FRC #2272
 
Join Date: Jan 2009
Location: Conejo Valley Robotics
Posts: 26
Mr.Macdonald is an unknown quantity at this point
Re: Clustering in Labview

I can't make a function that creates a cluster
I want to standardize the cluster
  #9   Spotlight this post!  
Unread 10-02-2009, 22:38
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,753
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Clustering in Labview

A function, or subVI, can return any number of outputs of any datatype including cluster. The return values are returned via the icon in the upper right. You might want to look up a tutorial on building a subVI, but the short steps are to right click on the icon and show the connector terminals. If you need to, pick a terminal pattern with at least enough inputs and outputs (extra are fine, and often a good idea for forward compatibility). Click on a terminal where you want the output, then click on the indicator(cluster). If you show the help window, you should see that you now have your function returning a cluster.

To explain a bit more about the other syntax errors in your diagram, LV doesn't like uninitialized data. For a case to pass data out of it to the outer diagram, every diagram must pass some data out, otherwise it'd be uninitialized.

Greg McKaskle
  #10   Spotlight this post!  
Unread 10-02-2009, 22:43
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: Clustering in Labview

I'm really struggling to understand your objective. You did successfully create a cluster in your first bitmap using the "bundle" VI and then you wrote its value to a control. What else are you trying to do? I'd call that "a function that creates a cluster".

If you want to standardize a cluster, you should create a custom control that contains the standard cluster with "strict type def" setting.

Russ
  #11   Spotlight this post!  
Unread 11-02-2009, 18:41
Mr.Macdonald Mr.Macdonald is offline
Registered User
FRC #2272
 
Join Date: Jan 2009
Location: Conejo Valley Robotics
Posts: 26
Mr.Macdonald is an unknown quantity at this point
Re: Clustering in Labview

I am trying to make a function that creates a cluster, like an init function in C++.

I want the function to take as input, at least all the components of the cluster, bundle them and return the bundle. Thats it
  #12   Spotlight this post!  
Unread 11-02-2009, 18:57
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: Clustering in Labview

With the exception of the errors in the VI that I mentioned above, you did just that (based on the first bitmap that you posted). All that you need to do is wire up the connection panel for the VI. Go to icon in the upper right of the front panel, right-click and select Show Connector. Then proceed to use the wiring tool to attach the inputs (all of the terminals on the left side of your block diagram) and outputs (the terminal on the right side of your block diagram). After you save the VI, you can then place the VI in any other VI and use it as a subVI.

I wish that I could log onto your computer and do this for you. It takes much longer to describe than to actually implement. There must be a help file for "creating a subVI".

Russ
  #13   Spotlight this post!  
Unread 11-02-2009, 19:07
Brdn666's Avatar
Brdn666 Brdn666 is offline
Registered User
AKA: Brandon
FRC #2604 (Metal & Soul)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Capac, MI
Posts: 24
Brdn666 is an unknown quantity at this point
Send a message via Yahoo to Brdn666
Re: Clustering in Labview

All you have to do to make a subVI is select all the components, go to edit across the top and click the "create a subVI" option.
__________________
  #14   Spotlight this post!  
Unread 11-02-2009, 19:20
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,587
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Clustering in Labview

Quote:
Originally Posted by Mr.Macdonald View Post
I am trying to make a function that creates a cluster, like an init function in C++.

I want the function to take as input, at least all the components of the cluster, bundle them and return the bundle. Thats it
Sounds like you are duplicating the bundle by name function.
  #15   Spotlight this post!  
Unread 11-02-2009, 19:34
Mr.Macdonald Mr.Macdonald is offline
Registered User
FRC #2272
 
Join Date: Jan 2009
Location: Conejo Valley Robotics
Posts: 26
Mr.Macdonald is an unknown quantity at this point
Re: Clustering in Labview

"Sounds like you are duplicating the bundle by name function."

Yes exactly, but limiting the inputs
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Labview 8.5 vs. FRC Labview 8.5 pyr0b0y NI LabVIEW 0 01-02-2009 22:20
buttons in LabView Pneumaticsman NI LabVIEW 4 12-01-2009 18:14
LabVIEW vs C/C++ 3DWolf Programming 11 05-12-2008 09:14
Labview tseres Programming 2 23-05-2007 00:27
Labview Phreakuency LabView and Data Acquisition 6 14-01-2006 01:14


All times are GMT -5. The time now is 21:50.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi