LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulation Interface Toolkit 3.0

Hello
 
I have got problems with Simulation Interface Toolit 3.0: My aim is to establish a connection between my Host VI and the Model DLL through the SIT Connection Manager in Windows. But with Simulation Interface Toolkit 3.0 the model_main.vi is not created in the Realtime Workshop of Simulink. With the SIT 2.0 the model_main.vi was created automatically by the Realtime Workshop and I only had to start manually this model_main.vi, so that the Model DLL could run in Windows.
And during the Model DLL is build by the Realtime Workshop, I always get a warning in the Matlab command window:
"### Generating TLC interface API.
..Warning: Could not find an exact (case-sensitive) match for 'SIT_ModelNameInBlockPathToLower'.
C:\SimulationInterfaceToolkit\ModelInterface\tmw\SIT_modelNameInBlockPathToLower.m is a case-insensitive match and will be used instead.
You can improve the performance of your code by using exact
name matches and we therefore recommend that you update your
usage accordingly.  Alternatively, you can disable this warning using
warning('off','MATLAB:dispatcher:InexactMatch')."
 
Is this warning important?
 
There is also a possibility to create a connection between a Simulink Model (.mdl) and a Labview VI through the Sit Connection Manager. But if I open the SIT Connection Manager Dialogbox to create a communikation between a Simulink Model and my Host VI, I can't connect the Out1 block of the Simulink Model with an indicator of my Host VI, because the parameters of the Out1 block is not listed in the dialogbox.
0 Kudos
Message 1 of 13
(4,476 Views)
Hi,

the main usability difference between SIT 2.x and SIT 3.x are the In and Out nodes.
Since SIT 3.x you have to place the NI Signal Probe (instead of In and Out nodes) from the Simulink Library Browser on your Simulink Block Diagram.

In the attachement you will find one screenshot with the Signalprobe and another screenshot which shows the right settings to translate the mdl file with the RT Workshop.

BR,
ThSa
0 Kudos
Message 2 of 13
(4,461 Views)
Hello ThSa
thank you so much for all the information. Now, I am able to create a driver.vi and establish the connection between a Simulink Model and my Host VI.
But I still have a problem with running the driver.vi. When I press the run button of that VI, I always get the error message:
"Fehler 60 ist bei TCP: Listener erstellen in SITs Server Loop.vi->regelstreckedll_driver.vi aufgetreten
Mögliche Gründe:
LabVIEW:  Die spezifizierte Netzwerkadresse wird gegenwärtig verwendet."
 
I don't know what I still doing wrong!
0 Kudos
Message 3 of 13
(4,447 Views)
For example, if an FTP VI is used on a machine in which ports 1025 and 1026 are in use, then the VI will return an error 60.
In your case the problem is propably Matlab.
Either change the port or close matlab, afterwards everything should work fine.

BR,
ThSa

0 Kudos
Message 4 of 13
(4,442 Views)

Hello ThSa,

thanks for your help again! Now its working!

But do you also know how to send an analog signal, which is shown in LabView, to a Simulink Model? For me it's only possible to establish a connection between a LabView Control and  a Simulink Constant Block. I would like to send a value, which is shown in a LabView indicator to Simulink.

0 Kudos
Message 5 of 13
(4,436 Views)
This aim is quiet simple.
If I understood you correctly, you want to realize a "closed" loop between LV and Simulink without any user interaction.
Your host-application provides an event structure, where all events are logged as "Value Change".
In this case it is possible to take influence on every control on front panel via property nodes -> attribute "Value(Signaling)".

In your host-application are two loops - one producer loop, which sends values from your controls to Simulink and one comsuner loop, which collects all output data from Simulink.
In the consumer loop are several cases for each indicator. Within the case where are the specific indicator is placed, place additionally a property node (attribute: Value(Signaling)) of the specific control which assigns a value to the Simulink model.
This action has the affect, that every time the indicator gets an update from Simulink, an event for the specific control occurs which sents a new value back to Simulink.

BG,
ThSa
0 Kudos
Message 6 of 13
(4,431 Views)
Hello ThSa!
I tried your solution but it didn't work. I don't know what I did wrong! The analog value, which is shown in the specific indicator, is also shown in the specific control, but this value isn't still sent to Simulink.
Perhaps I should describe my problem in detail! I have got a measurement box, that can read analog signals and one of these analog input signals is sent to an indicator of LabView. That's already working. For this task there are specific SubVIs I have. Now it would be great if I could send that analog input signal, which is shown in the specific indicator, to a Constant block of Simulink. But that doesn't work....
So what about the property node of the specific control which assigns a value to the Simulink model? Do I have to connect this specific property node to anything. Where exactly do I have to place the specific control?
0 Kudos
Message 7 of 13
(4,417 Views)
In this case it would be the best thing, when you attached an example mdl file with the labview code.
Please, do it today because I am not in office until Wednesday.

Thanks,
ThSa
0 Kudos
Message 8 of 13
(4,416 Views)

Ok, I am sending you pictures of my Simulink Model and my Host VI. Unfortunately it is not possible to send you a (mdl.)-file.

The control "AnalogValue" in Labview is the value which should be sent to Simulink. The indicator "AnalogIn" shows the analog signal which comes from the measurement box. The Indicator "Istwert" and the diagramm schows the output of the Simulink Model.

Download All
0 Kudos
Message 9 of 13
(4,410 Views)
I think I saw your error.
You did not use the property node (attribute: value signaling) in the labview vi.

0 Kudos
Message 10 of 13
(4,407 Views)