LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView 7.1 SIT: how can I modify the LV-Simulink connections during execution?

Hi!

I'm using LabView 7.1 (with the SIT toolkit) to make a user interface for a Simulink model.  The problem I’m encountering is that the Simulink parameters aren’t always linked to the same
LV controls, depending on the options selected by the user.  Since I wasn’t sure if it was possible to do this, I decided to send the values of the main controls into other controls, which would be hidden (or not if I can’t… doesn’t really matter).  The hidden controls would then be linked to the Simulink parameters, and the connections would never have to change. 

It is quite confusing to describe in words, so I’ve included a picture representing what I’m trying to do.  It shows the way I'm trying to do it right now, with the hidden controls, but only the final result counts, so tell me if there's a better way to do it, or if it's just wrong.

For the moment, since I’m not very good at using events, I just can’t figure how to connect the hidden controls to the Simulink parameters.  By default in SIT, the Simulink values are updated when the user changes the value corresponding LabView control.  Here, the values of the controls linked to Simulink are not modified directly by the user, so it doesn’t update.

I hope my explanations are clear enough to be understood… if not, don’t hesitate to ask more details.

Thanks in advance!

0 Kudos
Message 1 of 11
(2,855 Views)
Sorry... I forgot the picture in the last post...
0 Kudos
Message 2 of 11
(2,844 Views)

"Maxime" <x@no.email> wrote in message
news:1143063609744-342001@exchange.ni.com...
>Hi!
>
>I'm using LabView 7.1 (with the SIT toolkit) to make a user interface for
a
>Simulink model.&nbsp; The problem I?m encountering is that the Simulink

Why bother with Simulink when you have LabVIEW?


Tam


0 Kudos
Message 3 of 11
(2,839 Views)
Well, it was not my choice to use Simulink...  I'm doing part of a project for a professor, and he only wanted me to do a user interface with LabView, while everything else is done with Simulink...
0 Kudos
Message 4 of 11
(2,832 Views)

Maxime,

Sounds like you can accomplish this through local variables.  Right click on the control you want to update programmatically, select Create -> Local Variable.

In the event structure,  add a case for each control you want to update to the simulink control. Then write the local variable with the new value when that event happens.  Your code will look something like this:



--Paul Mandeltort
Automotive and Industrial Communications Product Marketing
0 Kudos
Message 5 of 11
(2,819 Views)
Hmm... I don't see the picture you tried to post...  Please, could you post it again, so I can be sure I'm understanding what you explained ?

Thanks!
0 Kudos
Message 6 of 11
(2,807 Views)
Sorry, I apparently did not attach the file correctly.  Here is another go at it.
--Paul Mandeltort
Automotive and Industrial Communications Product Marketing
0 Kudos
Message 7 of 11
(2,793 Views)
I just tried to do what is shown in your picture, and it does update the value of the control, but the value is not sent to Simulink... I don't know if I'm doing something wrong...  I did some basic tests with the Sine Wave SIT example.  I added a control called "Frequency Simulink", which is updating each time the value of the "Frequency" control changes, using a local variable inside the event (like your picture).  However, the new value of the frequency isn't passed to Simulink.  I posted the modified version of the sine wave example that I used to test, if someone wants to try it.

Thanks for your answer, and please tell me if I did something wrong.
0 Kudos
Message 8 of 11
(2,789 Views)
To my knowledge, what you are trying to do is not possible with SIT 2.0.x...you cannot dynamically change the links of different controls and indicators to different parameters and signals in your Simulink model while the Host VI is running. 
 
However, you can do exactly this in SIT 3.0.  With SIT 3.0, there is a dialog called "Remap Controls and Indicators" that is available while the VI is running that allows you to remap any control or indicator on the front panel to any parameter or signal in your Simulink model.  Here is the product page for SIT 3.0:  http://sine.ni.com/nips/cds/view/p/lang/en/nid/13745.  You can use SIT 3.0 with LabVIEW 7.1.
 
Good luck,
-D
0 Kudos
Message 9 of 11
(2,783 Views)
Maxime,

Actually I was a bit mistaken before.  When you use a local variable, the value does get updated but the event isn't generated to tell LabVIEW that anything changed. Instead of the local variable, try using the Value (Signaling) Property Node.  When you write this node of the control you want to update, any event structure bound to it will trigger.  Right click on the control you want to create the node for, and select Create > Property Node > Value (Signaling). Wire the value into this node, and the corresponding control will be updated and the events waiting for that control will be notified.
--Paul Mandeltort
Automotive and Industrial Communications Product Marketing
Message 10 of 11
(2,777 Views)