Jump to content

[Simulation Interface Toolkit] How to create a subVI with imported


610

Recommended Posts

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=6881

I 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

Link to comment

QUOTE(NormKirchner @ Sep 7 2007, 09:42 PM)

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

Link to comment
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.