From: Daniel Liang on 30 Mar 2010 04:32 hi i m running a power grid project, and have to use MATLAB and transfer the calculation results back to LabView for display and further calculation. do i need MATLAB Script Node? can somebody advise how to do that? thanks.
From: Dave Robinson on 30 Mar 2010 06:18 "Daniel Liang" <lianghongzhu(a)gmail.com> wrote in message <hoscu6$90b$1(a)fred.mathworks.com>... > hi i m running a power grid project, and have to use MATLAB and transfer the calculation results back to LabView for display and further calculation. do i need MATLAB Script Node? can somebody advise how to do that? thanks. Its a bit difficult to answer this question, as there are many solutions, some of which will depend on the speed of the data transmission that you require. One fun method is to use TCP/IP (or UDP, although this is faster than TCP/IP, it is not as robust). Simply put in a TCP/IP server into your Labview (there is a block for that) and code in a Matlab client on your script. Now whenever your script has a value to transmit, it just writes it out to the client, and like magic the Labview will receive it. If your Labview and Matlab exist on the same machine just set the IPAddress for both server and Client to 127.0.0.1 and select port numbers which must be greater than 1024 (say 9000 for your server and 9001 for your client). The great thing about this technique is that the Labview and Matlab need not be on the same machine, and the same code works, although you have to use different IPAddresses and crack your firewalls to let the communication channels go through. this solution might not be as slick as some of the suggestions the Guru's will probably suggest, but I must admit that the fun in pressing a virtual button on one wireless conected computer changing the state of a totally seperate machine without the need of any cables is magic;-) Regards Dave Robinson
From: Alex Knight on 30 Mar 2010 09:27 "Dave Robinson" <dave.robinson(a)somewhere.biz> wrote in message <hosj4t$6hg$1(a)fred.mathworks.com>... > "Daniel Liang" <lianghongzhu(a)gmail.com> wrote in message <hoscu6$90b$1(a)fred.mathworks.com>... > > hi i m running a power grid project, and have to use MATLAB and transfer the calculation results back to LabView for display and further calculation. do i need MATLAB Script Node? can somebody advise how to do that? thanks. > > Its a bit difficult to answer this question, as there are many solutions, some of which will depend on the speed of the data transmission that you require. > As Dave says you need to define the parameters of your problem a bit better. For example, the obvious way is to just write the results out to a file... but will this be fast enough for your needs? There's also the question of what file type you need and the ease of reading/writing it in both environments. Obvious possibilities are MAT files (MATLAB native), binary files, text files, Excel files, TDM or TDMS files.... Alex
From: ade77 on 30 Mar 2010 11:24 "Daniel Liang" <lianghongzhu(a)gmail.com> wrote in message <hoscu6$90b$1(a)fred.mathworks.com>... > hi i m running a power grid project, and have to use MATLAB and transfer the calculation results back to LabView for display and further calculation. do i need MATLAB Script Node? can somebody advise how to do that? thanks. If you have LabVIEW and MATLAB installed on the same machine,then YES you can use the MATLAB script node. I use this method all the time. but mind you you can only pass variables like array, scalar etc. You can not pass structure or cell array, you will have to break it down into array or scalar. If you have problems, it will be better to post it to LabVIEW forum, then people can attach a VI or picture file to simplify any task you are doing.
From: Daniel Liang on 30 Mar 2010 21:05 "Daniel Liang" <lianghongzhu(a)gmail.com> wrote in message <hoscu6$90b$1(a)fred.mathworks.com>... > hi i m running a power grid project, and have to use MATLAB and transfer the calculation results back to LabView for display and further calculation. do i need MATLAB Script Node? can somebody advise how to do that? thanks. sounds great! thanks, everybody, for giving so many answers within 12h! will try it and post my result soon.
|
Pages: 1 Prev: sorting a mixed cell Next: request for voice recogniton coding |