Getting Matlab script server to reintialize

Is there a way to reinitailize the matlab scipt server if it crashes during run-time of a labview application?
The problem is that when the matlab window is closed by the user the link is broken and the application stops working.
Is there a way to catch this error and then reload the matlab script server window/ connection during runtime so that the app
does not have to be halted, closed and reopened to reestablish the funcitonality
Thank for any input
Bryan S
x9561 (148440)
1/30/2006 7:10:11 PM
comp.lang.labview 35213 articles. 1 followers. vasusachin24 (1) is leader. Post Follow

2 Replies

Similar Articles

[PageSpeed] 49

Could you package the Matlab Script Node code into a subVI and call that subVI dynamically using VI Server? The idea would be that you could poll the error output from the Matlab Script node to see if the Matlab window has been closed, thus closing the link. If it does occur, terminate the dynamic subVI and call it again from the main VI. This should completely emulate "closing and reopening the app."
<a href="http://zone.ni.com/reference/en-XX/help/371361A-01/lverror/matlab_and_hiq_script_code/" target="_blank">Here</a> is a link on getting started using VI Server to call VIs dynamically. The Help document references LabVIEW 8, but the process is the same for earlier versions.
x9561 (148440)
1/31/2006 10:41:17 PM
Here's an example of what I mean. There are two VIs, main VI.vi and Dynamic subVI.vi. Main VI calls Dynamic subVI, which should simulate your script node code, and then polls the error output of the subVI. If the subVI generates a specific error, the main VI automatically relaunches it dynamically.
The example was written in LabVIEW 7.1. Just make sure the VIs are in the same directory when running them. Hope this helps!

Dynamic subVI.vi:
http://forums.ni.com/attachments/ni/170/164464/1/Dynamic subVI.vi

Main VI.vi:
http://forums.ni.com/attachments/ni/170/164464/2/Main VI.vi
x9561 (148440)
1/31/2006 11:10:50 PM

Similar Artilces:

Error 1047 in LabVIEW 8.2: LabVIEW failed to send variable to the script server. Server:&quot;&quot;
I am working with the evaluation version of labVIEW as well and I have run into another error.&nbsp; I am using a MATLAB script node within a for loop and attempting to pass the for loop counter variable into the script.&nbsp; When I run the code it brings up a 1047 error and says "LabVIEW failed to send variable to the script server. Server:"" ".&nbsp; I looked up the error online which seems to have roots in a failed auto initialization of MATLAB.&nbsp; Is there something that I can do in labVIEW to fix the problem or is it strictly a MATLAB error? &nbsp; I really appreciate your help. Hi Patsenat, &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; We have a knowledgebase document on our system referring to this issue.&nbsp; Try reading through <a href="http://digital.ni.com/public.nsf/allkb/2B3FF46C8512C4F786256CF30071BE53?OpenDocument" target="_blank">this</a> and attempting what it says.&nbsp; If you still have problems, please post again. ...

Matlab DLL vs Matlab script in LabView
Hello, &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;I have some question for those who successed to import the Matlab DLL's to&nbsp; LabView&nbsp; :smileyhappy:&nbsp;: &nbsp;Is there significant time difference between processing the matlab routine thru the DLL&nbsp; and between the Matlab script in LabView ? &nbsp;For the&nbsp; RT&nbsp;&nbsp;&nbsp;program that&nbsp;I am doing in LabView the time is very impotent, and&nbsp;as&nbsp;I&nbsp; measured , the code&nbsp;writen &nbsp;in Matlab script &nbsp;takes&nbsp;10 times more then the&nbsp;same &nbsp;C&nbsp; code using DLL&nbsp; ( 20ms.&nbsp; vs 2ms.) . As I understand, importing DLL from Matlab to &nbsp;LabView is not so easy,&nbsp; so before I "step at the deep"&nbsp; I would like to ask, if I would have the&nbsp; shorter time in Matlab&nbsp;DLL, than in Matlab script? &nbsp; &nbsp;Thanks &nbsp; Michael Shklyar &nbsp;&nbsp; Hello Michael, Are you actually running this application in the LabVIEW Real-Time OS?&nbsp; The Matlab Script uses ActiveX calls and only works on a Windows Operating&nbsp;System.&nbsp; Calling the dlls in&nbsp;Call Library Function Node&nbsp;would be a more difficult that using the Matlab Script Node.&nbsp;&nbsp;You will need the function names in the dll as well as the parameter list.&nbsp; Good luck&nbsp;&nbsp; ...

