Go to Post I always mean what I say. I just don't always say what I mean. - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-01-2012, 20:55
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Combining two High Priority User Data

Hello -

Based off of the example code, I've gotten our gyro and rangefinder to work in separate codes. However, I am having troubles combining them into one code as Set High Priority User Data only accepts one input, and you cannot use more than one.

I've tried sending the output from the rangefinder to the User Messages section of the Driver's Station. I saw jumbled characters constantly updating when I had linked the output to a string flattener before the Send User Message, and saw nothing when I linked the output directly to Send User Message.

Any help? Need screenshots?

Thanks.
Reply With Quote
  #2   Spotlight this post!  
Unread 17-01-2012, 23:08
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Combining two High Priority User Data

Too vague? Need screenshots?
Reply With Quote
  #3   Spotlight this post!  
Unread 17-01-2012, 23:33
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,579
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: Combining two High Priority User Data

You can combine data from multiple places using a Cluster Bundle, and then flatten the cluster for the high priority dashboard data.

For the user messages, it expects a string. However, the flatten to string isn't what you want. It takes the number, converts it to binary, and sends it. You should use the format into string, which takes a number like 10, and coverts it to a string "10". I hope that's understandable.
Reply With Quote
  #4   Spotlight this post!  
Unread 17-01-2012, 23:35
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Combining two High Priority User Data

Let's focus on using a Cluster Bundle. Where would I find such a tool? I can't find it under WPI or Data Manipulation, but I might just be blind.

So, if I wire in data from our Gyro and Rangefinder to the Cluster Bundle, flatten it, and ship it off into the high priority data, how do I separate the Gyro data from the Rangefinder data once I unflatten the string?
Reply With Quote
  #5   Spotlight this post!  
Unread 17-01-2012, 23:41
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,579
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: Combining two High Priority User Data

Quote:
Originally Posted by DominickC View Post
Let's focus on using a Cluster Bundle. Where would I find such a tool? I can't find it under WPI or Data Manipulation, but I might just be blind.

So, if I wire in data from our Gyro and Rangefinder to the Cluster Bundle, flatten it, and ship it off into the high priority data, how do I separate the Gyro data from the Rangefinder data once I unflatten the string?
Bundle is under Programming then Cluster, Class, and Variant. On the other side, you would use Unbundle.

99% of what I use is either under programming or under WPI.
Reply With Quote
  #6   Spotlight this post!  
Unread 17-01-2012, 23:49
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Combining two High Priority User Data

Alright, here's what I've come up with.



I'm not sure why the output cluster going to the anything terminal is causing an issue. Any help?
Reply With Quote
  #7   Spotlight this post!  
Unread 17-01-2012, 23:55
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Combining two High Priority User Data

So, after some tinkering, here's what I came up with.



Do I need the flatten to string between Bundle and Set User Data High?

Last edited by DominickC : 18-01-2012 at 00:01.
Reply With Quote
  #8   Spotlight this post!  
Unread 18-01-2012, 00:00
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,579
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: Combining two High Priority User Data

Use the bundle, rather then bundle by name.

The by name versions are nice if you create a .ctl with your cluster as a typedef, which you'll want to do once you start adding more things to the dashboard, but is overboard for just two items.

Yes, you need the flatten to string after the bundle, before the flatten from string. On the dashboard side, you'll need to create a "fake" cluster to feet into the unflatten from string, so that it knows how to decode the string.

Last edited by Joe Ross : 18-01-2012 at 00:03.
Reply With Quote
  #9   Spotlight this post!  
Unread 18-01-2012, 00:08
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Combining two High Priority User Data

Ah, alright. Just replaced it.

So, I should place a 1 block Bundle cluster and pump the high user data into it, and wire the output cluster to the unflatten from string?
Reply With Quote
  #10   Spotlight this post!  
Unread 18-01-2012, 00:17
SuperS_5's Avatar
SuperS_5 SuperS_5 is offline
[Certified LabVIEW Developer]
FRC #1219
 
Join Date: Dec 2010
Rookie Year: 2010
Location: Canada
Posts: 140
SuperS_5 will become famous soon enoughSuperS_5 will become famous soon enough
Re: Combining two High Priority User Data

That is a bundle by name. It requires an input cluster, defining the potential names of the elements of the cluster. The bundle by name can only used on elements with names in the cluster, unnamed elements are ignored. You can replace that with a bundle if you do not want to define a specific cluster. I would recommend using cluster saved as a typedef. This allows the dashboard project to use the same control, and be automatically updated when the cluster is updated, upon the next opening of the project.

EDIT: Oops, I was not fast enough on that draw...
__________________
Mike B

Last edited by SuperS_5 : 18-01-2012 at 00:19.
Reply With Quote
  #11   Spotlight this post!  
Unread 18-01-2012, 00:20
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Combining two High Priority User Data

I've replaced the bundle by name with a plain old bundle. Now, I need to know how to unflatten and unbundle the data within the dashboard. I've tried pumping the high user data into unbundle, but that didn't do it.
Reply With Quote
  #12   Spotlight this post!  
Unread 18-01-2012, 00:30
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Combining two High Priority User Data

Here's what I have now.



Did I do it correctly? Somehow I think not.
Reply With Quote
  #13   Spotlight this post!  
Unread 18-01-2012, 00:36
SuperS_5's Avatar
SuperS_5 SuperS_5 is offline
[Certified LabVIEW Developer]
FRC #1219
 
Join Date: Dec 2010
Rookie Year: 2010
Location: Canada
Posts: 140
SuperS_5 will become famous soon enoughSuperS_5 will become famous soon enough
Re: Combining two High Priority User Data

You are getting closer. Technically that will should work, but I wouldn't recommend it, because it is a bit convolved. Here is a small example I just threw together. I used non-typedef'd clusters for portability, but I would highly recommend using typedefs. I try to never use clusters without making them a typedef, it always pays off. The cluster is contains arbitrary data, replace the contents of that cluster at will.

Sending to the driver station:
Click image for larger version

Name:	Send to DS.png
Views:	22
Size:	20.9 KB
ID:	11441

Reading that data back:
Click image for larger version

Name:	Receive robot Data.png
Views:	23
Size:	27.4 KB
ID:	11440

EDIT: These pictures are snippets, and can be dragged onto a LV block diagram. (Firefox requires dragging to disk first, then to LV)
__________________
Mike B

Last edited by SuperS_5 : 18-01-2012 at 00:56.
Reply With Quote
  #14   Spotlight this post!  
Unread 18-01-2012, 00:50
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Combining two High Priority User Data

You, sir, have just boggled my mind ¯\(º_o)/¯

Thanks for taking the time to help, though. I'm going to run what I've got tomorrow and hope for the best.

Thanks!
Reply With Quote
  #15   Spotlight this post!  
Unread 18-01-2012, 20:04
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Combining two High Priority User Data

It worked!
Reply With Quote
Reply


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


All times are GMT -5. The time now is 22:24.

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