LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Anyone has experience to transfer data from LabVIEW to MATLAB via LAN

Hi, everyone, I have 3 PCs,
PC A : DAQ using LabVIEW collect data from sensors via serial ports
PC B : use MATLAB to do a signal(data from PC A) processing
PC C : use MATLAB to control the signal from PC B so that a robot can follow the command.
This 3 PCs has been connected via LAN, how can I transfer this real time data between this PCs,basically PC A need to trasfer data to PC B and PC B need to transfer data to PC C.
Thanks a lot
0 Kudos
Message 1 of 5
(3,658 Views)
hi there

well, create a dll written in LabVIEW that uses DataSocket to transfer the data over network, then use the dll in matlab to send/receive data. the LabVIEW - PC holds the datasocket server. this will work, but due to the LAN not in true real time!!

best regards
chris
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 2 of 5
(3,650 Views)
Hi, Chris, than you for your reply.
I am really novice in LabVIEW, I am not sure is that the same dll in LabVIEW and MATLAB, and basically how to generate a dll in LabVIEW?
Best wishes
Tao
0 Kudos
Message 3 of 5
(3,647 Views)
hello

it's not that difficult to do that:

first you create two vis "read" and "write". you can test the data transfer between two LV applications till you're sure all is working fine. then you create a dll which contains the read and write - vi as functions. these dll - functions are then called from MATLAB, while you can still use the vis in LabVIEW. the functionality of the dll - functions is identical with those of the vis. as a first step you can use the "Data Client" and "Data Server" vis from the examples list.

To create a dll in LabVIEW go to Tools->"Build Application or shared Library (Dll)" and then click "Help".

best regards
chris
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 4 of 5
(3,644 Views)
I guess this is more a MATLAB than a LabVIEW question, but maybe someone has succeeded doing what chrisger suggested in his post.
I have created a very simple VI CalculateSum.vi that adds two numbers, and used LabVIEW to compile a DLL. This appears to work, and I receive (among other files) CalculateSum.dll and CalculateSum.h.
When I try to load this into MATLAB, I get the following error message:

>> loadlibrary CaluclateSum.dll CalculateSum.h
Warning: Message from C preprocessor:
lcc preprocessor warning: r:\Rasmus\matlab\call LabVIEW\platdefines.h:117 r:\Rasmus\matlab\call LabVIEW\extcode.h:36 r:\Rasmus\matlab\call LabVIEW\CalculateSum.h:1 #error directive: "We don't know the Compiler"
lcc preprocessor warning: r:\Rasmus\matlab\call LabVIEW\platdefines.h:317 r:\Rasmus\matlab\call LabVIEW\extcode.h:36 r:\Rasmus\matlab\call LabVIEW\CalculateSum.h:1 #error directive:

> In loadlibrary at 268
Warning: Warnings messages were produced while parsing. Check the functions you
intend to use for correctness. Warning text can be viewed using:
[notfound,warnings]=loadlibrary(...)
> In loadlibrary at 277
??? There was an error loading the library "CaluclateSum.dll"
Error using ==> loaddefinedlibrary
The specified module could not be found.

I am using MATLAB R2007a and LabVIEW 8.20.
0 Kudos
Message 5 of 5
(3,449 Views)