LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

simulink to labview

Hi , 
I want to convert my simulink model to a VI
I have attached the .mdl file
Please help me in the conversion
I am not able to find the substitute for a clock function which is acting as an input as u[1]...it is a unit step signal , increasing linearly with time

0 Kudos
Message 1 of 13
(4,056 Views)

the .mdl file is here: 

0 Kudos
Message 2 of 13
(4,054 Views)

Could you describe a bit more about what you are trying to program in LabVIEW? If you need a step function, you can find the Step Function.vi under Functions >> Mathematics >> Elementary & Special Functions >> Gating Functions >> Step Function.vi, on the functions palette on the block diagram. 

 

I hope this helps. If you need something more specific then that, a detailed description would make it easier to find the necessary VIs. 

Miles G.
National Instruments
Staff Applications Engineering Specialist
0 Kudos
Message 3 of 13
(4,005 Views)

Hi, 
Thanks for responding.
Actually I am working on a Simulink project which is to be converted in a Labview VI
The block that I want to replace in Labview is a Clock signal (which is in the .mdl file attached)
The clock signal, which is used from the Simulink Library is having the trend of linear increasing value with time elsapsed with the decimation value as 10.
All the clock signals in the Labview are related to the clock staring from 1904.
The trend of the clock is attached .
the x-axis value is changing wrt every second since the simulation has started . Y-value is X-value.



0 Kudos
Message 4 of 13
(3,993 Views)

In addition, if you have the LabVIEW Control Design and Simulation Module, it has a feature that allow you to Convert models from other vendors into LabVIEW.

 

http://www.ni.com/white-paper/11281/en/

 

 

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 5 of 13
(3,985 Views)

Hey , 
I tried this but no success !!! 

0 Kudos
Message 6 of 13
(3,973 Views)

If you want to just call your model from LabVIEW you can try the Model Interface Toolkit. If you just want a clock signal as you've described it, it looks like you just need a loop running at 1 second per iteration and an indicator coming from its iteration terminal. Another option is using the tick count VIs if you want the actual time elapsed instead of just a count. I've coded both in the example below. Is this what you were looking for?

 

 

Forum Clock.png

Miles G.
National Instruments
Staff Applications Engineering Specialist
0 Kudos
Message 7 of 13
(3,954 Views)

Thanks for the reply
Things are working, I had to modify the thing accordingly.
Anyways, I want to transfer the value of iteration count from while loop to control simulation loop.
How do I achieve this as I can't connect through loop tunnel.

0 Kudos
Message 8 of 13
(3,944 Views)

You should be able to just use a local variable for this. You can right click the indicator on your block diagram and select Create >> Local Variable. You can then access the value in your local variable from your control and simulation loop. 

Miles G.
National Instruments
Staff Applications Engineering Specialist
0 Kudos
Message 9 of 13
(3,919 Views)

Hello Miles, 
Thanks for your quick response,
I id as you said but only one value is latched in control simulation loop, ie the startin value , while the output in while loop is continuosly running
I have attached my .iv

0 Kudos
Message 10 of 13
(3,910 Views)