Jump to content

vugie

Members
  • Posts

    393
  • Joined

  • Last visited

  • Days Won

    32

Posts posted by vugie

  1. Has anyone coded up an orthogonal fit regression?

    This is a Model II regression (error in both Y and X variables).

    I made something like this, but not very general - just for one case. I was minimizing sum of squared euclidean distances from measurement point to curve and from error rectangle to curve (weighting both - weight for distance from error rectangle was higher). I coded it using my genetic algorithm (Waptia), but it should be doable also with Unconstrained Optimization.vi.

  2. Note that this actually breaks in 2009 EXEs, because of the new EXE-as-ZIP scheme - the folders which are inside the EXE are recognized as actual folders and so the stripping stops while still inside the EXE. The function Shaun pointed to works around this.

    Except for situation when VI was dynamically called from outside the EXE... A lot of things to check to have general way. Looks like OpenG package needs to be updated...

  3. If I am writing a VI now from which I'll burn an Application later, will the first example work in the VI and not the App while the second example works in the App but not the VI?

    I'm a bit confused on the distinction. Enlightenment please?

    There is an OpenG VI "Current VIs Parent Directory" which abstracts from running environment. It uses same method as asbo showed, but strips the path until it becomes valid directory name. Optionally it adds some relative path. Veeeery useful.

    BTW, Jim, what happened to your "OpenG VIs I couldn't live without" series?

  4. I managed to create what i wanted using the sprinboard thing. Im still not sure how to gain access to private methods though.....

    You need Scripting Workbench and/or PMS Assistant.

    I drilled into this topic a little bit and here is VI to read all tag names from VI of given reference. It gets only persistent tags. LV 8.2 - it uses resource manager library, I'm not sure wether it is in same place in newer versions.

    Get VI Tag Names.vi

  5. Hi

    I have laaaarge binary file (array of clusters). Not possible to load at once. Read from binary file generates an error (error code 2) and message box "Not enough memory to complete operation" pops up. Ok, I want to load as much as possible (with reasonable margin) - so how to determine what is the largest array I may allocate (at the moment, not generally). What I already tried:

    1. Memory manager functions to determine free memory (AZFreemem, AZMemStats) - always return 0 (I found that they are Mac specific functions)
    2. Trying to allocate big memory block with memory manager decreasing its size each time when it was unsuccessful (and freeing it again on success) - the size of largest allocatable memory block acquired that way was always much larger than array I was able to initialize (attempt to initialize to large array causes pop up message, but no any programmatic feedback)
    3. Sequentially decreasing the array size provided to "Read from Binary File" and parsing error cluster - pops up message each trial (unavoidable) and sometimes does not generate any error, but array loaded is empty

    So what is best method to programatically determine largest possible array?

    LabVIEW 8.2

  6. I know that embedded google search into your site costs $, but I wonder if we can do something that passes through the search term directly to such a google search?

    IP.Board costs $. So why they provide such a #@$%^%$#@$$?

    It's hardly belivable that users don't press them to fix such an issue for such an important functionality...

    It's so hardly belivable that I would suppose that search function is simply not well configured on LAVA...

  7. I guess that one parameter may be used in multiple functions.

    I've implemented something similar using my Waptia genetic optimization library. All you need is to prepare VI which calculates sum of squared distances for all curves for all measurement points and for given set of parameters (well, inverse of the sum, because this is a fitness function). The parameters must be scaled to 0..1 range.

    Another solution would be to use standard curve fitting, but to create virtual curve which uses part of its domain for each real curve.

  8. François, could you please save your tools (and possibly control packages) in as low version as possible? I'm still with 8.2 and I know that many people still do something in 7.0 (only packages would be usable for them, because of LVOOP).

    Besides that I would like to see the code and find out the reason of "pure white" bug (which is propably BitMan's fault, so mine :) )

  9. I'm just playing with SWIG, whuch is able to parse C/C++ headers and create XML with description of all types and functions. From such XML it should be possible to programatically create typedefs and even wrapper VIs using scripting. I have no usable results yet, but it is promising - I want to use it to automatically create C wrappers for C++ DLLs.

  10. I've used Maxima for few times to perform some sybolic calculations (mainly differenciation of matrix equations) and it went quite smootly. I didn't use Mapple, so I can't compare them.

    Not so long ago I used Scilab a lot. It's open source Matlab-like environment with Scicos component which is Simulink equivalent. Syntax is really similar to Matlab, there are even some tools to convert programs between them. Very stable and mature environment, a lot of free toolboxes, very good and easy visualization and interface building (tk based). Scicos was also good, but its interface was quite not comfortable. I monitor this project periodically and I see that a lot changed since I used it last time and now it seems to be even better. But now I use LV for everthing...

  11. Integration properties of 1/s come directly from defition of Laplace transform and mean that for any F(s), inverse transform of F(s)/s is equal to integral of f(t), where f(t) is inverse transform of F(s). It has nothing to inverse transform of 1/s itself.

    If you want to apply this rule to 1/(s+a) you have to extract 1/s from it: 1/(s+a)=(1/s)*(s/(s+a)). Inverse transform of s/(s+a) is -a*exp(-at), integral of which is exp(-at).

    Laplace transorm may help you to calculate integral of given function f(t). You simply has to calculate its transform L{f(t)}=F(s), divide it by s (multiply by 1/s) and make inverse transform of the result. It will be equal to integral of f(t).

  12. The Data Type property seems to hold the data, not the type. The Data Type of the States wire contains the Variant "". I've managed to get the data type, having found a reference that said it is found in the low byte of the first element in the Type Descriptor array. This turns out to be 26 in most cases, but not all, so I still need help.

    Here is version which properly (I hope) tests the data type. I used Compare Data Type (private) method of Application. There is also Compare Type method which compares type descriptors.

    I also added automatic calculation of proper offset to center the wire (for y coordinate). You could also think of calculating x coordinate from cursor position.

    Insert_AS2Q_vug.llb

    • Like 1
  13. How can I test the data type of the wire? I don't want to activate this plugin unless a String wire is selected.

    The wire datatype is always a datatype of its source terminal, which is always first element of Terminals[] property of the wire. And Terminal has Data Type property (variant) and Type Descriptor property (which is not exposed in scripting, so you have to use Scripting Workbench or PMS Assistant to get it).

    What concerns not centered wire - I can't open your code (please save in 8.2) but I belive that you should use Create Described Wire method providing as wire description start and end points which should be center terminal points (see my previous post). Remember that coordinates should be provided in reversed form (y,x). Check out how I do it in my Weird Wires plugin.

    • Like 1
  14. I do nor understand exactly what do you search for, but this is what I know:

    - wire's owner is always a diagram (so this is why wire's owner's owner is case structure)

    - diagram is also positioned against its owner

    - I don't know exactly what wire's position means but I didn't find it useful

    - exact wiring point is TerminalPosition + (TerminalSize modulo 2)

  15. Hi Vugie!

    Could you please post screenshot?

    Cheers

    -JG

    I didn't save it, but it's pretty simple:

    Get subset of data starting with many zeros (it is black line) - I had to remove one or two starting zeros to get straight image. Now for 1024 times (32*32) scan for 3 integers and join them with "RGB to Color.vi". You'll get 1024 long U32 array. Reshape it to 32x32 and draw as unflatten pixmap.

    But this image doesn't look like icon - it hasn't a border. I think that icon is coded within NI.Lib.Icon tag - there is no NI_IconEditor tag in classes I made in 8.2

    • Like 1
  16. Howdy

    Following along the lines of this topic... does anyone here know how to change the icon of a LVOOP class .ctl or are they able to read the data in a tag in the XML file?

    I had a go at this tag: NI_IconEditor in this class

    Does anyone know? Or can point me in the right direction?

    Cheers

    -JG

    By taking a subset of this data and reading it as RGB data I got following picture:

    post-7450-126095742205_thumb.png

    There is also NI.Lib.Icon tag, but after unescaping its content its size is only 727 bytes and plain text coded. I have no idea how it may be coded.

  17. The name is editable in the listbox. Just like changing file names in Explorer - click on the new style to select it and after a while click again and the name becomes highlighted to edit (as opposed to item selection highlighting). I agree, it is not too intuitive... Any idea how it should look like?

×
×
  • Create New...

Important Information

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