File reading in Matlab, LabVIEW 2012

Hello

I am very new to LabVIEW and this could be a very simple question.

I'm reading a simple labview .vi file in Matlab. I use the version of LabVIEW 2012 32 bit. I saved a file .vi and tried to load it into Matlab as mentioned inof LabVIEW in the MATLAB® environmentsection of http://digital.ni.com/public.nsf/websearch/2f8ed0f588e06be1862565a90066e9ba?Open Document. But I can't load the data. Maybe I am doing it the wrong way.

In  Section Of LabVIEW in the MATLAB® environment , I do not understand what is meant by ""write into the file of worksheet VI on the programming "' e/s filespalette. '"

Can someone explain to me how to do this? I'm just trying to read any exmple saved in LabVIEW in Matlab. If anyone can give another example, which would also help a lot.

Thanking you.

INDI

INDI,

I think that your problem may be to understand the terminology.  .Vi files are LabVIEW programs, not data. Those who cannot be "read" by MATLAB.

Writing in the worksheet File.vi is a VI that comes with LV on the palette file. It can be used in your program to write data to a file text delimited by tabs. These files can be read by MATLAB.

What it the way which operate you: generate the data you want to save in your LabVIEW VI in the form of a table of numbers. Wire of this array of numbers to Scripture in the File.vi worksheet at the time where you want to save the data. If you do not connect a path at the entrance to the path of the file, a dialog box appears asking where to save the data.

Lynn

Tags: NI Software

