07-21-2010 04:42 PM
Hi,
I build quite a large system/function using LabVIEW. Therefore, for a convenient and to make it look tidy, I create a VI blocks to separate and combine some function together. But, my problem is when I did that, the simulation seems to run really slow and the the results are different compared when I had the whole system/function under one block.
For your information, each VI blocks that I created has a control and simulation loop. When I connected all of them together, I put all of them in another control and simulation loop as some function that I use to connect them together could not be used without the loop.
I was wondering, if having a control and simulation loop at each blocks actually contribute to this problems as each loop will run depends on the number of time I set to the loop.
If there any method to avoid this from happening? My system/function looks terribly messy and it will be hard for me to present it later at the end of my project.
Thanks.
Solved! Go to Solution.
07-22-2010
03:50 PM
- last edited on
03-25-2025
09:58 AM
by
Content Cleaner
tebu,
Hello! When you say "control and simulation loop" are you referring to an item from the Control Design and Simulation Module or just loops you are calling "control" and "simulation"?
07-22-2010
03:53 PM
- last edited on
03-25-2025
09:58 AM
by
Content Cleaner
yeap.. i was refering to an item from the Control Design and Simulation Module
07-23-2010 01:23 PM
Hello,
Do you have any simple pieces of code that reproduces the issue? It sounds as though before using subVIs, you had a single simulation loop but now you have simulation loops within the subVIs and the subVIs are within a simulation loop as well. Is this correct?
-Zach
08-02-2010 03:55 AM
yeap. thats is my problem.
i'll try to come out with a simple VI file for you to have a look at it. sorry for a late reply.
08-08-2010 06:00 PM
Hi,
Attached are the simple block I created to show the problem I'm having.
1) Test1.vi is the example of the current arrangement I had for my project where I put all the function in the same block diagram which return make my block diagram look messy with too many function laying arounf.
2) Test2(block).vi is where I group some of the function in Test1.vi into a new VI file which I could then called in other VI.
3) Test3.vi is basically the same with Test1.vi except I replaced the function that I'd group previously with Test2(block).vi.
I was expecting the same result when I input value (let say 10), but the result in Test1.vi and Test3.vi is slightly different (in Test1.vi, the final curve starts ~4.75 whereares at Test3.vi the final curve starts at ~5.75)
I think it is due to the loop that I'm using but couldnt figure out how to overcome this problem (I need the loop as some function that I'm using could not be use without it). Appriciate if someone could help me to solve this and able me to group the function so that my diagram look tidier.
Thank you.
08-09-2010
09:53 AM
- last edited on
03-25-2025
09:59 AM
by
Content Cleaner
Hello,
I believe what you are looking to accomplish is to use the simulation subsystem functionality. This allows functions to run outside of a simulation loop so that you can create a subVI. Once you select all the functions in your simulation loop that you would like to be in a subVI, select Edit»Create Simulation Subsystem. Let me know if that helps!
Also, here is some more information for that: https://www.ni.com/docs/en-US/bundle/labview-control-design-and-simulation-module/page/lvsimhowto/si...
-Zach
08-12-2010 07:03 PM
Superb! It works!