Go to Post this is robotics--everything is going to go wrong at some point, it's how we deal with it that counts - abigailthefox [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 16-02-2009, 11:15
jrz126 jrz126 is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Erie, PA
Posts: 12
jrz126 is an unknown quantity at this point
Set User Data Help

I'm trying to send some camera target info back to the driverstation. I'm not sure how to send back the "area %" though.

At first i tried sending it directly through and I would only see a value of 0-1 on the driverstation. I think the area % was actually reading 0.4-0.5 so it may have just been rounding?

I tried typecasting it to a 32bit integer. which converted it from a floating point to a big integer number. On the dashboard though, it appears that it is only sending the least significant bits.

Is there an easy way to break this number up into an array of 8 bit numbers? Also, what does the little red mark mean on the last input to the build array block and the set user data block?
Attached Thumbnails
Click image for larger version

Name:	setuserdata.JPG
Views:	35
Size:	14.4 KB
ID:	7475  
Reply With Quote
  #2   Spotlight this post!  
Unread 16-02-2009, 20:01
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,752
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: Set User Data Help

You don't want to cast a float as an integer. That would give you the bit pattern of a float interpreted as an integer, and it would pretty much be nonsense until cast back as a float. What you really want to do is add the float to the cluster as a float, then everything can be flattened as a TCP string buffer. Back on the PC, you can unflatten and you will receive the exact same values. Then you can display them however you like -- sliders, meters, numerics, graphs, etc.

Greg McKaskle
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending user data, parsing user data. demosthenes2k8 NI LabVIEW 3 30-01-2009 13:51
User code (syntax error, help?) Kuiper Programming 2 23-06-2008 18:33
Looking for CHP Field Set-up Help RoboMom Championship Event 2 15-04-2006 14:12
Need help with Data recovery [urgent] plutonium83 Chit-Chat 7 11-01-2005 10:35


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

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