Quote:
Originally Posted by kmckay
My understanding of a Network Table is that its an array variable out on the network. Depending on your code, you can create one or read one.
|
Correct, it's essentially a key/value data store (sometimes called a hash table or a dictionary) that's automatically replicated over the network. The values can be various data types (strings, numbers, arrays of strings, arrays of numbers, raw values), and the keys (always strings) are typically set up like filesystem paths so there are logical (optionally nested) "subtables" (even though the overall key namespace is flat). E.g. "/foo/bar", "/foo/baz" can be treated as a logical "/foo" subtable with "bar" and "baz" entries. Each program can arbitrarily read and write to values and these changes will be automatically synchronized across the network so that those changes are visible to the other programs.
There's one server (typically the robot program running on the roboRio) and all others are clients. Each program has a local copy of the entire data store and updates are periodically synchronized across the network. Note that Client-Client updates require two synchronization steps (Client to Server and Server to Client, as there's no direct Client-Client connections), and thus are slightly higher latency.
__________________
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)