Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


cookjr last won the day on October 2 2017

cookjr had the most liked content!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

cookjr's Achievements


Newbie (1/14)



  1. Hi Jon, Using the build array primitive is not the most efficient way to do it, but this works. Jim example.vi
  2. Hi Jon, The error was a bug, and has been fixed in version 0.1-8. However, another problem is that you are trying to write an empty cluster array to a mat-file. I don't think this has a MATLAB equivalent. Clusters are like MATLAB structures, and arrays of clusters are like MATLAB cell arrays; so an empty cluster array is like an empty MATLAB cell array of structure. I haven't been able to recreate this in MATLAB. Now that the error has been fixed, the library will write an empty cell array to the mat-file when you tell it to write an empty cluster array. Thanks for helping to improve the library. Let me know if you have any other questions. Jim
  3. Hi Jon, I think they're the same. I edited your VI using LabVIEW 8.2.1, later versions of LabVIEW seem to have a default label appearance of having a transparent border. Check out the LabVIEW help for details on changing the color of objects. Jim
  4. Hi Jon, Thank you for the complements on the library. I hope it does everything you need. I edited your VI and it seems to be working now. The problem was the elements of the cluster array constant were unnamed. This was ambiguous in the earlier post. I attached the fixed VI. Let me know if you have any other questions. Jim test_cluster_structure.vi
  5. Hi Jon, I think you're confusing me with Jim Kring. I can see if I can help you with the MatIO problem though. I'll get back to you when I have an answer. Jim
  6. Try the attached VI. There is some documentation here, but it only has info on writing to a file right now. If anyone wants to help out, they're welcome to add to it. Jim read_test.mat.vi
  7. Hi Jason, Could you send me a mat file that is similar to one that you're having trouble opening? It doesn't have to have real data in it. Then I'll see what I can do. Jim
  8. Hi Dominik, Try the attached edited VIs. This won't give you the same structure as the "Anything" VI (cell array of structs), but it has the best chance at completing without throwing "out of memory" errors. Note that the only thing I changed in the waveform_array_to_cluster_array VI was that I switched the "insert into array" primitive with the "replace array subset" primitive, since you were preallocating an array. Efficiency is something that I would like to see improved in the library. It's not leaking memory, but it's not as efficient as it could be either. It's possible that using byte arrays and queues instead of strings would improve memory efficiency. This would be a major rewrite though. Anyway, I hope the workaround VIs work for you. Jim jrc2_test_tdms_to_mat.vi waveform_array_to_cluster_array.vi
  9. Hi Steven, The Append 1D Cell function requires a 1D array of "data elements". Data elements are the string output of any of the Append Data Element functions. This allows you to have different data types inside your cell array. All of the cell and struct functions work with data elements. Here's an example: Please note that the data elements inside a cell or struct array must not be compressed, and they must not have a name. Jim cellArrayOfStrings_example.vi
  10. Hi Dominik, matio-0.1-7 was just uploaded and it should have fixed this bug. For your info, the bug was given ID #2869727. This feature request was given ID # 2869732. This feature request was given ID # 2869734. This is a great idea. I think a separate "Extract Data Element By Name" polymorphic VI could be created. FYI, I think MATLAB stores variables to a MAT-file in the order that they were created, not in alphabetical order. Currently, you have to read the variables using the Extract Data Element VI in the order that they occur in the file. The List Variables VI can be used to determine the order of the variables. Thanks! And thank you for your bug reports and feature requests. The library is getting better, because of your help. Any new features will be added in version 0.2. Jim
  11. Hi Dominik, I should have caught this before by looking at your screenshot. All variables in MATLAB must have a name. The build array primitive creates an unnamed array. The current version of the matio library does not enforce the naming of data inputs (basically because sub-elements of cell and struct arrays cannot have a name). So the "Append Data Element" VI saved your data appropriately, but MATLAB didn't know what to do with it, since it didn't have a name. Here is one way to fix it using the "Insert Into Array" primitive: Future versions of the library will have some logic that will at least throw an error if there's a problem with element naming. Obviously some documentation would be beneficial for the current version. Thanks again for helping test the library. Jim
  12. Hi Dominik, Looks like you did everything right. The only thing that stands out to me is LabVIEW 2009. I do all my testing with LabVIEW 8.2.1. It won't be a problem for me to run the tests using LabVIEW 2009 when I get back to work. Very good to know. Thank you for testing this. Unfortunately, I'll be away from work until Monday, so I can't even look at your VIs until then. But I will definitely look into this problem and hopefully get it fixed asap. If you need MAT-files right away, you could use the lower-level VIs (Append Data Element (1D Double, N-D Struct, 1D Cell, etc.)). These give you more fine control over the result anyway. Thanks Jim
  13. 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. What version of the matio library did you use? Some bugs were found in earlier versions that have since been fixed. Did you install using the OpenG package format, or the zip package format? What steps did you take to write the array of clusters? A screenshot or some sample code would be helpful here. Could you send a sample of your 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? Thanks again for your help. Jim
  14. I added a whos-like VI to the latest version of the library. It returns the following information for each variable in a mat-file. variable name array dimensions data type (class) attributes (global?, sparse?, complex?) I'm still working on the unit tests. Having some trouble passing strings in/out of the MATLAB Script Node... Jim
  15. A whos subVI would not be too hard. I'm assuming you're talking about a subVI that returns a list of variables/attributes from a mat file. I'll add that as a feature request. I'm busy right now making unit tests for the library, so I won't be able to get to it right away though. Jim
  • Create New...

Important Information

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