Using Simulink data in labview

Hello everyone !
I have made an algorithm in labview and the simulink model data needs to be manipulated in this algorithm. The output of this algorithm is to be fed back in simulink model. I am able to map labview front panel controls with simulink model but i cannot use its data in block diagram window. How do i do it ?

Here you have three options:
1. Create a DLL from your model and use the Model Interface Toolkit (http://sine.ni.com/nips/cds/view/p/lang/en/nid/211815) to load the model into LabVIEW;
2. Convert your model into a LabVIEW Control Design and Simulation (http://www.ni.com/white-paper/11281/en/) SubSystem and use the Control and Simulation Loop to run the model;
3. Use some sort of communication between LabVIEW and Simulink (like OPC server) to communicate between simulations. This last option, although possible, it requires some sort of synchronization between products to avoid the loop to run too fast.
Hopefully this helps,
Barp - Control and Simulation Group - LabVIEW R&D - National Instruments

Similar Messages

  • How to measure voltage changes using a NI-9219 with strain gauges and use the data in labview

    I am updating an old LabView/Data Acquisition system that uses strain gauges to measure two forces (normal and axial) as well as two moments (Pitch and Roll). I am having trouble reading the voltage changes over my strain gauges using my NI-9219 as well as filtering the data with both a lowpass and smoothing filter. The program attached has the project and should have all the sub-vi's used in the program. This program was written on LabView version 8.5 and is being updated to a 2013 version of LabView. Also, the hardware previously used was a combination of a NI SCB-68 and NI USB-6251. If anyone could help me it would be greatly appreciated! 
    Attachments:
    New SSWT.zip ‏751 KB

    Hi Coffeyfj, 
    Did you ever had this set up working? The first thing that I would do as I mentioned in the previous comment would be to use one of the LabVIEW examples. I recommended to you using the (strain - Continuous Input.vi). If you can read any voltage changes with the example vi, then we will know the problem we are having is in your code. If you cannot read any voltage changes using the example I mentioned, we can start trouble shooting the hardware connections. Are you connecting the excitation voltage? If yes, Are you making the right connections. Please refer to page 19 of the following document (half and full bridge modes)
    NI 9219 Operating Instructions and Specifications - February 2009
    http://digital.ni.com/manuals.nsf/websearch/4197ED4BD126E0B486257546005851CA
    Regards,
    William Fernandez
    Applications Engineer 
    National Instruments 

  • Can I automate the creation of a cluster in LabView using the data structure created in an autogenerated .CSV, C header, or XML file?

    Can I automate the creation of a cluster in LabView using the data structure created in an auto generated .CSV, C header, or XML file?  I'm trying to take the data structure defined in one or more of those files listed and have LabView automatically create a cluster with identical structure and data types.  (Ideally, I would like to do this with a C header file only.)  Basically, I'm trying to avoid having to create the cluster by hand, as the number of cluster elements could be very large. I've looked into EasyXML and contacted the rep for the add-on.  Unfortunately, this capability has not been created yet.  Has anyone done something like this before? Thanks in advance for the help.  
    Message Edited by PhilipJoeP on 04-29-2009 04:54 PM
    Solved!
    Go to Solution.

    smercurio_fc wrote:
    Is this something you're trying to do at runtime? Clusters are fixed data structures so you can't change them programmatically. Or, are you just trying to create some typedef cluster controls so that you can use them for coding? What would your clusters basically look like? Perhaps another way of holding the information like an array of variants?
    You can try LabVIEW scripting, though be aware that this is not supported by NI. 
     Wow!  Thanks for the quick response!  We would use this cluster as a fixed data structure.  No need to change the structure during runtime.  The cluster would be a cluster of clusters with multiple levels.  There would be not pattern as to how deep these levels would go, or how many elements would be in each.   Here is the application.  I would like to be able to autocode a Simulink model file into a DLL.  The model DLL would accept a Simulink bus object of a certain data structure (bus of buses), pick out which elements of the bus is needed for the model calculation, and then pass the bus object.  I then will take the DLL file and use the DLL VI block to pass a cluster into the DLL block (with identical structure as the bus in Simulink).  To save time, I would like to auto generate the C header file using Simulink to define the bus structure and then have LabView read that header file and create the cluster automatically.   Right now I can do everything but the auto creation of the cluster.  I can manually build the cluster to match the Simulink model bus structure and it runs fine.  But this is only for an example model with a small structure.  Need to make the cluster creation automated so it can handle large structures with minimal brute force. Thanks!  

  • Getting the data in file using DAQ assistant in Labview

    I am using SCXI 1000 chassis, SCXI 1125 input module and SCXI 1320
    terminal.
    I am using DAQ assistant in labview to obtain temperatures and store it in
    a file. The experiments run the whole day and I need the whole data
    generated during this time to be stored in a single file, but I am unable
    to store it in a single file.
    Can someone please give me some insight as to how can I achieve this?

    Hi Mr,
    It would be helpful to see your code to see exactly how you are acquiring the data. Are you doing continuous buffered measurements? Or are you performing single point temperature measurements in a while loop?
    Either way you will want to use the "write to spreadsheet" VI in your loop. Simply wire your data into the "write to spreadsheet" vi and se the "append to file" input to TRUE. This will make the data add on to the end of the file with each iteration of the loop. The "write to spreadsheet" VI is located in the file IO pallette in LabVIEW.
    Thanks,
    Sal

  • Are there any advantages to using a Data Value Reference for LabVIEW Classes?

    Hi
    I recently came across an example where the developer had used a data value reference for the class cluster in LabVIEW.
    What are the advantages of doing this?
    Doesn't the use of LV objects already avoid the creation of multiple copies of data thereby reducting memory usage?
    Thanks
    AD

    LabVIEW's OOP is implemented as a By Value.  This means, as Tst stated, branches in wires could mean copies in the object.  The DVR is a way to make it By Reference.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Converting formatted excel date to useful data in labview

    I am using the report generation toolkit for Office, and reading an excel file.  All the data comes back fine, except for the date column.  In excel the column is formatted as a date (ex. 5/5/05) but when it comes through in labview it ends up being something like "37740", it's the same effect if you switch the format in excel to general, the date changes to a number.  Is there anyway to leave the formatting the way it is in Excel and still bring into labview a useful date, or would I have to format the excel file differently?
    Thanks.

    I think I have it figured out using the Excel serial number date.  I attached a vi of something I threw together quickly to convert excel date serial numbers to labview date info.  I'm not 100% if it works all the time, but the few examples I tried worked fine.
    Attachments:
    Excel date to labview date.vi ‏53 KB

  • We collected data using NI in the Labview environmen​t and created tdms document. Is there a reader for reading the data in Matlab environmen​t?

    We collected data using NI in the Labview environment and created tdms document. Is there a reader for reading the data in Matlab environment?

    A search will often turn up results.
    Reading TDM/TDMS Files with The MathWorks, Inc. MATLAB® Software

  • How can we share and transfer data at Labview using the internet

    How can we share and transfer data at Labview using the internet
    Dr. Eugene Berman, Moran Kamilyan and Ravit Bar

    [email protected] wrote:
    How can we share and transfer data at Labview using the internet
    Check these links:
    Basic TCP/IP Communication in LabVIEW
    Data Sockets
    Integrating the Internet into Your Measurement System

  • Using Simulink models with CompactRIO via SIT

    Hi there,
    I am looking to use compactRIO for a Rapid Control Prototypig application and am wondering whether Simulink models can be used (via the Simulation Interface Toolkit) and deployed to CompactRIO. (I know that it is possible with PXI). Also, any ideas on ther expected performance?

    Hi, RichM,
    Yes, you can use SIT to create and download DLLs that come from Simulink models. Basically, the CompactRIO controller is like another RT controller, so it will be done exactly the same as in PXI. The only thing different in cRIO is that the model VIs that get scripted from SIT to do data acquisition are using Traditional DAQ VIs, so you will have to manually modify those VIs so they interface with the FPGA backplane using the Read/Write Control function. For information on how to modify the VIs, you can probably look at the following tutorial: Using CAN with the LabVIEW Simulation Interface Toolkit. This tutorial is for NI-CAN, but you can just abstract from it and use the same concepts with the Read/Write Control function.
    How fast are you planning on executing? Just remember that the cRIO controllers and PXI do not have the same type of processor. Depending on the method you follow to read the information from the FPGA (either polling or by interrupts), you will get different performance. I will still recommend you go with interrupts.
    I hope this helps. Let me know!
    GValdes

  • Creating Active controls using opengl libraries in LabVIEW

    Hi,
    I want to create a 3D representation of the some geographic data on LabVIEW GUI. The need is to achieve something beyond the dumb representation. I would like to be able to choose any one of the points represented on the 3D GUI and do some activity like give a POP-UP etc.
    I believe labview 3D picture control allows to create the view in various ways like mesh and bars etc. But doesn't allow to create a active control.
    Attaching a sample pic. Of what am I expecting. I want to be able to click on each of the intersection points in the graph and get the pop-up.
    Since this seems to be not possible just using inbuilt 3D picture capabilities of LabVIEW, plan is to use a opengl libraries to achieve this.
    Will it be possible to create this in LabVIEW?
    Has some one done this before? A sample code will be of great help.
    Attachments:
    Example 3D view.JPG ‏69 KB

    Ayman
    Take a look at this thread http://forums.ni.com/ni/board/message?board.id=BreakPoint&message.id=2391  where Joe Hoskins has kindly donated his collection of activex vi's for excel.
    There are a couple of examples shipped with labview. Goto menu Help -> Find Examples. The NI Example finder will appear. Goto the search tab and search for excel.
    And, there are plenty of examples on the forum you just need to search for them.
    Trying to get you started ...
    David

  • Build a DLL in LabVIEW & Use the DLL in LabVIEW

    I am trying to build a DLL for the simple vi with LabVIEW and want to use the DLL in LabVIEW. is it impossible?
    I wrote a vi and it have 2 terminals. one is the input for numeric dbl data type and one another is the output for numeric dbl 1D array data type.
    It was built with the Application builder for LabVIEW 8.0 and DLL was created successfully.
    I want to use this DLL in new vi with LabVIEW.
    Call library function used. I wrote a new vi to use that DLL.
    In config dialog I config each parameter for dll and connected terminals. but it doesn't work
    pleas refer to the attatched file and let me know what I missed.
    Attachments:
    Array1D.zip ‏60 KB

    At first I kept scratching my head wondering why someone would want to do this. Create a DLL in LabVIEW to call it from LabVIEW. Seems redundant. But, perhaps it's an exercise or perhaps it's for testing the DLL...
    In any event, calling the DLL worked for me in 8.2. How are you configuring your Call LIbrary Function node? I have it set up as follows:
    return type: void
    iteration: Numeric, Signed 32-bit Integer, pass by value
    array1D2: array type, Signed 32-bit Integer, 1 dimension, "Array Data Pointer" format
    len: Numeric, Signed 32-bit Integer, pass by value
    Then I called the DLL like this:
    Message Edited by smercurio_fc on 03-16-2007 12:57 PM
    Attachments:
    Example_BD.png ‏2 KB

  • Data plc labview

    First off thank you for anyone that reads this, I am very new at LabVIEW, and I think this maybe a trival question but I am not sure. 
    I am building a test bench to measure the torque vs angle of clutch disc to find the hystersis. I am confedient that my program is fine to record the data. I am usin a servo motor to apply the torque and when the torque gets to high I want the plc to shut off the servo motor. I want LabVIEW for the data acqusition but the plc for the control. I have no experience with modbus. I was wondering if i could share the output from the torque transducer with both the plc and LabVIEW or would this weaken my signal and affect my data? The torque transducer is a mv/v output, the tourque transducer is TRS-20K from transducer techniques. I will be using a PLC from automation direct, and a NI-9237. 
    http://www.transducertechniques.com/trs-torque-sensor.aspx
    Thansk for your time
    Solved!
    Go to Solution.

    Hello Carl,
    It sounds like all you need to do is send an on/off signal to a PLC.  Any communication (modbus, OPC, DataSocket, EPICS) that occurs between the host PC and a PLC is non-deterministic.  These will all result in some form of varying delay. 
    The USB-DAQ will be able to output a signal from your computer to your PLC.  If you program the PLC to record the signal from the DAQ to control your transducer, this should work.  There will be a delay between when you send the output signal to the DAQ and the PLC reacts.  This delay will not be deterministic.  It will vary depending on your current operating system usage.  With that being said you should be able to get a response within 100ms.
    How fast are you looking to control this PLC?  Do you need the control to have a deterministic/consistent delay? Are you doing closed loop control testing?
    Hypothetically, if your computer crashed while the DAQ is in applying torque, you would still be applying torque until you reset the device.  If you continually torque, will this damage any of your setup?  If so, I would recommend implementing some kind of watch dog timer on the PLC which can be reset by the DAQ.
    If you are looking for a deterministic solution, I would recommend using a cRIO with LabVIEW Real-time.
    Regards,
    Thomas C.
    Applications Engineer
    National Instruments

  • How can i use activeX Control in labview?

    how can i use activeX Control in labview?
    please describe me step by step.
    thanks.

    Well..that was quite helpful..but now I'm encountering certain problems. I've attached the VI I've made.
    I don't need sound at the moment so I dropped it. (Although I tried to play it..but all I could hear was a very annoying sound.) Secondly I don't want to display any date or time..so i dropped that property too.
    Now when I run this Vi...the webcam turns on, the screen of videocapx pops up..then the webcam light goes off..and another pop up appears saying..labview is not responding..and i have to close it reluctantly.
    I haven't placed the stop capture property in this vi. i checked it by placing it too..but that doesn't work.
    I would like to notify that my actual task is to acquire image and then compare it with another one already present on my pc. I want you to please help me out..solve my first query then I'll proceed with the latter part.
    Attachments:
    activexvideocaps.vi ‏20 KB

  • Can a CIN that is in an infinite loop send data to labview without exiting?

    I have a C program that continuously queries a motor controller.  Right now that program is in a labview vi as a CIN.  The problem is that the CIN must exit before reporting the controller response to the labview vi.  This means I have to constantly run the CIN which opens, queries and closes the connection each time.  Is it possible to run the loop in the CIN itself so that the response buffer from the controller can be sent to the labview vi without exiting.  Are there variables types that can be passed from the CIN before completing the CIN? 

    The controller is a Galil DMC4080 motor controller.  I am running Labview under Mandrake Linux.  I can connect and send commands to the controller using a C program.  I modified the C program as a CIN to pass the controller response to the Labview front panel.  Galil has a library of functions used for the controller commands.  LStrPrintf is the command I use to write the data to labview.  Currently I just run this CIN without a while loop and loop it in labview but I recieve an  error message  after  a 1000 executions, see: http://forums.ni.com/ni/board/message?board.id=170&message.id=270220
    If interested here is the current code I am using with the infinite loop. 
    #include "extcode.h"
    #include "dmclnx.h"
    #include "hosttype.h"
    MgErr CINProperties(int32 prop, void *data);
    MgErr CINRun(LStrHandle IPAddress, LStrHandle Command, LStrHandle Response,
            float64 *ErrorCode);
    MgErr CINProperties(int32 prop, void *data)
        switch (prop) {
            case kCINIsReentrant:
                *(Bool32 *)data = TRUE;
                return noErr;
        return mgNotSupported;
    MgErr CINRun(LStrHandle IPAddress, LStrHandle Command, LStrHandle Response,
            float64 *ErrorCode)
       float          rc = 0;          /* Return code */
       char           buffer[32] = ""; /* Response from controller */
       char           ip[20]=""; /* IP address of controller*/
       char           cmd[20]=""; /* Command to send to controller*/
       HANDLEDMC      hdmc = -1;       /* Handle to controller */
       CONTROLLERINFO controllerinfo;  /* Controller information structure */
       memset(&controllerinfo, '\0', sizeof(controllerinfo));
       controllerinfo.cbSize = sizeof(controllerinfo);
       controllerinfo.usModelID = MODEL_2100;
       controllerinfo.fControllerType = ControllerTypeEthernet;
       controllerinfo.ulTimeout = 1000;
       controllerinfo.ulDelay = 5;
       SPrintf(ip,"%H",IPAddress);
       strcpy(controllerinfo.hardwareinfo.socketinfo.szIPAddress, ip);
       controllerinfo.hardwareinfo.socketinfo.fProtocol = EthernetProtocolTCP;
       DMCInitLibrary();
       /* Open the connection */
       rc = DMCOpen(&controllerinfo, &hdmc);
       if (rc)
           *ErrorCode = rc;
           return noErr;
          while (1)
              SPrintf(cmd,"%H",Command);
              rc = DMCCommand(hdmc, cmd, buffer, sizeof(buffer));
              if (rc)
                  *ErrorCode = rc;
                  return noErr;
                  break;
              else
                  LStrPrintf(Response,buffer);
       rc = DMCClose(hdmc);
       if (rc)
          *ErrorCode = rc;
          return noErr;
       *ErrorCode = rc;
       return noErr;

  • Plot exel data in labview dynamicall​y

    I would like to plot My Excel data in labview on XY graph, dynamically every 5 seconds.
    i heard that we have to make use of activex.
    Attachments:
    int_ana_110101.xlsx ‏14 KB

    Hi,
    Yes, you can use ActiveX to do this.
    Search "excel" on LabVIEW examples and forums, and you will find a lot of examples to male what you want.
    Best Regards,
    V-F

Maybe you are looking for

  • Problems with Disk Utility

    Hi, iPhoto crashed my computer in a big way and after leaving the rainbow wheel for about an hour, with very sluggish response I kept the power button down and reset (without doing a shutdown). Unfortunately it has a created a massive problem with my

  • Error while creation of Service PO

    Hi, While creation of service PO I am not able to put Material Text as that column is grayed & system asks me to put material text which is input disabled. Procedure I follows to create Service PO as below: PO type standard (NB). Then I put vendor, O

  • Accessing the device discovery options for bluetooth in snow leopard?

    This menu linked below. http://www.gamermade.com/images/toastman/macx_anydevice.jpg I cannot find this screen in the setup assistant anywhere and I NEED it to set up my Microsoft Mouse 8000. Instead of this screen it automatically grabs detected devi

  • How to shut off bookmarks by default ( Adobe Reader 7.x)

    The company president has requested that all PDF's I send him open up without the bookmarks panel. The thing is, the PDF's are produced from a reporting tool which generates the bookmarks, then it sends him the file by email. Since there's no manual

  • Web Redirect

    Hi All, We created a WLAN on WLC and used web authentication for their authentication.Whenever a wireless user tried to connect to this WLAN and tried to access any web page,it would be redirected to the web login page defined on the web authenticati