LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulink source block for sending values from a LabView VI to a Simulink Model?

The warning is just that, a warning.  You do not need to be concerned about it, however it is resolved in SIT 3.0.1.  Since you already have SIT 3.0.0 you can upgrade to SIT 3.0.1 by going to this download: http://digital.ni.com/softlib.nsf/websearch/AEF7E524AE566B2E8625714600552820?opendocument&node=13206...

In SIT 3.0 the driver VI is created from the SIT Connection Manager.  With SIT 3.0 we added functionality so that you can configure how you want the inports and outports of the model should be connected to hardware (FPGA, CAN and DAQ).  This is done on the Hardware I/O tab of the SIT Connection Manager.   There is a section in the SIT help for Creating a Driver VI.  Since you want to run the driver VI in Windows you will want to look at the topic called Executing a Model DLL on a Windows Computer.

When you connect signals to a indicator you do so by specifying the source of the signal.  Rather than picking the outport you pick where the signal is coming from.  So if the signals goes from a Gain block to the outport then you connect Port 1 on the Gain block to the indicator.

Carl
Message 11 of 22
(2,600 Views)
Hello Carl,
thank you so much for all the information. Now, I am able to create a driver.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 12 of 22
(2,586 Views)
The SIT Server is probably already running in Matlab.  You can manually stop it by executing the command NISITServer('stop') or you can close Matlab.  This command is discussed in the Simulation Interface Toolkit help.  In LabVIEW 8.0 go to Help>>Search the LabVIEW help, then under concepts navigate to Toolkits>>Simulation Interface Toolkit>>Simulation Interface Toolkit Concepts>>Communicating with the SIT Server>>Configuring the SIT Server.

The other option is to configure the SIT Server in the driver VI to use a different port than the default SIT Server.  For more information about this see the section of the help Toolkits>>Simulation Interface Toolkit>>Simulation Interface Toolkit How-to>>Configuring a Simulation on a Real-Time Target>>Executing Multiple Model DLLS on the Same Real-Time Target Simultaneously.

Carl
Message 13 of 22
(2,566 Views)

Hello Carl,

thanks for your help again! Now its working!

But now I have got another problem! 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....
0 Kudos
Message 14 of 22
(2,551 Views)
Hello,

I'm glad that you're able to run your model.

In order to have the value read from your measurement box, the model should contain a top-level Inport (the In1 block). Then the SIT Connection Manager can be used to map that top-level inport to an input from your hardware if the hardware is NI-DAQ, NI-CAN, or NI-FPGA. If the hardware is of another type, then follow the instructions for Creating a Custom I/O Driver with Simulation Interface Toolkit 3.x.

Good luck, and please let me know if I misunderstood your question.

-Andrew
Message 15 of 22
(2,549 Views)

Hello,

I also have a problem here about SIT

The  problem I am facing now is how can I let the simulation running in LV with certain frequency automatically like doing signal sampling. Currently, I am only allowed to manipulate the running of simulation by 'Start' & 'Stop' button manually.  (That is not good enough for my application) I want the updating from analog signals could be synchronized with the simulation in LV.

Hope anyone could help out there. Thanks!

 

0 Kudos
Message 16 of 22
(2,537 Views)

Hello Andrew!

Yes, you understood my question correctly! I already managed to map that top-level inport of Simulink to an input from my hardware. So I had no problems with the configuration. But when I try to build the model files, I get the following error message:

"The generated driver VI is broken. Ensure you have all appropriate NI software installed (including LabView Real-time and any NI drivers you configured). Also ensure you have not modified any of the driver template VIs."

My measurement box USB-1208FS is from Plug-In GmbH and is supported by the software Universal Library for LabView.

 

0 Kudos
Message 17 of 22
(2,509 Views)

Hello Perez,

I believe the error you are seeing may be related to using the SIT Connection Manager with hardware that is NI-DAQ, NI-CAN, or NI-FPGA.  The SIT Connection Manager dialog box supports only certain types and combinations of hardware mappings which are NI-DAQ, NI-CAN, or NI-FPGA. Although your USB-1208FS does function correctly in LabVIEW you may not be able to use the Connection Manager to create the driver.   To create a driver for an I/O mappings for hardware combinations not natively supported by the SIT Connection Manager, National Instruments recommends first using the SIT Connection Manager to create the basic driver VI and then adding to this VI to complete the functionality.

You can accomplish this task in the following way:

1.  Modify the four custom I/O VIs by adding additional I/O capabilities to these custom VIs. This method is useful in the following situations: 
      -You are not using any National Instruments FPGA, CAN, or DAQ devices for your hardware I/O (These type sof hardware I/O are natively supported by the SIT Connection Manager dialog box).
      - You are using multiple National Instruments DAQ devices, but no other devices. 
      - You do not plan on modifying the driver VIs much once you initially create them.

In the posted link above, Creating a Custom I/O Driver with Simulation Interface Toolkit 3.x, check out the section labeled "Adding Capabilities to the Four Custom I/O VIs in Generated Hardware VI".  This section will explain how to modify the driver VI to so you can create a driver for an I/O mappings for your USB-1208FS.

Looking to help,

Steven B.

 

0 Kudos
Message 18 of 22
(2,493 Views)

Correction to the first sentence.  This line should read:

I believe the error you are seeing may be related to using the SIT Connection Manager with hardware that is not NI-DAQ, NI-CAN, or NI-FPGA.

Thanks,

Steven B.

Message 19 of 22
(2,471 Views)

Hello Steven,

thanks for the information! I created the basic driver VI and then I added all the necessary functionality to my Host VI. That means I added all the SubVIs (included in the software package from Plug-IN) which are necessary for the communication between my measurement box and LabView. And now it is working! So I don’t have to create my own Custom I/O VI.

0 Kudos
Message 20 of 22
(2,450 Views)