Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Need help with Network Tables (http://www.chiefdelphi.com/forums/showthread.php?t=144476)

peterl 02-22-2016 10:28 PM

Need help with Network Tables
 
I have no experience with Network Tables. I need to send an 2d array to a LabVIEW dashboard using network tables, and I don't quite know where to start.

Code:

public java.lang.Boolean[] getBooleanArray(java.lang.String key,
                                          java.lang.Boolean[] defaultValue)

I found that on the Java Docs on: https://team2168.org/javadoc/

If someone used Network Tables to comunicate to a dashboard last year and could post that code, I think I could gain a further understanding of network tables from that.
Thanks.

fireXtract 02-23-2016 02:05 PM

Re: Need help with Network Tables
 
For my usage I use:
Code:


        public NetworkTable table = NetworkTable.getTable("locationOfItem");
                        actualVariable = table.getNumberArray("arrayItem", defaultValue);
                        SmartDashboard.putNumber("displayName", actualVariable[0]);

This uses arrays, but you could use it with just numbers by using different getNumber with table.

Arhowk 02-23-2016 11:27 PM

Re: Need help with Network Tables
 
We just got support for 1D arrays this year, I don't think 2D arrays are currently viable (unless the above poster's solution works for you)

if you ABSOLUTELY need a table, and you can do some data processing on the dashboard (not familiar with configuring the lv dashboard), than you can always send the data as a string encoded with the raw bytes of the 2D array

peterl 02-24-2016 10:32 AM

Re: Need help with Network Tables
 
Quote:

Originally Posted by Arhowk (Post 1545633)
We just got support for 1D arrays this year, I don't think 2D arrays are currently viable (unless the above poster's solution works for you)

if you ABSOLUTELY need a table, and you can do some data processing on the dashboard (not familiar with configuring the lv dashboard), than you can always send the data as a string encoded with the raw bytes of the 2D array

I didn't realize that. If I can send 2 1D arrays, I can combine them to create a 2D Array. I will see about trying fireXtract's method.

Arhowk 02-24-2016 12:22 PM

Re: Need help with Network Tables
 
Quote:

Originally Posted by peterl (Post 1545890)
I didn't realize that. If I can send 2 1D arrays, I can combine them to create a 2D Array. I will see about trying fireXtract's method.

It depends on the scope of your project. If it is a static amount of arrays than yes you could always just use 5 different 1D arrays.


All times are GMT -5. The time now is 07:58 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi