Connect hardware I/O to simulink model

Hello,
i developed a controller using simulink. It's already been testet by connecting signal generators via "simulation interface toolkit" between labview and simulink. That worked out very well. The next step would be testing the controleron the real process. Therefore I have to connect the inputs and outputs of the simulink model to measurements and manipulated variables of the real process.
Since there is no real time hardware on wich I could apply the .dll of the Simulink model for testing purpose I have to find a different way.
So here's my question: Is there a possibility to connect Simulink IN and OUTs to measurements within LabVIEW? And apart from that I want to send the manipulated variable which is calculated by simulink back to LabVIEW and via Rs232 e.g. to the real process.
I would be thankful for every answer or hint on how to fix this problem.
Solved!
Go to Solution.

Hey,
Yes, it's possible to connect IOs via customized code in the realtime driver VI.
Please have a look at the following two webcasts (they are in German, I assume you are from Germany) where this will be explained in detail.
http://zone.ni.com/wv/app/doc/p/id/wv-619 (Das LabVIEW Simulation Interface Toolkit – Teil I – Grundlagen)
http://zone.ni.com/wv/app/doc/p/id/wv-621 (Das LabVIEW Simulation Interface Toolkit – Teil II – für Fortgeschrittene)
Christian

Similar Messages

  • Using SIT connection manager with large simulink models is extremely slow

    Hello,
    I'm trying to use a large simulink model in LabVIEW but once the DLL is correctly generated and the SIT connection manager is invoked to explore the model sinks, sources and parameters, it takes hours to generate the model connections tree. Afterwards, when the connections tree is completed, it is impossible to handle it because every operation performed takes a lot of time and memory (i.e. to expand a block to see which parameters are inside).
    The version of SIT I'm using is 2.0.3 with LabVIEW 7.1.
    Is there anybody experienced with large simulink models and SIT?
    Thanks and regards.
    Ignacio Sánchez Peral
    SENER Ingeniería y Sistemas S.A.
    Control Systems Section
    Aerospace Division
    C/ Severo Ochoa, 4 (PTM).
    28760 Tres Cantos (Madrid) Spain.
    [email protected]
    Tel + 34 91 807 74 34
    Fax + 34 91 807 72 08
    http://www.sener.es

    The VI in the Driver VI called SIT Initialize Model.vi has an input called time step (sec) (-1: use model time step) which does what you want it to. It doesn't actually affect the time step of the solver used in the built model DLL, just the rate at which the main base rate loop actually runs in real time. In fact, base rate loop period would be a better name for this control. If you set it, you won't alter your model, but you will be able to adjust the rate of the base rate loop.
    Simply create a control from this input terminal on your driver VI and fill in an appropriate period in seconds. Make sure to set this value as default in the control so that the Driver VI remembers it.
    You will have to take into account that your model will still think it's running at the time step it was compiled at. So your model simulation time and the actual wall clock time won't match up.
    Jarrod S.
    National Instruments

  • How to use multiple Simulink Models on on Target and One Host VI?

    My ultimate goal is to run two Simulink models simultaneously from one Real Time Target PC from one LabVIEW VI. As I understand it, this is possible but I have not found a solution or example on how to do this. For debugging and demonstration purposes, I would also like to run the same setup on my windows machine. We have had SIT (and VeriStand) working with one Simulink Model for some time now.  I have tried using the SIT connection manager and coping the code, but I have not had success doing this. We are using LV 2009 and Matlab 2009. Any thoughts or inputs would be appreciated. Thanks for your help.

    Just dawned on me to try and open two instances of Matlab, then set the SIT server on the second instance of matlab to a different port. This worked as I got two different simulink models to run. The question is, is there a better more efficent way of doing this? Any thoughts would be welcome.

  • How to use Labview 6i and Simulink model ????

    HELLO I would like to use a simulink model written in matlab from labview
    6i.
    Can somebody help me?
    NI says that there is a possibility but they don�t know it.
    but - it can been done.
    motti

    Hi Motti,
    There are at least two ways to solve this depending on the problem. One ways is to use ActiveX technology to run a simulation model and get the results in the files saved from simulink. This is good if you have an off-line problem you do the calculations in simulink than the analysis in LabVIEW. If you have to communicate with the model interactively than you should use Real-Time WorkShop to create an executable and connect to it by TCP/IP. I have VIs for both solutions. I'm planning to release a LabVIEW toolkit for Matlab Simulink. If your problem is argent we can work out some deal.
    Andras Ferencz
    Naturen Kft.

  • Compile Errors occured when simulink models including 'cmex' by SIT

    I am trying to compile a simulink model to DLL with following softwares and hardwares.
    Software:
    LabVIEW 8.0.1
    LabVIEW Realtime 8.0.1
    Simulation Interface Toolkit 3.0
    MATLAB R13
    Visual C++ 6.0 Service Pack 4
    Target Hardware:
    PXI-1042RTPXI-8196
    PXI-6289
    When I tried to compile a model including 'cmex' function on Simulink to DLL, compile error about Visual C++ occured. Does SIT support the model including 'cmex' functions?
    When I removed the function 'cmex', compiling is working correctly.
    To import original model which is written by C or other language, I strongly want to use 'cmex' functions. To avoid the compile error, if you have any ideas, please let me know.
    Thanks,
    Tsugo

    Hello Tsugo,
    I believe that it is possible to compile a DLL for SIT from a model that contains a cmex function.
    To tell whether the issue is caused by SIT or not, you can try changing the RTW target file from nidll.tlc to grt.tlc (in the model's Simulation Parameters dialog, look in the Real-Time Workshop tab), and see whether the compile error still happens. If the compiler error occurs with grt.tlc, then please refer to the documentation provided by The MathWorks Inc. on how to get your cmex functions to work in Real-Time Workshop®.
    If the compiler error does not occur with grt.tlc, then please post the whole text of the compiler error.
    Thanks!
    Andrew

  • [SIT 5.0] Problem with running Simulink model dll on RT target

    Hello!
    This a continuation of my problem described here: http://forums.ni.com/ni/board/message?board.id=170&thread.id=431616
    At the moment I am using following versions of software:
    LabVIEW 8.6.1
    LabVIEW Real-Time 8.6.1
    NI-RIO 3.1.0
    Simulation Interface Toolkit 5.0.0
    Microsoft Visual C++ 6.0
    MATLAB 7.4.0 (R2007a)
    NI cRIO-9014
    I have done everything mentioned in http://digital.natinst.com/public.nsf/$CXIV/ATTACH-AEEE-7JSQXS/$FILE/readme_sit_vxworks.txt
    After that I was able to build nidll and nidll_vxworks using Matlab. Then I have configured SIT Connection manager, mapped controls and indicators, selected model dll etc. But when I have tried to deploy it on RT target I got following error message:
    Initializing...
    Calculating dependencies...
    Checking items for conflicts. This operation could take a while...
    Preparing items for download. This operation could take a while...
    Deploying NI_SIT_Replay.lvlib
    Deploying NI_SIT_driversupportVIs.lvlib
    Deploying NI_SIT_ClientConnMngr.lvlib
    Deploying NI_FileType.lvlib
    Deploying NI_SIT_Data Log.lvlib
    Deploying XDNodeRunTimeDep.lvlib
    Deploying NI_SIT_util.lvlib
    Deploying NI_SIT_SITServer.lvlib
    Deploying project01_Driver.lvproj
    Deploying NI-cRIO9014-00E9D6B1(successfully deployed target settings)
    Deploying MD5Checksum pad.vi(8,86 K)
    Deploying NI_SIT_Replay.lvlib:Read Select Data Packet FIFO.vi(24,89 K)
    Deploying NI_SIT_driversupportVIs.lvlibIT Driver FP Strings.vi(2,39 K)
    Deploying NI_SIT_Data Log.lvlib:Allocate Data Log State Machine Buffers.vi(10,17 K)
    Deploying compatWriteText.vi(9,04 K)
    Deploying NI_SIT_Replay.lvlib:Wait for Ack.vi(5,29 K)
    Deploying NI_SIT_SITServer.lvlibITs Read Data Buffer.vi(20,24 K)
    Deploying NI_SIT_ClientConnMngr.lvlib:Find Channel.vi(8,23 K)
    Deploying NI_SIT_Data Log.lvlib:Get Current Configuration from Queue.vi(9,46 K)
    Deploying NI_SIT_Data Log.lvlibend New Group Probe List.vi(5,82 K)
    Deploying NI_SIT_Replay.lvlib:Write to Active FIFO.vi(8,71 K)
    Deploying NI_SIT_Replay.lvlib:Create Configuration FIFO.vi(6,29 K)
    Deploying NI_SIT_driversupportVIs.lvlib:sit Microsecond Timer.vi(9,62 K)
    Deploying NI_SIT_Data Log.lvlib:Get All Configurations from Queue.vi(9,30 K)
    Deploying NI_SIT_Data Log.lvlibwitch Active Configuration.vi(9,77 K)
    Deploying NI_SIT_Data Log.lvlib:Update Current Configuration Log Filename.vi(8,85 K)
    Deploying NI_SIT_SITServer.lvlibITs Send Packet.vi(26,80 K)
    Deploying Invalid Config Data Reference.vi(2,86 K)
    Deploying NI_SIT_driversupportVIs.lvlibIT Set Project Directory Path.vi(16,94 K)
    Deploying NI_SIT_Replay.lvlib:Update TCL Position FIFO.vi(16,39 K)
    Deploying XDNodeRunTimeDep.lvlib:loadlvalarms.vi(32,39 K)
    Deploying NI_SIT_driversupportVIs.lvlibIT Task Loop.vi
    Failed to download NI_SIT_driversupportVIs.lvlibIT Task Loop.vi
    LabVIEW:  Failed to load shared library SITs.*:TaskTakeOneStep:C on RT target device.
    Deployment completed with errors
    I was hoping that upgrading my software will fix all problems. But sadly, it didn't. Any idea? Many thanks for help!

    Hello,
    I also had quite a lot of problems using Labview 8.6.1, RT and SIT 5.0.1. I upgraded a software using Labview 7.1 and SIT 2.0.3 beeing used for 5 years now and it was real pain.
    I not using the SIT as you are (just load the model from a DLL, use a timeloop to step the model and finally close the model) but it seems that SIT 5.0.1 has a bug (confirmed recently by NI tech support) concerning inputs and outputs if you are using an array.
    It seems that if you use an array for the input during the transcoding of the simulink model to the DLL an index is not well taken into account resulting in a model not beeing able to read its intputs. In my case whatever the inputs data could be the outputs were always 0.
    The model has been changed to use only scalar data and everything works fine, ... well using the developpement software :
    I cannot generate an RT target executable as during the deployment it fails all the time.
    I saw once a message concerning SIT VIs deployment errors and it happened shortly after i upgraded my target : SIT 2.0.3 was still installed after SIT 5.0.
    I spent a few years without updating Labview and i am amazed at how many problems occurs with all versions above 8.0.
    Good luck,

  • Error Sending Boolean Signals to Simulink Model via SIT (Simulatio​n interface toolkit)

    Hi,
    I am facing a problem with the Boolean instruments when working with SIT.
    On my VI I have some boolean instruments (On/Off Switch). These are connected to the Simulink model Constant blocks. SIT works fine (creates diagram etc). I am also able to run the VI and establish connection with the model. But, when I change value of either of the switch the VI 'stops'.
    Instead of Boolean instrument, if I use a normal numeric instrument, then everything works just fine.
    Any ideas to work around the problem?
    Regards,
    Amit

    Hi Ricardo,
    Thanks for your help. The issue has been resolved. One of your representatives was here with us this afternoon.
    Apparently, there is a different workaround. The one you suggested will not work. We had tried out at our end. But your suggestion is inline with logic. There is something with the way the SIT makes connections.
    Anyways, bottom line is the issue is resolved. I am attaching the solution that we came up with. This also might help some other users. Thanks for the help again.
    Regards,
    Amit
    Attachments:
    ModifiedBooleanAcceptor.vi ‏271 KB

  • I am trying to integrate simulink model (.mdl) file with SIT of Labview for RCP and HIL purpose. I am using Labview 8.6, Simulink 6.6 with RTW 6.6 and RTW embedded coder 4.6 ,Visual C Express 2008 and Visual C++ Express 2008.

    I am trying to integrate simulink model (.mdl) file with SIT of Labview for RCP and HIL purpose. I am using Labview 8.6, Simulink 6.6 with RTW 6.6 and RTW embedded coder 4.6 ,Visual C Express 2008 and Visual C++ Express 2008. I have selected system target file as nidll.tlc,make command as make_rtw and template nidll_vs.tmf. When I try to generate .dll file I get the following error.
    Attachments:
    SITProblem.JPG ‏101 KB

    Hi,
    No . I could not solve the issue. Presently we are using microautobox (from Dspace)for doing the RCP.
    Himadri 

  • Problem in converting a simulink model in LabVIEW 2010

    hello,
    I have developed a Simulink model in MATLAB which I want to convert into equivalent LabVIEW VI's. The simulink model is as attached. The problem here is:-
    LabVIEW is not able to convert all the mechanical blocks named Ankle revolute joint, Body , joint actuator and joint sensor into  equivalent LabVIEW VI.
    Is it possible to convert those blocks into equivalent LabVIEW VI's?
    PS:- I am using LabVIEW 2010.
    Attachments:
    AAFO.PNG ‏19 KB

    Hi Susheel,
    RFC module interface parameters (import, export , tables) can only refer to data dictionary types. Hence if you currently have one of the parameters referring to a type defined in your function group main include or in a type pool, you need to create a SE11 data dictionary structure/ table type for that and then change the data type reference.
    Cheers,
    Aditya

  • HT5706 I just purchased an AppleTV and am trying to connect AirPlay with my mac (2012 model) In 'system preferences displays' an airplay menu is listed but it says 'no device detected'. My AppleTV and macbook are connected to the same network. Any help?

    I just purchased an AppleTV and am trying to connect AirPlay with my mac (2012 model) In 'system preferences > displays' an airplay menu is listed but it says 'no device detected'. My AppleTV and macbook are connected to the same network. Any suggestions why it is not working?

    Troubleshoot the network as that is likely what is causing the issue.
    Also, temporarily disable the firewall on the Mac and disable IPV6 on the computer.

  • Hi, I have an older 800x600 LCD projector, If I go out and buy all the necessary connecting hardware for the ATV3 to it will it even work?

    I just dont want to go out and buy all of the connecting hardware if it isn't going to work anyway, thanks in advance for any help.

    The AppleTV has a single HDMI 1.3 video out, if you have the ability to connect your projector to HDMI then it should work. Audio may present a problem as well, the audio is integrated with the HDMI output but there is also an optical digital Toslink connector. There are converter boxes to downscale HDMI to VGA specifications but you loose a lot of detail with the smaller format.

  • Simulink model to labview

    Hi,
     I need to implement a simple speed control for a DC motor with two cascaded PI controllers.
    Is it posible to include a simulink model in a VI instead of using the simulink control blocks?
    Thank you!

    Hi,
    You can indeed build a LabVIEW interface for a simulink model by using the Simulation Interface Toolkit.
    The following link will provide you informations about this toolkit and how it works in parlicular:
    => http://zone.ni.com/devzone/conceptd.nsf/webmain/955a9d79583a0ab686256db8006672b8
    Regards,
    JPR
    NIF

  • Invalid Mapping with SIT for an outport inside a subsystem in a the simulink model.

    Hello everybody,
    I am trying to use SIT to target simulink models on a PXI target.
    The simulink model contains a subsystem with an outport. I have created
    a mapping between the signal coming out of that outport to a waveform
    chart on the host VI. The mapping works fine when I run the model on
    the local host but becomes invalid when I target the dll to a pxi
    target.
    I have been able to create a very simple simulink model and host VI
    that is mimicking this problem. This model does
    not do anything useful and is made to only demonstrate just this problem. I am attaching the model and the userinterface here.
    Note:
    I have already taken care of the fact that I can not use signal storate
    reuse, block reduction and also cant use linked or linked+masked
    subsystems. A testimony to this is the fact that I am able to create
    mapping with other signals in the subsystem. Also outport is a virtual
    block in simulink so I have created a testpoint on the signal going
    into the outport to be able to probe it.
    Any kind of suggestions would be appreciated.
    Thanks and Regards,
    Vicku.
    Attachments:
    files.zip ‏77 KB

    You have two options to be able to probe this signal in the subsystem that should work fine for this small example you posted. Let me know if they also apply to your actual model.
    You have the outport itself set as a test point currently in your subsystem block. Try setting the wire coming out of the subsystem outport as a test point and then rebuilding your dll. That should make the outport signal probable.
    Instead of probing the actual outport, you could probe the signal in the subsystem that is wired into the outport. In the case of your example that would be using_subsystem/Subsystem/Sum1:1.
    Hope this helps!
    Message Edited by Jarrod S. on 08-23-2007 10:59 AM
    Jarrod S.
    National Instruments

  • Run veristand project in labview- outports of simulink model dll

    I have compiled a Simulink model into a dll file now I want to use some of the outports of the simulink model in labview I can see the outports in veristand workspace but now I want to use them in labview how can I do that?

    now I want to execute my .vi with a PXI and I get this problem I have saved the dll. in veristand target PXI not in the Controller I have created a project and I have saved the Veristand files in C:\ of the PXI and I have the problem below I need special sofware I have installed all the avaliable veristand software in the PXI 
    Attachments:
    Capturaaa.PNG ‏25 KB

  • No relation BTOrderHeader connected to object BTOrder in object model

    Hello all,
    We are using CRM 5.0 interaction center Web client.
    When we search for the business partner and click confirm button to confirm the account, we are getting the below error message.
    "No relation BTOrderHeader connected to object BTOrder in object model".
    Can any one please let me know what could be the reason for this message.
    Regards,
    Nag

    Hi nag,
    Goto to SPRO>CRM>CRM cross application components>Generic interaction layer/object layer>component specific settings>Check entire model for transactions.
    Here you need to check if a relation exists between BTorder and BTOrderHeader.If not you have to maintain the following entry.
    Source object  Relation name Assigned object  Comp.Name Sobj.card  Card.B Rel type Static Relation
    BTOrder          BTOrderHeader  BTAdminH        BT               C 1          C 1      Composite      Check
    thanks
    giri

Maybe you are looking for