LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

converting simulink to vi

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,
Septian

NB: the simulink model, run from the BO.m


Download All
0 Kudos
Message 1 of 10
(4,162 Views)
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?
--Michelle

National Instruments
0 Kudos
Message 2 of 10
(4,104 Views)
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




0 Kudos
Message 3 of 10
(4,065 Views)
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




0 Kudos
Message 4 of 10
(4,064 Views)
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>
--Michelle

National Instruments
0 Kudos
Message 5 of 10
(4,023 Views)
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

0 Kudos
Message 6 of 10
(3,983 Views)
Asep,

I will see what I can find. I will update this thread.
--Michelle

National Instruments
0 Kudos
Message 7 of 10
(3,949 Views)
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.
--Michelle

National Instruments
0 Kudos
Message 8 of 10
(3,925 Views)
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).

0 Kudos
Message 9 of 10
(3,904 Views)
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.
--Michelle

National Instruments
0 Kudos
Message 10 of 10
(3,839 Views)