LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

automatically changing the input values to the controls (which are mapped to model in inputs) in SIT

Hi all,

 

I am facing a problem in using SIT. I have a model which has 30 inputs and 80 outputs. I want to run this model in RT target. I converted the model to DLL and created a host VI and completed the mappings. I gave values for the controls (Which are inputs to the model) in the Host VI and saw the output and it is correct. When I changed the values in the controls I am able to see teh changes in the output. My problem now is i have a huge set of inputs. For example i am having a file which has 30 columns (each column representing a control which is mapped to the model inputs) and 3600 rows (each row representing one set of inputs values to al the controls which are mapped to the models). I parsed the file and stored them in a double array in the host VI. When I programmed my code in such a way that for every 100 msec one row from the two dimensional arry will be taken and parsed and i updated the local variables of the controls (which are mapped to the model in put parameters). When the Ran the application i am not getting the correct ouput values for the corresponding set of inputs values.

 

Then I ran the application and changed the values of the inputs manually and i am able to get the correct output values for a given set of input.

 

My question is whether my way of automatically changing the input values to the controls (using the local variables) is correct and is there any other way to automate the changing of input values to the controls (which are mapped to the model parameters) and get correct outputs for a given set of inputs.

 

Since i am new to SIT i would really appreciate any help.

 

Thanks & Regards,

Sridhar 

 

 

0 Kudos
Message 1 of 5
(3,134 Views)

Sridhar,

 

I'm glad that you mentioned that you are using local variables to automate the process in the client VI.

The client VI is basically split into two parts: producer and consumer loop. The producer loop transmits new values or commands to the SIT Server and the consumer loop updates all indicaters associated to model signals.

Hence the procuder loop is event based a local variable does not fire the value change event.

 

To come along replace certain local variables with a property node -> value (signaling). Only this attribute fires the event which is needed to update the parameter value on the model site.

 

Another automation process would be the file playback functionality.

The file playback feature can be used with inports only, which means that you would have to change your model. Depending on the function blocks you are using this might be more or less complicated.

 

 

Hope this helps,

ThSa

Message Edited by ThSa on 09-02-2008 05:20 PM
0 Kudos
Message 2 of 5
(3,130 Views)

Hi ThSa,

 

Thanks for your reply. I tried with Value signalling property node for a parameter and i am able to get correct set of outputs which are dependent on the input parameter (for which i used the value signalling property node). My problem is all my 30 inputs are changing (at one shot) before the event structure (in the producer loop) and i have to pass all the 30 new values to the model.I am planning to implement a for loop to send all the 30 new values to the model and removing the control reference value change event case.  I cannot change the model since it was given by other team.

 

Please let me know is there any other ways apart from using the for loop to send new values to all the input controls at one shot. Even though we cannot change the model i am curious to know about the file play back feature which you were mentioning. If you have any materials or information about the same kindly share it to me which would be useful for my future assignments.

 

thanks again for your timely help.

 

regards,

sridhar

 

 

0 Kudos
Message 3 of 5
(3,102 Views)

The documentation for SIT can be find in the LabVIEW help -> Toolkits -> Simulation Interface Toolkit.

 

 If you want to send several values at the same time programmatically to the model you want to take a look on the following example:

<labview>\examples\Simulation Interface\Batch Simulation

It does not directly show how to send multiple values at the same time, but it gives you an introduction on how to use the User Interface VIs.

The VIs used in this example can be found in the Simulation Interface (subpalette: User Interface) palette.

You might use the "SIT Write Multiple.vi"

 

 Basically, the for loop is fine if you don't want to program too much.

 

Thanks,

ThSa

0 Kudos
Message 4 of 5
(3,087 Views)

ThSa's advice is most likely exactly what you want. If these were true model inports (not parameters), you could also use the file playback functionality to more exactly control inducing data into your model. Instead of reading the data from a file and transmitting it to the target via Front Panel control changes, you would set up the RT Target to play the data directly from the file into the model at a specified rate.

 

It seems, however, that you are controlling model parameters rather than model inports, because you can't set inport values from a Front Panel control.

Jarrod S.
National Instruments
0 Kudos
Message 5 of 5
(3,085 Views)