Launching non-blocking MATLAB scripts on a linux server from MATLAB on Windows
Hi all I have a linux box with MATLAB installed on it. I want to launch some MATLAB scripts on it from MATLAB on my desktop PC, but I don't want the command to block, i.e. I want the command prompt re-appear immediately, and for the command to be run asynchronously on the box. To be clear, every command I send should start a new instance of MATLAB on the linux box, and run in that. There is no communication between the two MATLABs once the command is sent. I can do this from a linux PC fine, using: a = round(clock); str = sprintf('ssh cvg-1 "nohup /opt/matlab2010a/bin/ma...

Display Matlab messages when the function is called by Labview via Matlab script
I use Labview (version 6.1) to send variables to Matlab (version 7.0.4) via Matlab script and&nbsp;I would like to display some message on the command window of Matlab. The messages are displayed&nbsp;when I call my Matlab function from the command window of Matlab but not when&nbsp;the&nbsp;function is called&nbsp;from Labview. &nbsp; Do you have any idea how to solve this problem ? &nbsp; Regards, &nbsp; Julien. ...

Why can I not re-launch a Matlab script from within LabView after exiting the Matlab application?
I am currently using LabView 6.1 and Matlab 5.2. When I insert a script node into LabView, I can run it as many times I want to, as expected. However, if I exit Matlab after executing my vi, I have to exit LabView as well to be able to run the script again. Can anybody solve this? This is a problem with LabVIEW that seems to be fixed in LabVIEW 7. The fix is to programatically not allow Matlab to be exited. ...

Script Matlab In Labview
Buongiorno a tutti, sono nuovo di questo forum.&nbsp;Sono un tirocinante presso l'universit� di Napoli Federico II e sto familiarizzando con l'ambiente LabView. Mi � stato assegnato il compito di eseguire uno script Matlab mediante LabView (le macchine su cui lavoro possiedono la versione 7.0 e 8.5). Se mi sapete dare qualche informazione ve ne sarei grato&nbsp;o&nbsp;anche qualche link visto che sto agli inizi. &nbsp; Saluti. Sorry, can you move this question to italian community? Thanks ...

Using VI server from DIAdem script :: Syntax (documentation) for properties and methods of VI Server objects (for non-labview programmers)
Hello all, &nbsp; I am using DIAdem 10.0 Advanced, LabVIEW 8.0 PDS. I would like to start a LabVIEW IHM from a VBS script. I use VI Server to call my VI from DIAdem. &nbsp; Here is the script and the VI I use (VI attached): &nbsp; Dim lvapp, vi, viPath, paramName(1), paramVal(1)Set lvapp = CreateObject("LabVIEW.Application")viPath = "C:\TEST\test.vi" Set vi = lvapp.GetVIReference(viPath)vi.FPWinOpen = TrueparamName(0) = "Input"paramVal(0) = 10paramName(1) = "Output"paramVal(1) = 0Call vi.Call(paramName, paramVal)Call lvapp.Quit() &nbsp; I found a similar example on your web site. &nbsp; Question 1: I need to know the syntax for all the other properties and methods of a VI object (method like Get or Set Control Value for example). Is a documentation (other than the LabVIEW help which is dedicated for LV programmers) exist in order to be able to use all the features of VI Server from another environment (CVI, VB, ...)? &nbsp; Question 2: Is it possible to call a VI with VI Server with the parameter "Wait until done" to FALSE? (run a VI asynchronuously from DIAdem) &nbsp; Thanks for your answer. &nbsp; MatthieuG Eurilogic Test.vi: http://forums.ni.com/attachments/ni/170/184020/1/Test.vi Hello, I finally found a way to get the documentation of VI Server. I can view the "LabVIEW.TLB" type library file with a&nbsp;OLE/COM Object Viewer (a utility from the Windows SDK). &nbsp; ...

