LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Read Serial Data to Matlab

Hi,
     I want to use the Math Interface Toolkit to allow my matlab code to access the Serial Port in Labview but I'm having trouble  passing the read values back to Matlab. The Labview vi to write/read works fine on its own (data is written and read OK) and the data to be written is passed from Matlab to Labview successfully when using the mex function but I can't get the read data back into Matlab again. The mex file format is
 
 ReadData=LVSerialPort(BytesToRead,DataBits,BaudRate,TimeOut,WriteData)
 
but ReadData only returns an empty array. I've already checked that ReadData is selected as a vi output. Should I be using a sequence structure to control when the read data is returned?
 
Thanks for any help
 
Emrys
0 Kudos
Message 1 of 2
(2,797 Views)
Are you able to communicate via serial with the LabVIEW code? If so, what is the problem in executing this and then passing the data into your MatLAB code?

Do any example programs help? I can't help you much I'm sorry as without matlab, I can't really try anything.

Maybe somebody who uses these products can help us out??
0 Kudos
Message 2 of 2
(2,772 Views)