Data-exchange Julia-LabView

This is a working example (on the LabVIEW side). The both loops access the Julia server concurrently. The roundtrip time for light loads is well below 1 ms on the average and below 20 ms max
example3.vi Front Panel roundtrip values

For large binary data sent from LV to Julia the roundtrip time grows by approx. 4 ms/MB.

The project is undocumented yet and needs a thorough clean-up, but is already usable (see example3.vi and example4.vi).

How to use:

  • Install ZMQ for LV and ZMQ.jl and JSON3.jl on Julia side.
  • On the LV side, you define a cluster with field names corresponding to the arguments you want to pass to your Julia function, and an additional string field named “fun2call” for the name of your Julia function. You may additionaly create a byte array to be passed as binary data
  • On the Julia side you define your functions with corresponding names, which must accept keyword arguments only, argument names see above. For binary data, if any, additional keyword argument “bin_data”. The result must be a named tuple or anything else, convertable to JSON.
  • On the LV side you parse the JSON string to a cluster. Additionally it is your responsibility to parse binary data returned by Julia server (returning binary data not implemented yet).

TODO:

  • Clean-up
  • Documentation
  • Error handling
  • Returning binary data
  • Utilities to encode/decode some common data types to binary data (arrays of different floats and integer types)
  • Timeouts
  • LabVIEW server and Julia client

Timescale undefined (and depends on the interest), but I hope to deal with the first two items of the list on a reasonable timescale.

The LabVIEW part is LV2018. If anybody interested, I could try to save the library for an earlier version.

3 Likes