Discussion:
converting simulink to vi
(too old to reply)
asep
2008-07-20 00:40:04 UTC
Permalink
Hi All,I'm now working my final assignment at my college using LabVIEW 8.2.1 (Simulation Module Addon attached) and PCI-6221.The idea is to convert the anaerobic digestion (AD) model in simulink into LabVIEW. I'm doing this by converting the variable and formula on Simulink one by one to VI. Now I have the exact model of AD with the same variable, formula, and parameter (no error).The problem is while I run that model, the output yield is completely different from the simulink model. I will attach the simulink model and the VI I've been working for.Thanks in Advance,SeptianNB: the simulink model, run from the BO.m


AD.zip:
http://forums.ni.com/attachments/ni/170/342390/1/AD.zip


Simulink AD.zip:
http://forums.ni.com/attachments/ni/170/342390/2/Simulink AD.zip
Michelle_B
2008-07-21 19:40:07 UTC
Permalink
Hi asep, Is there anyway you can narrow down the problem? Tell me what is not coming out correctly? You can run the VI in highligh execution and verify that your subVIs are operating correctly. You have several formula nodes, have you verified all formulas are correct?
asep
2008-07-26 18:10:05 UTC
Permalink
hi Michelle, thanks for your attention. I'm already did the check and re-check routine about the formula, the result is totally different. I should be attached the graph result when running the model using the simulink and labview so you can compare them. i'll try to send it later.I got another problem michelle, if you dont mind please help me. Still on that anaerobic digestion model, i'm now trying to create the VI model using the simulation translator (with a lot of data type fixing using index array and build array, is it normal?). I'll attach the result using simulation translator. when the compiler says ok, i can't run the simulation. the error message send this:Error?2318
The dimensions of the parameter vectors of this function do not match.After a while, the system always crash and needed to close everytime I run this model. The main system's VI is AD.The time is running out for me, anybody help me on this problem.Thanks In Advance,Asep


AD-With Translator.zip:
http://forums.ni.com/attachments/ni/170/344262/1/AD-With Translator.zip
asep
2008-07-26 18:10:06 UTC
Permalink
hi Michelle, thanks for your attention. I'm already did the check and re-check routine about the formula, the result is totally different. I should be attached the graph result when running the model using the simulink and labview so you can compare them. i'll try to send it later.I got another problem michelle, if you dont mind please help me. Still on that anaerobic digestion model, i'm now trying to create the VI model using the simulation translator (with a lot of data type fixing using index array and build array, is it normal?). I'll attach the result using simulation translator. when the compiler says ok, i can't run the simulation. the error message send this:Error?2318
The dimensions of the parameter vectors of this function do not match.After a while, the system always crash and needed to close everytime I run this model. The main system's VI is AD.The time is running out for me, anybody help me on this problem.Thanks In Advance,Asep


AD-With Translator1.zip:
http://forums.ni.com/attachments/ni/170/344263/1/AD-With Translator1.zip
Michelle_B
2008-07-28 22:10:05 UTC
Permalink
Can you verify that each subVI output is correct?  Also, can you verify that the first iteration is producing the correct results? If not, can you tell me which iteration causes a variation from your other model? For the Translator - Are you any of the unsupported blocks?- Algebraic Constraint

- Atomic Subsystem

- Band-Limited White Noise

- Configurable Subsystem

- Enabled

- Enabled and Triggered

- For Subsystem

- From Workspace

- Function-Call

- Function-Call Generator

- If

- If Action Subsystem

- Interpolation (n-D) using PreLook-Up

- Look-Up Table (n-D)

- Memory

- Merge

- Model Info

- PreLook-Up Index Search

- Probe

- Random Number

- Rate Transition

- Repeating Sequence

- S-Function

- S-Function Builder

- Switch Case Action Subsystem

- SwitchCase

- To Workspace

- Triggered

- While Iterator Subsystem

<script type="text/javascript">
if (typeof(Print_Link)=="function") {
Print_Link();
}
</script>
asep
2008-08-01 19:40:17 UTC
Permalink
I think i'm gonna leave the old method, I'm now focusing on the new model which i get from the simulation translator. I'm already examined the iteration, the model's result came exactly just like the first iteration from simulink. Still, that error message - 2318 is still occurring.An explanation about the error message will help me, doesn't have to b related to my model, all i need is just general definition about that error message. I have read several book about programming in labview. I'm pretty sure "dimension" on the message related to array programing, but the parameter vector is referring to the integrator, i just can't find the connection....Any explain?Thanks in advance,Asep
Michelle_B
2008-08-04 23:10:08 UTC
Permalink
Asep, I will see what I can find. I will update this thread.
Michelle_B
2008-08-08 21:40:06 UTC
Permalink
asep, Can you run your code in highlight execution and tell me what part is giving this error? If you are unfamiliar with highlight execution, just click the light bulb button on your block diagram and then run your code. This feature will allow you to see how the data flows in your program as well as show you were this error is occuring - so long as you have your error wires connected.
asep
2008-08-09 12:10:04 UTC
Permalink
I already ran the program with highlight execution, i'm figuring that this program run well at first iteration. at second iteration, the error message came up. I'm trying to make a simple array program in simulation loop in order to have a better understanding about that error. I found that the dimension of the input and output array has to be in the same amount, and the dimension has to be declared first. i assume that's the problem.is there anyway to make the dimension array of the output updated every n iteration (1D array with n value), but the dimension of the input array is constant (1D array with 1 value).
Michelle_B
2008-08-11 22:40:06 UTC
Permalink
From which VI does this error come? I am unclear as to what you are asking. Can you please re-phrase your question? Input and output of what? If you can post a small piece of code, that would help too.
Loading...