Re: Matlab script in Labview
hi ... im trying to use matlab codes in labview... but i can't get the input data type right i've attached my codes.. could anyone teach me how to change the data types.... do i need anything to run ,matlab codes ?? i heard about something called activeX .. could anyone please hepl me ?? thanx matlab_input.vi: http://forums.ni.com/attachments/ni/170/205805/1/matlab_input.vi hi ... i just found out that labview 7.1 does not support matlab toolbox... im not so familiar with matlab and i have codes using the toolbox.. is there any thing i can do about that? i've attached my matlab codes.. please help me thanks matlab.vi: http://forums.ni.com/attachments/ni/170/206169/1/matlab.vi Hey Kupikupi, When you use LabVIEW to run MATLAB through M-script nodes, you need to have MATLAB and any toolboxes you want to use installed on your machine. What is really happening is LabVIEW is opening MATLAB up behind the scenes (using ActiveX, which is included in Windows) and sending your script to it. LabVIEW doesn't really care about the MATLAB toolboxes. If your script works in MATLAB, it should work from a M-script node in LabVIEW. If you could provide a little more information, it may help debug your program. Can you run "ver" in MATLAB and post the results so we can see what toolboxes you have installed? Also, I'd suggest running your script in short bits to help identify where the bug is. Chris hi chris .. thanks for the reply ... here'...

Problem using Matlab Script in Labview
Hi All, I'm a relative new user of labview. I've to work on both matlab and labview. But I'm not able to execute any matlab script in labview as it returns an error saying "Error message from server". I'm currently using Labview-6 and Matlab-6.5. I tried with the Matlab running. It did not help. Could anybody help me out regarding this as it is a very urgent requirement for my task. Regards Srijith Try reading this article from our website, I think it addresses your issue. <a href="http://digital.ni.com/public.nsf/websearch/CE309627064A3D5686256A9C005B0A5F?OpenDocument" target="_blank">http://digital.ni.com/public.nsf/websearch/CE309627064A3D5686256A9C005B0A5F?OpenDocument</a> I hope this helps. Casey Weltzin, National Instruments ...

how to get matlab scripts to work with GUIDE
Hi, i have 3 matlab scripts. ive started to use Guide to create a GUI, but i dont know how to diplay the script in guide. can anyone help please. thanks. vishan <vishan.sondhi@guidance.eu.com> wrote in message <18898876.78998.1246880042205.JavaMail.jakarta@nitrogen.mathforum.org>... > Hi, i have 3 matlab scripts. ive started to use Guide to create a GUI, but i dont know how to diplay the script in guide. > can anyone help please. thanks. When you create a GUI, MATLAB automatically creates an m-file for it. You can just copy and paste your script into this m-file where y...

