Go to Post You guys can send [Wisconsin] some warm Florida weather, its getting cold up here again. - Ricky Q. [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 08-01-2017, 12:40
Peter Johnson Peter Johnson is offline
WPILib Developer
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 265
Peter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud of
Re: Error while trying to setup NetworkTables on PC

Quote:
Originally Posted by Darksainor View Post

Program (This is just for testing and learning purposes):
Code:
#include <ntcore.h>
#include <networktables/NetworkTable.h>
using std::shared_ptr;

int main() {
	NetworkTable::SetClientMode();
	NetworkTable::SetIPAddress("10.46.35.2");
	NetworkTable::Initialize();
	shared_ptr<NetworkTable> myTable = NetworkTable::GetTable("SmartDashboard");
	myTable->PutString("ExampleString", "Sample Text");
	NetworkTable::Shutdown();
	return 0;
}
After you fix the build error, you'll find that this program won't actually set a value. All NetworkTables calls are non-blocking, so the program will exit before it has a chance to connect to the server. You'll need to put the PutString in a loop or add a few seconds delay at the end. Note you'll want a loop for image processing anyway.
__________________
Author of cscore - WPILib CameraServer for 2017+
Author of ntcore - WPILib NetworkTables for 2016+
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)
Reply With Quote
 


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 13:33.

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