f



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
0
x9561 (148438)
1/30/2006 7:10:11 PM
comp.lang.labview 35210 articles. 1 followers. vasusachin24 (1) is leader. Post Follow

2 Replies
517 Views

Similar Articles

[PageSpeed] 43

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.
0
x9561 (148438)
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
0
x9561 (148438)
1/31/2006 11:10:50 PM
Reply: