Jump to content

LogMAN

Members
  • Posts

    656
  • Joined

  • Last visited

  • Days Won

    70

Posts posted by LogMAN

  1. For now i just want to create top-level object ISldWorks from SolidWorks.Interop.sldworks.dll and for example, simply call RevNumber() method. Same action in Visual Studio works fine.

    ISldWorks is an interface that does not actually implement any code and therefore has no functionality. You would have to implement that interface yourself in order to provide any functionality. Since that is the case, an implementation in LabVIEW is impossible (you cannot implement .NET interfaces in LabVIEW)

     

    Sub Main()

            Dim app As SldWorks = CreateObject("SldWorks.Application")

            Dim revNmb As String = app.RevisionNumber

    End Sub

    This is an example in VB where you create an instance from SldWorks.Application which is an ActiveX object!

    In order to create an ActiveX instance use the function from following palette: Connectivity >> ActiveX >> Automation Open

    Create a constant as input and choose 'Select ActiveX Object'. You'll get a list of available ActiveX-Objects (this of course requires you to actually have them installed)

    You should definately look into that, but this has absolutely nothing to do with your .NET assemblies!

     

    Only thing i did is to add SolidWorks.Interop.sldworks.dll to a reference library.

    In LabView i acces to a ISldWorks class by creating .net referece and manually browsing to dll (static class? Not sure that is proper naming). As a result is empty reference.

    xjzcDxTO.png

    By the way, thanks for reply!

    Your basic approach is okay, but whenever you want to use an object, you have to create an instance of it (or have a function return it). You only provided a constant that defines the type and no instance. This is very difficult for me to describe, so here is an example:

     

    post-17453-0-23802900-1406223871_thumb.p

    Try this out, it works :D

     

    EDIT: Before I forget, I found a link to a document which describes some detailes to the interface mentioned ealier: http://sw.fcsuper.com/index.php?name=UpDownload&req=getit&lid=157

    • Like 1
  2. Accessing .NET components without any documentation is like looking for a needle in a haystack...

    My guess is that you try to access a property which requires you to do something beforehand (like loading a document, or assigning that mysterious 'key')

    Could you provide your current implementation?

    Maybe even an example of what you are trying to do in a .NET language (some sort of example code)?

  3. My boss is trying to save money by creating installers for code reuse :(

     

    Stupid boss :P

    In a time before VIPM, an installer (or in my case a solid zip file) used to be a good solution, however since a couple of VIPM versions the feature to create packages is available even with the community version. Also still working is the OpenG package builder (however I recommend VIPM). Just try it, it works like a charm (but keep in mind: there are certain limitations because of the license).

     

    But how do other developers know if more code has been added to the reuse library? Is it notified through team meetings?

    If you want to automate the process of updates you should get a license for VIPM and setup your own repository. Once you publish a new version everybody who is registered (also requires license) will see a * on the package. In terms of cost, the time spend to tell everybody that an update is available (meeting, or sending mail with everybody copy-pasting files) vs. sending a mail and everybody clicking 'update' in VIPM should be considered (again the VIPM solution is solid and tends to work where a manual task causes issues that could be avoided).

     

    In my case we send mails with a link to the new *.vip file, so it is only a matter of a couple of clicks. 

  4. Yes, you are correct.  The folder name cannot be changed.  So I guess I am stuck.  Maybe I can buy some of the NI guys a few beers at NI Week and try to persuade them to open this up.

     

    You could still delete the existing one and create a new one, however it might be difficult to handle all the relinking...

    I remember something about an INI key to activate "hidden" functions for VI scripting (or rather node options which are considered unstable as they are still in development and thus haven't been released for public access)... Maybe someone knows what I'm talking about and could share their thoughts? :)

     

     

    ... or maybe I'm insane? :blink:

  5. Good question. I just tested on my system again with a much highter writing rate of 1ms: Now I get the exact same error. So as I understand it, write access guaranties that no other application can write the file, but it does not guaranty file access at all times (for example if another application reads the file). There is some sort of locking procedure to ensure no data is changed while reading, however I never got much into Windows file handling.

     

    I suggest you avoid this situation entirely by not accessing the file while writing to it. You could split files after a couple of MB or a certain time. Your current solution works too, but you can't tell how much data will have to be buffered before a write operation is possible again (so the system might run out of memory in the worse case). A database is the best choice for shared access (and it is quite easy to query data into Excel). Not entirely sure about TDMS (in terms of shared access), but for measurement data it is the most efficient.

  6. Hi LogMan, 

     

    Thanks For the reply. The DLL is C++ compile using visual basic. I have found the edk.dll somewhere else. How do I include it into the dependency tree? I tried include it into the project folder and the folder mentioned above but still doesn't work. Do I somehow need to recompile the whole thing with edk.dll?

     

    The dependency tree represents dependencies of your code, so if the DLL is not listed, it is not called (note that you might have to open one of the calling VIs in order to see the DLL under Dependencies). I'm currently wondering if you call the DLL directly in the Call Library Node, or if you manually specify the path... In the first case the path might be incorrect, in the second case you have to manually include the DLL with your project and deploy it with the executable (or rather you should have an installer for your DLL which takes care of that).

     

    Can you post a screenshot of your Call Library Node?

  7. Maybe I'm missing something, but I don't see any edk.dll in your screenshots, just the edk.lib...

     

    Anyways, here are a couple of things you could try (assuming we are talking about a C DLL):

    -> Check if the Call Library Function does correctly point to the dll file (the path should be absolute imo)

    -> Look into the dependency tree if the file is listed there (it does not seem to be part of your project)

    -> Include the DLL file into your project

    -> Put the DLL next to the LabVIEW.exe (in Program FilesNational InstrumentsLabVIEW <version>) and try to start your application again (if it works you most likely have specified the DLL file name in the Call Library Function instead of the path)

  8. I'd rather not fork, to avoid fragmentation. Do you know if there's a way for non-members to submit patches?

    I've never done that, but I know there must be some option as you open a new ticket(might depend on the project). Some projects I follow provide a category called 'patches' to do such things.

    It seems there has been movement in your bug reports a couple of days ago, so that's a good sign I would say.

  9. SourceForge is the best starting point in addition to this forum. However the project has not developed much over the last couple of years (there are quite a lot bugs filed with no development for almost a year). You could fork the project for your own purposes and upload patches as you file bug reports or maybe become part of the team yourself (if one of the members would allow that).
    The project might be dead, if none of the developers is interested in continuing it. In that case you could still fork the project, but there is little chance that anybody would benefit from patches (unless there is a way to fork a project and upload new versions to the VI Package Network...)

  10. Thank you very much for making this clear. :)

     

    Still I am wondering what if I make 6 different workbooks and them combine all them into one. Like I open first workbook and loads data of second workbook into first one. Then close the second workbook open third and append its data into first and so on.

    Is this possible using labview?

    It is certain that I can not read entire workbook once rather copying one sheet into another would be feasible. 

     

    To make clear what am I intending to kindly refer this page. 

    http://smallbusiness.chron.com/merge-excel-worksheets-workbook-54664.html

     From step1 to step7

    Your link explains a way to merge multiple sheets into a single workbook. You'll end up with a single workbook containing all data, same as before. The fact that you copy pieces differently does not change the fact that all data will be loaded into memory each time Excel loads the workbook (This is just how Excel works). Since the amount of data is the same, the problem will remain.

    You'll always experience the same limitations no matter how you build your workbook.

  11. :blink: Wow, that's a new one for me... Could not belief at first, but it does work. Also just tested with a cluster containing strings and it works too (only if the cluster contains string and numeric types, but hey)!

    I've never used it for anything other than string or array of string up till now.

    Thanks for sharing Neil!

  12. @Bobillier

    Please check out the attached files that I did a save for previous on.

    I don't have 2011 on my pc (or the time to check the install at the moment) so if you could see if it's operational for you that'll help me out (along w/ anyone else that wants to use the 2011 version)

     

    Thanks,

    Norm

    Thanks for the port!

    I've just tested on my machine with LV2011 and it works just fine. I was able to run the DEMO Command Sender.vi & DEMO Command Listener.vi in the development environment, as well as the sender in the IDE and the listener as separate executable. No relinking issues or any kind of problem with file versions this far.

     

    EDIT: Well ok, the Rex_Sprinboard library seems to miss some files for generating user icons and such. I guess that's just not available in LV2011. It's missing files from ..vi.libLabVIEW Icon API*

    Does my installation miss something?

  13. yeah with 20 column it do work fine however I need to make 64 column in each sheet it does not take much memory in my RAM (700 to 900 MB). My system specification is  8 GB RAM and windows 7 64 bit os.

     

    Now If I create 6 workbook it run charm but the problem is 6 sheet in one workbook.

     

    My bad, I already forgot it had to be 64 columns each page... I've tested again and hit the same limitation on the 32-bit environment (with Excel using up to ~1.7GB of memory according to the Task Manager). Your system is more than sufficient for that operation (unless as rolfk correctly pointed out, you use the 32-bit environment).

     

    Unless you use LabVIEW for Windows 64 Bit, you can have 100's of GB of memory and your application is still limited to 2GB of memory maximum. This is inherent to the 32 bit architecture. Due to various components loaded by LabVIEW the limit of usable memory is usually more around 1.3GB. The 2GB is maximum usable memory and there needs to fit in your application, any modules it may use and some temporary management information for LabVIEW and Windows.

     

    The Excel plugin being ActiveX doesn't really help this as ActiveX in itself is quite a heavy weight technology. But don't worry, .Net wouldn't be better. :D

     

    This is absolutely right. There is however one thing: Excel runs in a seperate process and owns a seperate virtual memory of 2GB while in 32-bit mode. So you can only create a workbook of that amount, if there is no memory leak in the LabVIEW application. In my case LabVIEW will take up to 500MB of memory, while Excel takes 1.7GB at the same time. If the references are not closed properly, you'll hit the limit much earlier, because LabVIEW itself runs out of memory. In my case the ActiveX node will throw an exception without anything running out of memory (well Excel is out of memory, but the application would not fail if I would handle the error).

     

    I have never tried to connect Excel over .NET... Worth a shot?

     

    jatinpatel1489: as already said a couple of posts ago: Make use of a database to keep that amout of data.

    If the data represents a large amount of measurement data, TDMS files are a way to go (I've tested with a single group + channel, with a file size ~7.5GB containing 1Billion values -> milliard for the european friends :shifty: ). You can import portions of the data in Excel (or use a system like NI Diadem.. I've never used it though).

    If it must be Excel, there are other ways like linking Excel to the database (using a database connection). Last but not least you could switch to 64bit LabVIEW + 64bit Excel in order to unleash the full power of your system.

    • Like 1
  14. OK, here are the latest results:

    This time I let the application create 6 sheets with 20 columns, 600,000 rows each (writing 2 rows at a time). Notice that the values are of type DBL (same as before). Memory for Excel build up to 1,3 GB, but everything still works perfectly for me.
     
    My advice for you is to check if your RAM is sufficient, and review the implementation of the Excel ActiveX Interface. Be sure to close any open references!
    Without more information of your actual system (RAM) and at least a screenshot of your implementation, it is most difficult to give any more advice. If you could share a sample project that fails on your system, I could test on mine and may check for problems on the Excel Interface.

     

    Here is a screenshot of what I did (sorry, but I can't share the implementation of the Excel Interface)

  15. It works charm with me too till two Excel sheet. But as soon as third come in to picture it starts giving an error. The code uses only 720MB only. It does not have any problem if I bring down number of column data to 0.45M and raise number of sheet. 

     

    The problem is having 0.6M data in a column and work with 6 sheets. 

     

    Good point!

    I'll try that again tomorrow with multiple sheets...

     

    Does it work better if you save the workbook after each sheet?

  16. LavaG is kidding me right now...

    Again:

    I would recommend a database, however one of my colleagues implemented something similar in the past (Export huge datasets from an database).
    You should carefully check the RAM utilization of your System (Do you keep all data in Excel + LabVIEW?).

    I tested on my machine (LV2011SP1) with 4GB RAM and Excel 2013 using the ActiveX Interface. Writing 64 columns with 600.000 random DBL numbers in a single sheet, one row at a time. It works like a charm, however Excel now uses 650MB RAM

    EDIT: Just checked what would happen if I build all data in LabVIEW first and then export to Excel: LabVIEW now takes ~1.6GB of memory + throws an error: LabVIEW Memory is full

    The issue is due to the 32bit environment, where a single process can only handle up to 2GB of virtual address space, see: http://msdn.microsoft.com/en-us/library/windows/desktop/aa366912(v=vs.85).aspx

     

    The issue is also caused by my way of memory management (reallocating memory each iteration!) Just checked again, I tried to copy all data at once, therefore trying to copy a contiguous block of 64x600.000 array elements (which might not be possible if there is no block large enough to contain this amount of data)... Anyways, the issue is clearly not Excel, but the implementation in LabVIEW (in my case).

  17. Could you provide an example project?

    There have certainly been memory leaks with some .NET libraries ( Ping for example ), but it is hard to tell without seeing the actual implementation.

    However the usual issue is related to references that are not released ( using the 'Close Reference' function from .NET palette ).

    I've attached a code example with two implementations of the same function ( System.Xml.XmlDocument ), one releases the reference, the other not. Disable either of them and watch the memory usage.

     

    post-17453-0-13017400-1392278408_thumb.p

  18. I know these figures very well. I would like to see the code, but my current system does not have a LV2013 installation.

    Do you run your code on a standard OS/Hardware? (e.g.: Windows 7 on PC)

     

    For now I assume you do:

    General purpose OS and Hardware do not guaranty real-time capabilities. So the kernel will pause any thread whenever it sees fit. In my past tests the time sometimes spiked up to 400ms instead of the required 10ms, resulting in such graphs (even if the priority is set to 'critical'). Now you could let an external hardware do the acquisition and stream directly to disk. There might be other solutions though.

×
×
  • Create New...

Important Information

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