View Single Post
  #15   Spotlight this post!  
Unread 15-02-2012, 22:35
nmg49 nmg49 is offline
Registered User
FRC #2898
 
Join Date: Jan 2012
Location: Portland Oregon
Posts: 4
nmg49 is an unknown quantity at this point
Re: Labview on PC -> C++ on cRIO

Hi Greg, I'm a programmer working on the project in question. We tried to write up a simple test program to see if we could get data from the Dashboard to the Crio (running in C++). I don't have the Labview code handy, but here is the C code that's suppose to receive the data:

bool myBoolean;
Safety->Feed();
NetworkTable *myNetworkTable = new NetworkTable;
myNetworkTable->BeginTransaction();
myNetworkTable->GetTable("Robot");
myBoolean = myNetworkTable->GetBoolean("Test");
myNetworkTable->EndTransaction();
printf("%d, MyValue: \n", myBoolean);
Wait(1);
delete myNetworkTable;

Should this code be working? Are we doing anything wrong, at least on the receiving end?

Also, I was looking through the libraries a bit and I realized that the C++ and Labview functionality are different. For example, C++ doesn't have a function to create a Network Table (at least not one that's accessible from the NetworkTable class).

Any help you could give us on this would be amazing. Thanks.