![]() |
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. |
Re: Combining two High Priority User Data
Too vague? Need screenshots?
|
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. |
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? |
Re: Combining two High Priority User Data
Quote:
99% of what I use is either under programming or under WPI. |
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? |
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? |
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. |
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? |
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... |
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.
|
Re: Combining two High Priority User Data
Here's what I have now.
![]() Did I do it correctly? Somehow I think not. |
Re: Combining two High Priority User Data
2 Attachment(s)
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: Attachment 11441 Reading that data back: Attachment 11440 EDIT: These pictures are snippets, and can be dragged onto a LV block diagram. (Firefox requires dragging to disk first, then to LV) |
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! |
Re: Combining two High Priority User Data
It worked!
|
| All times are GMT -5. The time now is 11:35. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi