LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to monitor and control a my own device via LabView

Solved!
Go to solution

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.

0 Kudos
Message 1 of 6
(644 Views)
Solution
Accepted by P_Shep

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!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(641 Views)

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.

0 Kudos
Message 3 of 6
(609 Views)

@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

Message 4 of 6
(607 Views)

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). 

Message 5 of 6
(590 Views)

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

0 Kudos
Message 6 of 6
(575 Views)