![]() |
Send multiple sensor data through High Priority User Data
According to the labview tut. you can send senor data through the high priority user data but what if I want to send multiple sensor data. How would I go about doing this.
|
Re: Send multiple sensor data through High Priority User Data
Bundle all the data before you flatten it. On the Dashboard side, unflatten and unbundle it. It helps to have a .ctl shared between the robot and Dashboard code to define the arrangement of the bundle so you can Bundle/Unbundle by Name.
|
Re: Send multiple sensor data through High Priority User Data
what's a .ctl
|
Re: Send multiple sensor data through High Priority User Data
Sorry, I should have called it a TypeDef. Where Virtual Instruments are stored as .vi files, TypeDefs are stored as .ctl files. A TypeDef acts a little like a global variable, but it defines only the layout of a data structure rather than storing specific data. You can see a couple of them in the default robot project: Dashboard Datatype.ctl and DashboardEnable.ctl.
You can make one by choosing New... from the File menu and picking Custom Control under the Other Files folder. To create a TypeDef that lets you name individual data elements in a cluster, start by placing a Cluster control (from the Array, Matrix & Cluster subpalette) and labeling it something like "Custom Dashboard Data". Put whatever other controls you want -- numeric, boolean, string, etc. -- into that Cluster, giving them the appropriate labels. Once you've saved the TypeDef, you can use it in a Block Diagram by choosing Select a Control... from the function palette. You'll want to use the TypeDef in two places for the high priority dashboard data communication. First is in the robot project, as the input cluster at the top of a Bundle By Name function, where you take all the individual pieces of data and bundle them together into a single cluster to be flattened (Mathematics>Numeric>Data Manipulation>Flatten To String) and sent to the high priority user data function. Second is in the Dashboard project, as the type pattern at the top of an Unflatten From String that gets its binary string input from the high-priority user data. The unflattened value will be a cluster of exactly what you bundled in the robot project. If your user data is sufficiently simple, you can get away with not using a TypeDef to keep things synchronized. Just bundle the values in the robot project, and in the dashboard project use a cluster constant that matches what you bundled as the type input for the unflatten function. |
| All times are GMT -5. The time now is 00:50. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi