From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error with Simulation Toolkit

I have a control DC motor model in Matlab/Simulink. I control Ref value in model through the Labview. I used Labview Simulation Toolkit to do this. I created dll file from simulink model through Realtime Workshop and added it in Labview
( SIT connection manager )
I attacked my files : test1.vi ; test2.vi and test_labview.mdl
My problem is : In test1.vi , I have a knob link to constant box in simulink model and indicator scope link to scope box in simulink model.  When I run Labview and change knob value , it acts normally and the respond of simulink model is correct
But when I used test2.vi, I change knob value by changing knob2 value . In this situation , I try to use local variable and value node but It is not succesfull. The respond of simulink is incorrect . The knob value  is not link with  simulink model. Please help me. I want to change knob value through knob2 value and link to model.
I used Labview 8.6 and Labview Simulation Toolkit 5.0
Download All
0 Kudos
Message 1 of 7
(2,723 Views)

All controls that are attached to parameters of a simulation model are handled in a value change event of the event structure. In your specific case you have to use a property node -> Value (signaling) in order to fire this value change event programmatically. Check out this example to get started.

BTW you might not want to use an untimed while loop to check on a user interaction.

 

0 Kudos
Message 2 of 7
(2,705 Views)

Thanks u so much.This example is very useful. But I confuse "value change" in event structure. If I change the value manually such as click on increment button or rotate the knob by mouse, It acts correctly. But in my test , the value change is voltage that I measure from DAQ card. The measuring value put into a control and link to simulink model and it acts incorrectly.Is there any differency from change value manually and change value automatically through input analog?

 

0 Kudos
Message 3 of 7
(2,693 Views)
Help me please ThSa! I cant update input value of simulink model ( this value is mesuared and calculated from analog input ). It changes value automatically 😞
0 Kudos
Message 4 of 7
(2,667 Views)

First of all the SIT was not really meant to be used with HW on Windows because it is not deterministic. That being said, it could be a slight hassle to add hardware support to the SIT client VI.

The value change event does only get fired if the user changes the value on the UI by clicking the increment/decrement button and/or by typing a new value or if the property 'VALUE (Signaling)' is used. Since the source of the value update in your case is not a user input but the input value of a DAQ board, you have to use the ladder mentioned option.

 

 

 

Message Edited by ThSa on 04-05-2010 11:17 AM
0 Kudos
Message 5 of 7
(2,662 Views)

Hello,

 

What kind of error are you experiencing, I have used Simulation interface toolkit with math model(basic ones). There are some settings to make it work perfect.

 

SIT 5.0 has some more settings involved i believe, pls read the readme contents to ensure that you have all the things before you proceed.

Message Edited by cancancanopen on 04-05-2010 01:52 PM
0 Kudos
Message 6 of 7
(2,648 Views)
Thanks ThSa so much ! It runs completely . 😄
0 Kudos
Message 7 of 7
(2,629 Views)