05-08-2024 06:14 AM
I want to be able to monitor and control an embedded device, but I can't find any info on how do that.
So lets say I have a teensy 4.1
It has an ethernet connection.
It's running my own code, I can add any library/SDK to it.
It performs some control loop, it's uses it's ADCs.
I want to feed back the ADC values and control loop variables to LabView via TCP (or UDP, I'm easy), and have LabVIEW send control requests/parameter updates to the device.
How do I do this?
I saw there was some kind of arduino sketch generator, but that seems defunct. It's also not quite what I want, as I have my own code. I just want to add a library, or SDK which will communicate with LabView.
If there's no lib or SDK, can it be done raw? I write both sides of this system myself?
Any pointers appreciated.
Thanks.
Solved! Go to Solution.
05-08-2024 06:20 AM - edited 05-08-2024 06:21 AM
Hi P,
@P_Shep wrote:
So lets say I have a teensy 4.1
It has an ethernet connection.
I want to feed back the ADC values and control loop variables to LabView via TCP (or UDP, I'm easy), and have LabVIEW send control requests/parameter updates to the device.
It's also not quite what I want, as I have my own code. I just want to add a library, or SDK which will communicate with LabView.
You "just" add a TCP (or UDP) library to your "teensy" code.
Then you can send messages from your LabVIEW program (on your Windows computer) to your "teensy" using the TCP (or UDP) protocol and response on those messages within your "teensy" program!
05-08-2024 07:16 AM
So there's no openly available protocol, just, gotta come up with my own? Was hoping not have to do that work, but OK!
Thanks.
05-08-2024 07:18 AM
@GerdW wrote:
Hi P,
You "just" add a TCP (or UDP) library to your "teensy" code.Then you can send messages from your LabVIEW program (on your Windows computer) to your "teensy" using the TCP (or UDP) protocol and response on those messages within your "teensy" program!
Alternatively, you can use VISA or other forms of serial communication (see "Arduino"), which will probably work over USB (as can TCP/IP).
Bob Schor
05-08-2024 07:56 AM - edited 05-08-2024 07:57 AM
As you are using TCP or UDP there different protocols available depending on how complicated/scalable/flexible you want to make it.
There are protocols like Modbus or gRPC which sit on top of TCP. Usually they come with some way of serializing and deserializing the data. gRPC uses protobuf as format..
For a simple project, I would use MessagePack to pack the data on the Teensy, send it via simple TCP and unpack it in Labview.
With this serialization/de serialization scheme you omit the error-prone manual byte/bit packing and the overhead is pretty negligible but its more efficient than just send the data as JSON (which also works).
05-08-2024 08:18 AM - edited 05-08-2024 08:42 AM
Those are some good suggestions, thank you!
The project in new, so I'm flexible with the mechanism.
Ideally, I'd like to be able to register parameters to acquire with a name, and have LabVIEW 'discover' them, and have the parameters streamed to LabVIEW at a specified rate