LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

calling labVIEW vi from matlab

i want to pass data (modulated sine wave) from matlab into labview, transmit it (through the NI-DAQ card) into a channel, receive it back on the input port of the card and pass the data back from labVIEW into matlab. i built the vi and compiled the corresponding mex function. when called, the function runs without error but the problem is that i get back only noisy values and i have also verified with the help of a CRO that no actual wave is transmitted. i.e., it seems that the labVIEW vi doesn't actually run (though the LabVIEW window does open). this after i have selected the "load front panel" option in the vi properties. i might add that when i created a vi that uses the "simulate sine signal" tool of labVIEW itself to transmit a sine wave over the channel (As against using data from matlab, as in the former case) but receive the data into matlab only (as in the former case), the VI runs when called from matlab, the CRO shows sine waves being transmitted and received and the data i receive into matlab is an attenuated sine wave as expected. any MIT pro who can help me out? Thanks.
0 Kudos
Message 1 of 2
(3,170 Views)

It sounds like the problem is not that the VI isn't running, but rather that the data it is "receiving" from MATLAB is getting messedu up. This conclusion is drawn, of course, from the fact that simulated data can successfully be written and read in LabVIEW and passed to MATLAB using the same methods. The only way to get to the bottom of this dilemma is going to be to do some good, old-fashioned troubleshooting.

Since we believe that the problem lies in MATLAB passing data to LabVIEW, the first thing you can try is putting a pause at the beginning of your LabVIEW code and creating a graph on the VI's front panel to show the data before it is written. If it is jumbled there, then you'll next want to check the data inside of MATLAB before it is passed. If that data is okay, then you've narrowed it down to the actual transfer, and you should then start making sure that you are matching the proper datatypes and formats. Hope this points you in the right direction!

Kind Regards,

E. Sulzer
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,153 Views)