Jump to content

MikaelH

Members
  • Posts

    835
  • Joined

  • Last visited

  • Days Won

    49

Posts posted by MikaelH

  1. I normally use a udl-file.

    (create a empty text file and rename it to something.udl , and then double click on it)

    My software reads this UDL/Text file and grabs the Provider string from it.

    E.g.

    Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Production;Data Source=MYSERVER

    The file is unicode and so you have to strip off all NULL-characters.

    If the file don't exists I start by creating it by just writing this Unicode-text file.

    Cheers,

    Mikael

  2. QUOTE (zmarcoz @ Feb 23 2009, 10:34 AM)

    ..or why don't you use an object oriented approach with simulated objects.

    This is how I’ve solved it.

    All instruments inherits from a VdTestInstrument-Base class

    This class has child classes for every instrument type I need.

    E.g. Power Supply, Digital Input units, Switches, Climate Chambers.

    For every sub group of instrument e.g. the Label Printing-class, I create a Simulated class and then the real implementation classes in this example I have three different implementations for printing a label.

    post-941-1235358582.png?width=400

    In every Simulation class I register this simulated object to a <SINGELTON> class I call “VdTestInstrumentSimulation”.

    post-941-1235358659.png?width=400

    ;-)

    This class shows a dialog box where I can select which simulated objects to open.

    The dialog box dynamically opens the “SimulationDialog” method in the simulated class that gives the user an interface to the Simulated object.

    Here the user can monitor what is written to the object and also control what responses the object should report back when you do a e.g. Read function on the object.

    E.g.

    post-941-1235358668.png?width=400

    This is how I can simulate all instruments on my Rig, I also of cause create a simulated DUT unit so I can test my software completely before deploying it in production.

    Cheers,

    Mikael

  3. QUOTE (Jim Kring @ Feb 20 2009, 08:26 AM)

    I can of cause add a checkbox that allows the tool to delete any existing method before, but that's a bit scary.

    If I add an automated backup feature of the deleted/removed method then it would be quite safe.

    We're just about to release a new version and I'll see if I can squeeze this function in.

    QUOTE (Jim Kring @ Feb 20 2009, 08:26 AM)

    2) The GDS "Clone VI" dialog only permits sending the new clone to a single class. I want to send it to about 30 sibling classes. Ideally, I don't want to have to do a "Clone VI" operation 30 times.

    You can clone a method (from the base class), to one or all siblings, see image below:

    post-941-1235085040.png?width=400

    I haven't added the function of sending a method to several other classes but it's a small task to do that.

    I can create a beta version for you during the weekend if you are interested?

    Cheers,

    Mikael

  4. Your are right, and it's sooo annoying.

    I've talk to a NI guy about this and he recommended to use the auto tool selection.

    But I haven't become of friend of that yet.

    This is especially bad when my front panel is covered by a tab control, then I can't find an "empty" front panel place to do my shift-right click combination.

    This is something that really bugs me. :headbang:

    Do anybody know if there is a tweak to fix this?

    Cheers,

    Mikael

  5. HI Chris

    You can use the scripting function Select object and the Copy it and then past in a new CTL file.

    But the problem is that you are not allowed to copy an object from a running VI, so you have to first take that VI and do a file-copy/"save as" of it to a new name, open that VI and then you can Copy and Past in to a typedef CTL file.

    //Mikael

  6. I’ve gotten some answers from NI regarding my problem.

    First there is a known bug in LabVIEW that prevents the runtime engine to allocate as much memory as the development environment.

    Second problem is that I tried to allocate a big chuck of memory at once. If Windows can’t give LabVIEW a continuous bit of memory from the RAM with this size you get the “Out Of Memory” message.

    There are memory defragment program that can make it better.

    I tried to allocate many small chucks of memory than it works better, but still an executable can’t allocate as much as I can from the development environment.

    //Mikael

  7. 4G of RAM when running Vista 64 bit

    Everywhere you read it tells you that you can allocate 4G of RAM when running LabVIEW on Vista 64 bit OS.

    But I can’t get it working, on my VISTA-64 machine that has 8G of RAM installed.

    First thing I found is that when running a small memory hungry application in LV8.6 development environment it can allocate more memory compared when I run it as an executable.

    post-941-1232661973.png?width=400

    The “Size” value could be 32767 on Vista-64 in when running it from the development environment, but only 28623 when running it as an exe.

    Maybe why “Size” only could 32767 (2^16)/2 is a limitation of how big LabVIEW allows arrays to be.

    When using the value 32767, LabVIEW allocated 1.07 G of RAM, I can see this in the task Manager also.

    The Value 28623 corresponds to only 0.82G. Why can I only allocate 0.8 in one array in an executable?

    So if there where a limit of how big one Array could be, I copied the code above so 2 arrays of the same size should be allocated, that means 2.14 G of RAM.

    (I could actually only set the Size to 32729. before I got Out Of Memory)

    post-941-1232661993.png?width=400

    So I could only allocate 2G of RAM.

    So what am I doing wrong?

    The scariest thing is when I convert this second application into an executable. The application gets limited to 0.8G of RAM. I could only get the Size value up to 20300 which is 0.82G.

    Cheers,

    Mikael

  8. Hi

    I’ve created and Executable in 8.6 using lvlibs, and lots and classes.

    The executable works as it should.

    Then when I create an installer and run it after that, it complains that some VIs aren’t of the right version and can’t be loaded.

    (I need to run the installer to get the RunTime-engine installed on these computers).

    So what I have to do then is to copy all the files under the Build/EXE-file folder and paste them on the target PC’s c:\Program Files\MyApp folder.

    Have anybody exercised the same problem?

    I know there were a patch I had to use to get this working in 8.5, I had to update some VIs in the build-folder to get it working.

    It had some problems with lvlibs containing lvclasses.

    Cheers,

    Mikael

  9. QUOTE (Jeff @ Dec 20 2008, 10:39 AM)

    ...not really sure how I would go about this using GOOP (I'm using GOOP Developer Suite 3). I see that there is a function for "cast to more specific" in the GOOP Kernel VI, but I'm not sure how to use it (if it should be used).

    Hi Jeff

    FYI the "cast to more specific" don't work in LVCLasses, it does work in the GOOP2 version of classes and is still in there to be backwards campatible.

    I used this function in the UML modeller when I cloned an object. I copied a Java design where you first call the Super.clone method that goes all the way down to the "root" Object-class that everything inherits from in Java.

    Then when that method return a new cloned object, I type cast it to more specific and then add "my stuff to it" and then let the sub classes do the same thing.

    Cheers,

    Mikael

  10. When saving to file I normally save it as binary, like this. If I stick to SGL it takes less then 500ms on my computer, for DBL it takes a minute.

    post-941-1229319075.png?width=400

    When I need to save this is a database, I first ask my self do I need to search through the data or use any powerful calculations functions the database can offer.

    If you need these functions, you have to save it as normal float values.

    But if you only need to store it somewhere I would suggest only save the path in the database and then place the binary file on a file server.

    Otherwise you can use a binary column type.

    Cheers,

    Mikael

  11. ...but which implementation executes fastest?!?

    I just had to try this. So I made a quick calculation VI with 3 different implementations, as show in the picture.

    You would think that LabVIEW would optimize the code and execute in almost the same way, but there is a time difference in all three implementations.


    post-941-1228348201.png?width=400

    The answer was the Formula Node :-)

    Cheers,

    Mikael

  12. I use Class Attributes from time to time.

    The definition if of cause that this data is shared between all objects of the same type.

    If you e.g. have a common TCP/IP server all objects should communicate with, it's good to save the IP-address here.

    If you need to change the IP-address in the middle of the execution you just change it in one place instead of changing all objects.

    On thing I often use it for, is to save a references of all created objects in.

    Then I can create a ClassMethod (Static) that can return reference to a particular object type.

    Static Method: GetInstrumentByType

    Statis Attributes: InstrumentsName & InstrumentsRef

    post-941-1227474011.png?width=400

    But to get this working you have to use the Class Attributes in a special way.

    The class attribute of a VdLabelPrinter objects will not have anything in common a VdDigitalContoler object. So I can't really use a Static method GetInstrumentByType, from the Base class VdTestInstrument to get these objects.

    So I have to store the references to all objects in a Class Attribute that is Common for all created objects that is derived from the VdTestInstrument base class.

    If you lock and unlock the class attributes without wiring a reference in to the VI (Reference value=0), you can save class attributes in a memory that isn't aware of any derived classes.

    post-941-1227474076.png?width=400

    So you actually have 2 different class attributes to store data in.

    1) If you wire the lvclass wire into the lock attribute, you will get a unique shared memory for a objects of that type.

    post-941-1227474126.png?width=400

    2) If you don't wire the reference into the lock attribute, you will get a unique shared memory that you can access between all classes that derives from this class.

    post-941-1227474170.png?width=400

    Cheers,

    Mikael

×
×
  • Create New...

Important Information

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