610 Posted September 8, 2007 Report Share Posted September 8, 2007 Hello I have imported a model as a DLL from Simulink to LabVIEW using Simulation Interface Toolkit 3.0.1 and I execute it on a Windows computer. The model is a simulator of real mechatronic device and is very complex so I decided to import that instead of writing it from the beginning in LV. My aim is to test some control algorithms (like PID, fuzzy, etc) on this model in LV before I apply them on real device. I'd like to get a subVI with that model as a kind of black box with some inputs and outputs and put it to the control loop similar to that demo: http://forums.lavag.org/index.php?act=attach&type=post&id=6880 Imported model works fine independently from Matlab but I can't create a subVI to put it in closed control loop. Below is a diagram with my model automatically generated by SIT: http://forums.lavag.org/index.php?act=attach&type=post&id=6881I can't use it as a subVI in control VI because of front panel terminals inside loops. I tried to overcome that using property nodes or global variables but there was no success. Front panel: http://forums.lavag.org/index.php?act=attach&type=post&id=6882 Any suggestions how to solve the problem? Regards 610 Quote Link to comment
LAVA 1.0 Content Posted September 8, 2007 Report Share Posted September 8, 2007 You're explanation as to why you can't use it in a sub-panel is confusing. What happens if you try to run it in a subpanel? Quote Link to comment
610 Posted September 9, 2007 Author Report Share Posted September 9, 2007 QUOTE(NormKirchner @ Sep 7 2007, 09:42 PM) What happens if you try to run it in a subpanel? When I try to use it as a subVI I can connect inputs and outputs using connector and put it in main application by "Select a VI" but when I run it nothing happens. The simulation doesn't start and variables aren't updated. Of course driver VI is opened and running. When I try to do the same by Edit -> Create subVI in block diagram window I get following warnings: http://forums.lavag.org/index.php?act=attach&type=post&id=6889 After clicking "Yes": http://forums.lavag.org/index.php?act=attach&type=post&id=6890 One "Yes" later: http://forums.lavag.org/index.php?act=attach&type=post&id=6891 OK: http://forums.lavag.org/index.php?act=attach&type=post&id=6892 And eventually: http://forums.lavag.org/index.php?act=attach&type=post&id=6893 I attach my code: http://forums.lavag.org/index.php?act=attach&type=post&id=6894 Short instruction of running it: 1. Unpack the archive to C:\model 2. Open and run the driver VI - C:\model\LVCraneModelMask_nidll_rtw\lvcranemodelmask_driver.vi 3. Open and run the host VI - C:\mode\ModelDll.vi 4. If it didn't start properly try to update SIT_Meta_Info cluster in ModelDll.vi I am not very advanced in LV. That's a part of my first seriouos project. Thank you for your interest Regards 610 Quote Link to comment
610 Posted October 19, 2007 Author Report Share Posted October 19, 2007 The problem is still unsolved. Any ideas? Regards 610 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.