matlab script window in labview 7.0
In labview 7.0 the matlab window associated with the scripts server is normally hidden and not accessible to the user. In LV 6.x it was and provided a flexible and interactive way of collecting, analyzing and storing data as matlab workspace. Is there an alternative way to access the script server and its workspace under LV 7 ? The script server window is not hidden on my machine and I am using LV 7 with Matlab R12. I am not sure how to change this setting (or even if it's possible). ...

I get error 1048 when using a MatLab script node
Hi, I've been getting error 1048 (LabVIEW failed to get variable from server) when using a MatLab script node in my VI.&nbsp; Previously I was getting error 1047 (LabVIEW failed to pass variable to server)&nbsp; but I fixed that by putting "scriptNodeWait = 500" in labview.ini.&nbsp; I have read all of the help and knowledgebase documents and previous posts but can't get anything to work.&nbsp; The code definitely works in MatLab.&nbsp; Is there anything I can do to figure out what's going on?I'm running LabVIEW 8.2 on Windows XP with MatLab 7.4.0 (R2007a) The full error is "LabVIEW: LabVIEW failed to get variable from server.&nbsp; Undefined function or variable '*my variable*'." Also, the example file Lorenz Diff Eq.vi works fine. Glen, Can you verify that any outputs of the script node are being created in the script?&nbsp; For example, if your script node has an output called "myvariable", make sure that the script inside the node creates a variable called "myvariable".&nbsp; If you can post the VI that is causing the problem, I may be able to help you more. Chris M ...

Calling a VB Script and Matlab code from LabVIEW GUI.
Hi, Can anyone help me out in Calling a VB Script and Matlab code from LabVIEW GUI? GUI will be developed in Labview and currently we have some scripts written in VB and Matlab and we need to incorporate the same through LabVIEW.&nbsp;Can anyone let me know how this can be implemented?&nbsp; &nbsp; Regards, Sharmash Sharmash, My first question is, why not write your program in LabVIEW instead of VB? Is the code already written in VB? If so, consider compiling your code into a dll and then using a Call <a href="http://zone.ni.com/reference/en-XX/help/371361B-01/glang/call_library_function/" target="_blank">Library Function Node </a>&nbsp;to call that dll. As for the Matlab portion of your question, consider the <a href="http://zone.ni.com/reference/en-XX/help/371361B-01/gmath/mathscript_node/" target="_blank">MathScript node</a>&nbsp;as an option. &nbsp; &nbsp; Chris C Hi, &nbsp;&nbsp;&nbsp;&nbsp; Yes the codes are already developed in Excel , VB and Matlab. I have to interface all the three codes with labview insuch way that i should pass inputs and captures outputs from the codes after executing. I have test for matlab and it's working with matlab script. But i don't know how to do with Excel sheet. VB part I haven't tried yet, as after Excel i have to look for it. &nbsp; how can i interface Excel Sheet with labview using Active X? ...

labview unable to send variable to matlab script sever
Hello, i am using LV-8. whenever i use matlab script&nbsp;node to solve two simultaneous non-linear equation it generates an error message"unable to send variable to matlab server". Please help me in this matter. what other methodws can i use to get solution of such equation. matlab.vi: http://forums.ni.com/attachments/ni/170/331566/1/matlab.vi You need to define the variables x, y, z. For example, by adding the following lines to the beginning: x = 0;y = 0;z = 0; ...

getting clusters from LabVIEW ActiveX Server with Excel/VBA
Hello,my colleague and I are trying to control a LV from Excel (VBA) by ActiveX.I.E.:We do something like :-------------------------Set LV = createObject("LabVIEW.Application")Set VI = LV.GetVIReference("Path_to_VI")ParamNames(0) = "Input1"ParamNames(1) = "Input2"ParamNames(2) = "Output"ParamValues(0) = 1ParamValues(1) = 3.1415Call VI.Call(ParamNames,ParamValues)msgbox("output =" &amp; ParamVals(2)) -------------------------------This works perfectly for simple data types (int, double, float, string, etc )Now we need to transfer more complex structures, which are originaly LV-clusters.But we did not find any clue on how do that (especially receive clusters) in the help or on the internet.Is there any chance to succeed ???TIA,Thomas Actually, working with clusters is really really easy. Through the magic of - well something - a cluster in LV comes out in the VBA environment as an array of variants. There was an activex example that shipped with V7.1 that showed this very thing. I couldn't find them in V8 so here is the 7.1 stuff. Check out the macros in the Excel spreadsheet... This show running the VI in the development environment, but if this looks interesting I can fill you in on how to make it work in an executable.Mike... freqresp.xls: http://forums.ni.com/attachments/ni/170/249581/1/freqresp.xls Frequency Response.llb: http://forums.ni.com/attachments/ni/170/249581/2/Frequency Response.llb ...

error: 1050 using matlab script node in labview
i m facing the error 1050 while executing a simulnk program ............i was trying to invoke a program of coupled tank that i modeled in Matlab through the built in function of LabVIEW( "matlab script node")......... PLEASE HELP Thanks in Advance Pavan Kr Kahar NIT SILCHAR INDIA Hi, I am not very clear as to what your problem is. Are you using the Scrip Node from within LabVIEW? Can you please post a screenshot for clarification? ...

Help Importing into Labview for use as a matrix in Matlab script node
Hello, I was hoping someone could help me out with a labview / Matlab script problem. I'm using Labview to allow someone to specify which file to load, inparticular a Labview measurement file appears to load my text file in a spreadsheet format(which is what I want, see ex. text file code below), then I want to use the loaded file as an input into my Matlab script box as a matrix for use in the Matlab code. Can I do this? This is my text file. 1004,30,0,1.43 1003,304,0,1.34 etc So the Labview measurement file seems to space everything out into a matrix format like I want, but I can't tell if there are any errors in the matlab script or whatnot. I'm using events to wait for the user input. The matlab script has a variable named DATA as the input variable in matrix format, then I just connected this variable to the output from the measurement load file box, but it doesn't work, thanks for any help. P.S. I also am having a problem with my event structures. I have an event, that is inside a while loop like the code suggests, but when I run the program the button I click gives me the results I want, but if I click it a second time the program freezes or doesn't respond... I think the "Spreadsheet String to Array" function will serve your purposes here. You need to convert your comma delimited file into a 2D array. The Spreadsheet String to Array function does this for you. See the attached example. &nbsp; As for for your second qu...

How to get url of current url from included script on different server
I have a banner script that is included in php on a website but the actual script is hosted on a different site allowing me to only edit one file to update the script. I need to store in a variable the hostname that the included script is being run on NOT the master url where it is hosted. Everything I try gives the url of where the script is hosted and NOT the location of the page where it is being called from which is what I want as I need be able to tell the banner script not to show the banner for the site which is it on. tia Venturer said the following on 10/01/2006 09:52: > I have a banner script that is included in php on a website but the > actual script is hosted on a different site allowing me to only edit > one file to update the script. > > I need to store in a variable the hostname that the included script is > being run on NOT the master url where it is hosted. I'm assuming you're include()-ing the script as something like: include("http://remote.server.example.com/script.php"); Is the remote server set to execute PHP or not? * If it is, then script.php is being run on the remote server, not the local server, so you're actually include()-ing the *output* of script.php, not the PHP code itself. In which case, you will need to either pass the hostname in the request for script.php, e.g.: include("http://remote.server.example.com/script.php?host=http://local.example.com/mainscript.php"); * If the rem...

Server to server = Server client to server?
For a server to server connection, is the connecting server considered as a client of the accepting server or is it not? I have the following classes: Connection <--- base class of the following two ClientConnection <--- client ServerConnection <--- server ServerClientConnection <--- server as a client of another server. But then I came across something that states "A client is anything connected to a server that is not another client". Comments please... Just remember! Server ( programm ) is always listening a connections!!! - wrote: &g...

how to do complex engineering calculation in labview.I tried using MATLAB script
Hello, I am trying to use matlab script node to solve two complex equation.But i get different &nbsp;errors everytime i run my program.sometimes 1048 sometimes 1050 and sometimes it says LABVIEW could not extract variable from Matlab.I am&nbsp;attaching &nbsp;my MATLAB script node with this thread.Please Help me out to get rid of this problem. I am &nbsp;using LV-8 and MATLAB R-2006a. matlab.vi: http://forums.ni.com/attachments/ni/170/331441/1/matlab.vi Hi Praween, not able to look at your vi at the moment, but have you tried to do your calculation with simple LabView functions?LabView has Complex datatypes and math functions are able to calc with complex numbers... Hi Praween, beside my little MatLab knowledge I tried to replace your formula with equivalent LV code... matlab_lv80.vi: http://forums.ni.com/attachments/ni/170/331453/1/matlab_lv80.vi Dear GerdW, Thanks for reply.But there's a bit of misunderstanding of problem from your side. I meant how to calculate the value of x and y by simultaneously solving the two equation(with given values of t1,t2 and z=100).Thrugh your LV code you are just formulating the two equation,but not giving the value of x and y .To remind you x and y are not controls rather they are indicators. Hi Praween, I just read an explanation of the "solve()" command, but I don't see their correct use in your MatLab structure!?!Where is the equation to solve? You only give one side of the equation, but the solut...

no automatic maltlab startup with matlab script used in Labview 6.1
When&nbsp;I insert a matlab script node in my&nbsp;VI and I run this VI, Matlab won't automatically startup. &nbsp; On a other setup I'am using Matlab 6.1 with Labview 6.1 and there Matlab does starts automatically and the VI works great. &nbsp; On this setup I'am using Matlab 7 with Labview 6. &nbsp; Does anybode know how the solve this problem? &nbsp; I already installed the NI patch mathscript.dll but that didnt work. &nbsp; &nbsp; &nbsp; &nbsp; ...

What server PC is recommende for Labview server?
Hello , &nbsp; I am constructing a Labview web server based remote intrumentation system, and i have instaled this server on a generic PC that often suffers from system crashes. I know i can install this server on a better machine that wont fail after several days or month of operation?. I am thinking of a custom PC formed by me with a Dual Core processor, al least 1Gb RAM, enough hard drive space, Intel motherboard and a good power source. Also i am thinking on a Dell Server, or HP machine that would garantee lots of day of good work. &nbsp; What would you do? &nbsp; &nbsp; Thanks and best regards What would you do? Find out why it's crashing first. Is it crashing due to the LabVIEW app, or from a crappy OS? I think the problem resides in the OS , but i dont know if its because a bad driver installation (Labview doesnt participate on this i think). The thing is i must access my computer remotely often to apply little updates the the Labview program, but it happens that after a few days i am unable to accces it because of this reboots ; when i check the PC&nbsp;, windows tells me that a severe error ocurred, windows crashed because of a bad driver instalation or something like that, &nbsp;it also says&nbsp;that a blue screen was displayed because of&nbsp;system failure&nbsp;( The blue screen with memory adreesses&nbsp;is one of the worst system crash that windows can make in my experience) and i must send an error report. Just fo...

Send scripts to Cygwin from matlab script
Hello everyone, I am currently building a GUI over a numerical model that was initially designed to run under Linux. However, I'd like to make my package as much as possible platform-independent, so I adopted the Cygwin option for Windows. However, I didn't manage yet to find the way to send my script and my variables to be interpreted under Cygwin. The problem is that the model will be in a folder that will dynamically change with every different user. Also, different variables will be fed to the model by the user, so I need to pass them from the Matlab command. I obviously tried t...

can Matlab support 32-bit matlab version scripts on 64-bit version of matlab
can Matlab support 32-bit matlab version scripts on 64-bit version of matlab in windows platform?.if yes , how is the performance better ? please do answer this question thank u "Gangamma " <gangvsng@gmail.com> wrote in message <hvmr7h$sn0$1@fred.mathworks.com>... > can Matlab support 32-bit matlab version scripts on 64-bit version of matlab in windows platform?.if yes , how is the performance better ? Yes, Matlab program written in 32/64 bits are compatible accepted MEX file. 64-bit version can handle larger array but does *NOT* improve speed. Br...

Web resources about - Getting Matlab script server to reintialize - comp.lang.labview

Resources last updated: 3/29/2016 12:40:22 AM