Tip if you ever want to program network applications in LabVIEW

I can’t believe this, but I just made my job A LOT easier. In LabVIEW 8, NI came out with shared variables. These shared variables are network-publishable, meaning you can access the variables over a computer on the same network. I can’t believe I didn’t find them earlier. Before, you had to flatten a variable down to a string, find the length of the string, send the length of the string over TCP, read it, then make sure you read that number of bytes hoping none of it gets messed up because you have to unflatten that string just to restore it back to the original variable you were sending across.

Shared variables takes ALL of that out (or perhaps does it for you) with datasockets and allows you to keep the original structure of your variables.

Ahhh…that was a nice find.

I’m not sure whether we are talking about your FRC “job” or day job, but for the time being, shared variables will not be allowed in competition, and while they are still useful in a debug setting, they also have quite a bit of overhead for the small amount of data that you are wanting to send over.

Greg McKaskle