Similar Questions

  • read in a labview complex binary file written in matlab and vice versa

    Dear all. We use the attached funtion "write_complex_binary.m" in matlab to write complex numbers in a binary file. The format used is the IEEE floating point with big-endian byte order. And use the "read_complex_binary.m" function attached to read the complex numbers from the saved binary file. However, I just don't seem to be able to read the binary file generated in labview. I tried to use the "Binary file reading" block with big-endian ordering without success. I'm sure that its my lack of knowledge of the reason why labview block works. I also can't seem to find useful resources to this issue. I was hoping that someone could kindly help with this or give me some ideas to work with.

    Thank you in advance of the charges. Please find attached two zipped matlab functions. Kind regards.

    Be a scientist - experiment.

    I guess you know Matlab and can generate a little complex data and use the Matlab function to write to a file.  You can also function Matlab that you posted - you will see that Matlab takes the array of complex apart in 2D (real, imaginary) and which are written as 32 bits, including LabVIEW floats called "Sgl".

    So now you know that you must read a table of Sgls and find a way to put together it again in a picture.

    When I made this experience, I was the real part of complex data (Matlab) [1, 2, 3, 4] and [5, 6, 7, 8] imagination.  If you're curious, you can write these out in Matlab by your complex function data write, then read them as a simple table of Dbl, to see how they are classified (there are two possibilities-[1, 2, 3, 4, 5, 6, 7, 8], is written "all real numbers, all imaginary or [1, 5, 2, 6, 3, 7, 4) [, 8], if 'real imaginary pairs'].

    Now you know (from the Matlab function) that the data is a set of Sgl (in LabVIEW).  I assume you know how to write the three functions of routine that will open the file, read the entire file in a table of Sgl and close the file.  Make this experience and see if you see a large number.  The "problem" is the order of bytes of data - Matlab uses the same byte order as LabVIEW?  [Advice - if you see numbers from 1 to 8 in one of the above commands, you byte order correct and if not, try a different byte order for LabVIEW binary reading function].

    OK, now you have your table of 8 numbers Sgl and want to convert it to a table of 4 complex [1 +, 2 + 6i, 5i 3 +, 4 + i8 7i].  Once you understand how to do this, your problem is solved.

    To help you when you are going to use this code, write it down as a Subvi whose power is the path to the file you want to read and that the output is the CSG in the file table.  My routine of LabVIEW had 8 functions LabVIEW - three for file IO and 5 to convert the table of D 1 Sgl a table of D 1 of CSG.  No loops were needed.  Make a test - you can test against the Matlab data file you used for your experience (see above) and if you get the answer, you wrote the right code.

    Bob Schor

  • Load a file EDS into LabView 2012

    Through research I found that DeviceNet Configurator is no longer available. I'm under LabView 2012 with IndComm/Devicenet 2.2 pilot. What replaces the DeviceNet Configurator? How to load the EDS files?

    Thank you

    Tennessee Paul

    My post here on a different topic, I thought that I would wear it to conclude this thread.

    Load an EDS file to the slave device

    1. Right-click on the slave device

    2. Select "Sheet"... »

    3. Click on add files...

    4. Navigate to the location of the EDS file.

    5. Select the file.

    6. Click OK.

    7. In the left pane, expand the data sheet newly added up to reach the node displays the version.

    8. Select the version.

    9. Click OK.

    Check the device and file EDS

    1. Right-click on the slave device

      1. Select utilities

      2. Select the Panel of Test online

    2. Select the option 'Device status' in the field of category on the left.

    3. On the right, select the slave device, you want to check.

    4. Click on "check the device".

    5. Read the errors/warnings or lack thereof.

    Edit the file EDS

    To change the EDS file, I used EZ-EDS , which is a specific devicenet EDS of ODVA freeware Editor.

    I did my corrections and saved my file EDS. (After having saved my original, of course).

    Remove the installed Labview EDS file

    1. Navigate to the following location: C:\ProgramData\National Instruments\NI-IndComm for DeviceNet\Datasheet

    2. Remove the sheet (Note: there is more that one datasheet added manually.) Additional EDS files come with the IndComm driver. Find the EDS file for the specific device that you want to replace and delete).

  • Conversion of files from LabView 2012 to 2011

    Hello

    I'm new to Lab View. I'm stuck with the conversion of this file of LabView 2012 to 2011. Help is highly appreciated

    Thank you

    With respect,

    Jagadish

    double post

  • How to load the Calibration file Agilent Instruments LabView 2012

    I'm using a vector Network Analyzer. Calibration is essential to give our creditbility of measurement results. In our case, we use Agilent instruments. Newer models allow certain calibration profiles be saved as States of calibration. These files are saved to the local hard disk of the unit and are loaded when needed.

    What is the equivalent to set all the parameters of calibration in this .cal file in the Agilent with Labview 2012 instrument?

    I downloaded the driver for my instrument and even ran the sample programs. It works fine but the calibration is set to the preset state that makes my whole system inaccurate.

    It should look like this (assuming that it's a NAP you use):

  • Where LabVIEW 2012 keeps the files recently opened?

    When you open LabVIEW 2012, the right side of the home screen displays a list of existing open.  In my case, 'bad' screws and projects (some no longer exist) appear.  I would like to change this list to clear the junk.  However, it is more in the file LabVIEW.ini, there doesn't seem to be (although I may have missed it) in my LabVIEW data folder.

    Who knows where it is?

    Found!  This is the file LabVIEW.ini - either I was watching 'bad' that precedes it, or someone put something weird in my tea when I wasn't looking.  Cleaning now...

  • Cannot find FP write in LabVIEW 2012

    System: Win7 64 bit

    LabVIEW: LabVIEW 2012 (64-bit)

    I can't find FP read/write etc in LabVIEW 2012.

    I installed FieldPoint 6.11 and disk driver OR. Nothing happened... And I can't find "fieldpoint" folder in "vi.lib".

    I noticed that my Win7 "Program files" and "Program files (x 86)". The labveiw program was in "Program files", I think. But there is also a "National Instrument" folder in "program feels (x 86). I just used by default to install the labivew.

    Do not know why. Can anyone help?

    Hi Yang,

    FieldPoint is not supported with 64-bit LabVIEW.  I propose to install LabVIEW 32 bit and then see if you can see these FieldPoint VI.

    Kind regards

  • Error-63101 when executing the FPGA Interface C API Generator in LabVIEW 2012

    I'm using LabWindows CVI 2012 and 2012 LabVIEW FPGA module.  I try to use the FPGA Interface C API generator and I get the following error from a freshly generated .lvbitx bitfile.  I use the local server compiles on my PC.

    Error-63101

    NOR-RIO: A valid .lvbitx bitfile is required. If you are using a valid .lvbitx bitfile, the bitfile maybe isn't compatible with the software you use. Determine which version of LabVIEW was used to make the bitfile, upgrade your software to this version or later, and then try again.

    The problem occurs when executing CVI or LabVIEW.  I was able to do this earlier when I was compiling the FPGA in LabVIEW with the API generator 2011 downloaded from the Web site.

    A bit of weirdness in my setup, it's that I charged it off downloads from the website (latest files after 2012 NIWeek) rather than the normal distribution DVD.  I installed LabVIEW, so NI RIO, then the Xilinx tools compatible with 2012.  It works very well when you talk to the FPGA to a LabVIEW vi running on my Windows PC to the host.

    Any suggestions?

    Problem solved.  I had to download FPGA Interface C API generator 12.0.  It works now.

    I would have thought that if a product was called on the menu in LabVIEW 2012, it would be prompted to upgrade to a compatible version, when I installed LabVIEW.  The old version is not compatible with version 3.0 bitfiles, as identified on the following lines at the top of the .lvbitx file:



     3.0

  • Error Code HDL with CRio RFP generation after update for LabView 2012

    Hello everyone,

    I use a CRio DP Comsoft master/slave module for my communication with a PLC system. The application worked perfectly under LabView 2011. After the update to LabView2012, I got an error message that the HDL Code generation failed. After that I've updated also the Software NI Profibus CRio in Version 1.3, but this n ' t´t solve the problem. The next step was to use the example of project code "CS_cRIO-PB_DP-MasterExample" which was delivered with the new NI CRio Profibus software. Even with this code example, the problem still exists. For detailed information on the configuration and the error message please refer to the screenshot. Any help or idea would be appreciated.

    Jürgen

    Hi Jürgen,

    I looked inside and could reproduce this error. Somehow the compiler with LV 2012 has problems with the coded 8.5.1 Subvi LV. Please use the attached VI and copy it to the following location. (\\Program Files\National Instruments\LabVIEW 2012\vi.lib\addons\Comsoft.lib\cRIO PB)

    Before do you it please close your LabVIEW.

    Then try to compile again.

    Let me know if it still does not. We are currently working on a new installer that will correct this problem.

    DirkW

  • Legend bug XYGraph slider blocks instantly LabView 2012

    Hello!

    I'm just facing a very annoying bug.

    Please find my attached VI example, I would like to know the weather, you can confirm the bug? Run the VI if you want to see a curve (in fact the bug appears even if you put all the data on the chart, if you do, all the same) and after that try to click the cursor vertical scroll bar legend to scroll upwards or downwards to see the cursor names.

    It instantly blocks my full version of LabVIEW 2012 Edition: 12.0.1f2 (32 bit). This XYGraph is still blocking LabView... I can't continue with my project, now I will just try to work around the error, I'll try to remove the sliders and then add them again...

    In any case, a very strange and very annoying behavior...

    Anyone could repeat the same bug?

    Thanks for the support!

    The reason for the accident seems to be duplication of the cursor "Gas_inject." There are four times. Using the property node 'CursorList' to remove these duplicates made the VI DO NOT crash when you move the vertical scroll bar of the legend of cursor.

    To simplify:

    Read the CursorList first, remove any duplicated the table manually in the indicator (right-click on the element > data operations > Delete Element). The change to a control, change the property node to write and run the VI once.

    Norbert

  • Impossible to install labview 2012

    I try to install labview 2012 on my 64 bit Windows 7 system, but fails;

    Here are the symptoms:

    (1) I click setup.exe directly and it shows that:

    (2) if I run it with the administrator, it appears that:

    (3) I checked that I can execute another exe file...

    Thank you

    Hi Bestchun,

    It could be a damaged Setup file. Try to re - please download the installer of ni.com/downloads.

    I will follow this post, answer so if this does not work for you.

    N

  • LabVIEW 2012 do not open

    My LabVIEW 2012 opens with a message that says operation side by side is not configured correctly.  I tried to open LabVIEW 2011 and he opened and I don't see the message, but it was very slow, as it opened.

    Before seeing the error, I did a repair on my Package redistributable Microsoft Visual C++ 2010 (x 86) and on my 4.5 .NET.  What is the best way to solve this problem?

    Thank you!

    I did a lot of installation and uninstall of Microsoft Visual C++ distributable, and which does not solve the problem.  I also did a repair for the 2012 of LabVIEW.  Later, I look at the event log, and who told me the LabVIEW.exe.config file.  I made the following change below, and that fixed the problem.  I don't know why but.

    LabVIEW.exe.config that caused the error






    LabVIEW.exe.config as the error correction





  • Create a data streaming from C++ stream and read it in LabView

    Hi all.

    I'm working on a project that is to connect to a tracker of movement and reading data of position and orientation of this in real time. The code to get the data is in c ++, so I decided that the best way to do it would be to create a c++ DLL that contains all the functions necessary to first connect to the device and it reads the data and use the node to call a library function to power the Labview data.

    I have a problem, because, ideally, I would like a continuous flow of data from the code c ++ in Labview, and I don't know how to do this. Put the node function of library call for a while loop seems like an obvious solution, but if I do it this way I'd have to reconnect to the device whenever I get the data, which is quite a bit too slow.

    So my question is, if I created c ++ function that creates a data stream, could I read that in Labview without continually having to call a function? I would rather have only to call a function once, and then read the data stream until a stop command is given.

    I'm using Labview 2010, version 10.0.

    Apologies if the question is badly worded, thank you very much for your help.

    Dave

    dr8086 wrote:

    This method resembles an excellent suggestion, but I have a few questions where I don't think I understood fully.

    I understand the basic principle is to use a call library function node to access a DLL that creates an instance of the device object and passes a pointer too in labview. Then a separate call library function node would pass this pointer to another DLL that could access the device object, update and read the data. This part could be in a while loop, then continue on reading the data until a stop command is given.

    That's all. I'm including some skeleton for example code. I am also including the code because I don't know how you experience multi threading so I show how you can use critical sections to avoid interactions between threads so that they do not lead to questions.

    // exported function to access the devices
    extern "C"  __declspec(dllexport) int __stdcall init(uintptr_t *ptrOut)
    {
        *ptrOut= (uintptr_t)new CDevice();
        return 0;
    }
    
    extern "C"  __declspec(dllexport) int __stdcall get_data(uintptr_t ptr, double vals[], int size)
    {
        return ((CDevice*)ptr)->get_data(vals, size);
    }
    
    extern "C"  __declspec(dllexport) int __stdcall close(uintptr_t ptr, double last_vals[], int size)
    {
        int r= ((CDevice*)ptr)->close();
        ((CDevice*)ptr)->get_data(last_vals, size);
        delete (CDevice*)ptr;
        return r;
    }
    
    // h file
    // Represents a device
    class CDevice
    {
    public:
        virtual ~CDevice();
        int init();
        int get_data(double vals[], int size);
        int close();
    
        // only called by new thread
        int ThreadProc();
    
    private:
        CRITICAL_SECTION    rBufferSafe;    // Needed for thread saftey
        vhtTrackerEmulator *tracker;
        HANDLE              hThread;
        double              buffer[500];
        int                 buffer_used;
        bool                done;       // this HAS to be protected by critical section since 2 threads access it. Use a get/set method with critical sections inside
    }
    
    //cpp file
    
    DWORD WINAPI DeviceProc(LPVOID lpParam)
    {
        ((CDevice*)lpParam)->ThreadProc();      // Call the function to do the work
        return 0;
    }
    
    CDevice::~CDevice()
    {
        DeleteCriticalSection(&rBufferSafe);
    }
    
    int CDevice::init()
    {
        tracker = new vhtTrackerEmulator();
        InitializeCriticalSection(&rBufferSafe);
        buffer_used= 0;
        done= false;
        hThread = CreateThread(NULL, 0, DeviceProc, this, 0, NULL); // this thread will now be saving data to an internal buffer
        return 0;
    }
    
    int CDevice::get_data(double vals[], int size)
    {
        EnterCriticalSection(&rBufferSafe);
        if (vals)   // provides a way to get the current used buffer size
        {
            memcpy(vals, buffer, min(size, buffer_used));
            int len= min(size, buffer_used);
            buffer_used= 0;                 // Whatever wasn't read is erased
        } else  // just return the buffer size
            int len= buffer_used;
        LeaveCriticalSection(&rBufferSafe);
        return len;
    }
    
    int CDevice::close()
    {
        done= true;
        WaitForSingleObject(hThread, INFINITE); // handle timeouts etc.
        delete tracker;
        tracker= NULL;
        return 0;
    }
    
    int CDevice::ThreadProc()
    {
        while (!bdone)
        {
            tracker->update();
            EnterCriticalSection(&rBufferSafe);
            if (buffer_used<500)
                buffer[buffer_used++]= tracker->getRawData(0);
            LeaveCriticalSection(&rBufferSafe);
            Sleep(100);
        }
        return 0;
    }
    

    dr8086 wrote:

    My main concern is that the object can get out of memory or be deallocated since it would not take place to any namespace or whatever it is.

    As you create the object with the new, the object expire not until the dll is unloaded or the process (LabVIEW) closes. If the object will remain valid between condition LabVIEW dll calls not a not unload the dll (who does if the screws are closed). When that happens, I don't know exactly what happens to the active objects (that is, if you forgot to call close), I guess the system recovers the memory, but the device could still be opened.

    What to do to make sure that everything is closed when the dll before I could call unloads close and remove the object is whenever I create a new object in the dll that I add to a list when the dll is unloaded, if the object is still on the list, that I'm deleting it.

    dr8086 wrote:

    I also have a more general question of programming on the purpose of the buffer. The buffer would essentially be a large table of position values, which are stored until they can be read in the rest of the VI?

    Yes, see the code example.

    However, according to the frequency with which you need to collect data from the device you have this buffer at all. That is, if take you a sample on every 100ms, then you can remove all threads and buffer related functions and instead to read data from the read feature itself like this:

    double CDevice::get_data()
    {
        tracker->update();
        return tracker->getRawData(0);
    }
    

    Because you need only a buffer and a separate if thread you collect data at a high frequency and you can not lose any data.

    Matt

  • Installation of the Module LabVIEW 2012 SP1 FPGA with LabVIEW 2012 SP1 64 bit on Windows 7 X 64 machine.

    I installed 32-bit and 64-bit LabVIEW 2012 SP1 on Windows 7 X 64 computer. After that, I installed SP1 FPGA Module. While module FPGA completely installed in the 32-bit version and could develop projects fpga, FPGA interface has not installed the 64-bit version. Anyone had this before question?

    The document 5WMF8NQ2 knowledge base says it's doable.

    I have tried to repair the installed module, remove and then reinstall the module. Nothing helped me to get the FPGA interface on a 64-bit host VI. Any suggestions? Addition of the individual screws through the range of editing functions like a tedious process and the palette is not completely functional.

    I solved the problem. Had to repair each driver separately for LabVIEW 2012 SP1 64 bit installed on the default drive. You may need to copy paste files to the folder that it installed in function.

  • Error 116 when a string of binary file reading

    I try to use the 'writing on a binary' and "binary file reading" pair of VI to write a string to a binary file and read it again.  The file is created successfully and a hex editor confirms that the file contains what is expected (a header + chain).  However, when I try to read the string back once again, I received an error 116: "LabVIEW: Unflatten or stream of bytes read operation failed due to corrupted, unexpected or truncated data.»  A quirk I found though, is that if I put "endianness" to "Big-Endian, network order", the error disappears when I use "native, welcome the order" (my original setting) or "little-endian" error occurs.  Did I miss something in the documentation indicating that you can use big endian order when writing of strings, I do something wrong, or is this a bug in Labview?  Because the program that it will be used for is to write large networks, in addition to channels, I would like to be able to stick to the 'native' setting for speed purposes and must not mix "endianness".

    I have attached a VI of example that illustrates this problem.

    I'm using Labview 8.5 on Windows XP SP2.

    Thank you

    Kevin

    Hello

    Please contact National Instruments!  I checked the behavior that you have met and agree that it is a bug, it has been reported to R & D (CAR # 130314) for further investigation.  As you have already understood possible workaround is to use the Big-Endian parameter.  Also, I am enclosing another example that converts the string to a binary array before writing to the file, and then converts to a string according to the playback of the file.  Please let me know if you have any questions after looking at this example though and I'll be happy to help you!  Thank you very much for the comments!

Maybe you are looking for