Rust & LabVIEW Integration

Hey y'all,

Using the strategies outlined by the Rust FFI Ombnibus, I wrote some examples to demonstrate using Rust with LabVIEW and LabVIEW NXG. Lots of engineers and scientists use LabVIEW for their automated test and measurement systems, so I hope these examples will help them benefit from Rust :slight_smile: .

GitHub link
A few pictures of the LabVIEW source

[disclosure: I work at National Instruments]

4 Likes

Very cool!

As LabVIEW has its own error-handling which isn't that different from Rust. Do you think it would be possible to hand Rust errors over to LabVIEW? For example, what happens if you hand in an invalid path to the load-VI?

LabVIEW does not have equivalent to Rust's enums in the general case, so representing values like Result<T, E> would be difficult to do idiomatically. The closest thing to a union type in LabVIEW is the Variant type, which is close to Rust's Any type. Idiomatically translating Rust errors into LabVIEW might entail:

  • LabVIEW editor integration to recognize Result<T, E> and translate it to Variant or to multiple T/E terminals
  • Translating E types into LabVIEW's error cluster type (Error.gtype in NXG)
1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.