Jump to content

kinimod

Members
  • Posts

    6
  • Joined

  • Last visited

Posts posted by kinimod

  1. Hi Jim,

    does the library support reading of structures created with MATLAB.

    Currently i'm having trouble with this.

    In the example I try to read a simple Matlab struct

    contained in d.mat, having one field "a" (scalar double) and one field

    "b" (vector double).

    Apparently there is something wrong with the type input (test_cluster.ctl)

    on the matio read VI. The attached example fails with an error message

    complaining about a connector pane mismatch.

    Any help would be appreciated

    Best

    Dominik

    post-16481-094096900 1280407755_thumb.pn

    post-16481-019102300 1280407751_thumb.pn

    test_matio_read_struct.vi

    test_cluster.ctl

    d.mat.zip

  2. Hi Jim,

    now I have problems converting large tdms files (about 70MB) to a mat file.

    The matio library fails with an "Out of memory" error.

    Is some part of the library leaking memory or is this simply a misusage of

    the library VIs on my side?

    Attached is one minimal VI that reproduces the problem.

    The waveform_array_to_cluster_array SubVI transforms the

    waveform array read from the tdms file into a cluster array

    to be written by the matio library.

    Dominik

    test_tdms_to_mat.vi

    waveform_array_to_cluster_array.vi

  3. Hi Jim,

    thanks for the quick reply. This solved the previously reported problem.

    Unfortunately there is another issue: when column vectors are created in MATLAB,

    e.g. n x 1 arrays, they are not correctly read by the library.

    The variable returned just contains a single element.

    This does not occur, if row vectors, e.g. 1 x n arrays are created.

    Further, when chaining multiple read-mat VIs it would be convenient to have a

    copy of the endianess input as output.

    And maybe it would be nice if one could specify the name of a variable to

    read from the file instead of having to read them sequentially in alphabetic order.

    Nevertheless the library is very useful already :).

    Best regards

    Dominik

  4. Hi Jim,

    thanks for the quick reply.

    Hi kinimod,

    Thank you for taking the time to report this.

    I hope we can isolate exactly why it didn't work for you, so the library can be improved for future users. It would be very helpful if you could provide more details about the steps you took to write the data.

    1. What version of the matio library did you use? Some bugs were found in earlier versions that have since been fixed.
    2. Did you install using the OpenG package format, or the zip package format?
    3. What steps did you take to write the array of clusters? A screenshot or some sample code would be helpful here.
    4. Could you send a sample of your data?

    [\quote]

    • Version 0.1.6. Should be the most recent one.
    • I used the OpenG package and installed it with the VI package manager. My LabView version is 2009 (9.0)
    • I simply modified the example VI given by the screenshot in your fist post (see attached image).
    • Due to forum limitations i could not upload the resulting 'test.mat', but attached the VI used to create the data.

    Regarding the waveform data: I think that the waveform data structure is a little different internally than a cluster, although they do some similar things. I don't normally use waveforms, so my original intent was to store them so that LabVIEW could read them back in properly instead of transforming them into something that MATLAB could use (i.e. a timeseries object). Were you able to read the waveform data back into LabVIEW?

    Having waveforms as timeseries objects would be nice. But writing arrays of clusters would

    already be fine, since converting waveforms to clusters is straightforward.

    Writing and subsequent reading of waveforms from LabView works (see attached test_matio_waveform.vi).

    Dominik

    post-16481-125382181346_thumb.png

    test_matio.vi

    test_matio_waveform.vi

  5. Nice work.

    Unfortunately writing an array of clusters does not work.

    There seems to be no variable in the mat file. If i understood correctly

    an array of clusters should be mapped to a cell array of structs or

    a struct array in Matlab.

    Another issue (maybe related to the one above): Writing a waveform

    does not work as well, although this is essentially just a LV cluster.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.