LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

simulink to labview

Hi there,

 

I just realized there's probably a much more straightforward way to do this. In the Control Design & Simulation palette in LabVIEW there is a ramp signal VI. It's under Simulation >> Signal Generation >> Ramp Signal. Since you should have a solid knowledge of the rate your loop is running at you should be able to do some math to set the slope to ramp up at the rate you desire. Do you think that will work for you?

Miles G.
National Instruments
Staff Applications Engineering Specialist
0 Kudos
Message 11 of 13
(565 Views)

Hi,

I'm also trying to create a clock similar to the one in Simulink, but It's because I cannot be sure how long my loop takes to run.  Is there a way to measure how long a loop takes to execute before it restarts?  Or possibly some way to read the system time?

 

Sorry to hop on this question, but this is the first time I've found someone trying to emulate the simulink clock in labview.

NA7
0 Kudos
Message 12 of 13
(552 Views)

ash007-  You've probably discovered this already, but the reason your local variable wasn't updating was because your CD&Sim loop didn't have the correct simulation parameters. It looks like it wasn't updating or reading the local variable at a useful rate. If you change the simulation time to run in actual time, ie running with a .001 time step and 1 KHz source, the value updates correctly. 

 

NA7 - You can determine the executition time of a loop by using our standard benchmarking tools. Here are a few examples: 

https://decibel.ni.com/content/docs/DOC-11078

http://www.ni.com/example/25532/en/

 

You can read the system time with a Get Date/Time In Seconds.vi 

 

If you are using a Control & Simulation loop take note of the simulation parameters to make sure simulation time is what you intend it to be, because it can be faster or slower than actual time.

 

MATLAB®, Simulink®, and Real-Time Workshop® are registered trademarks of The MathWorks, Inc.  All other trademarks are the property of their respective owners.

Applications Engineer
National Instruments
CLD Certified
0 Kudos
Message 13 of 13
(536 Views)