View Single Post
  #1   Spotlight this post!  
Unread 03-02-2013, 20:07
IDKnow IDKnow is offline
Registered User
FRC #1671
 
Join Date: Feb 2013
Location: California
Posts: 8
IDKnow is an unknown quantity at this point
C++ Network Tables

I am attempting to use the network tables class to pass values from my SmartDashboard extensions to the robot.

This thread describes the process using Java
http://www.chiefdelphi.com/forums/sh...d.php?t=103352
but it seems to imply near the end that the same process will not work for C++

In my code and in the windows API I could find equivalent commands though- for everything other than begin and end transaction.

Without these, the robot crashes as soon an i try TableName->GetNumber("",0);

Am I missing something?

Code:
//declarations:
NetworkTable *Vision;
float d;
//initialization
Vision->GetTable("VisionTable");//should create table if does not exist
//control loop (where it crashes)
if (Vision->IsConnected())
{
     //Vision->beginTransaction();
     d = Vision->GetNumber("d",0);//where 0 is default if "d" does not exist
     //Vision->endTransaction();
}
Reply With Quote