Jump to content

Francois Normandin

Members
  • Posts

    1,209
  • Joined

  • Last visited

  • Days Won

    46

Posts posted by Francois Normandin

  1. QUOTE (MJE @ Oct 28 2008, 05:18 PM)

    Noob question here (as far as XControls go)...

    When I plop my XControl down in a VI, it somehow gets an ugly 3D frame, which isn't part of the control. My guess is it's part of the container object that hosts the control? Is there a way to get rid of this eyesore?

    You can get rid of it but disabling the "Window has title bar" from your Facade VI. Check the Facade VI Window Appearance properties.

    EDIT: Could that be considered a bug?

  2. QUOTE (d_nikolaos @ Oct 27 2008, 06:07 PM)

    Yes, I only have integers. I thought that it was the same.

    Is it better to use "Fractional String to Number"?

    I just check it and it has the same result.

    If you've got only integers, then you selected the right one. :yes:

    They are not the same... ex: 3.14 string converted using Fractional String will give 3.140000, and you'll get 3 if using Decimal String. It's a common mistake in ANY programming language!

  3. QUOTE (d_nikolaos @ Oct 27 2008, 05:08 PM)

    Thank you very much for your help

    This is my final VI

    You're welcome.

    I see you've used "Decimal String to Number" instead of "Fractional String to Number". Do you have only integers in your file? If you have floats, you're going to lose precision in the conversion...

  4. QUOTE (d_nikolaos @ Oct 27 2008, 03:53 PM)

    The Array size works fine for me but the Add arrays elements doesn't work.

    I want to add all the numbers of table 2 ( Squer of table 1) and then divide this number

    with the number of array size.

    I read some numbers from a xls file.

    Here is the Vi.

    A table is a String 2D Array. You need to convert to Numerical 2D Array.

    Check out the "String>String/Number Conversion" Palette.

  5. QUOTE (d_nikolaos @ Oct 27 2008, 02:36 PM)

    Hi,

    I am trying to add the numbers of a table. Is that possible?

    Moreover I want to ask if there is any function that counts

    how many are the numbers of the table.

    There's a "Add Array Elements" in the Numerics Palette. It is polymorphic and will add your table easily.

    For counting the elements of an array, look at the array palette. The first icon is ArraySize.

    Look up the context help (Ctrl-H) for these functions to get more info.

  6. Hi Dave,

    Try investigating the Interpolate & Threshold 1D Array in the Array Palette. You can specify the spacing yourself and iterate in a for/while loop to generate the proper vectors. This is "linear interpolation". You can have a look at spline interpolation too...

    When you have worked a little with these, post what you've got if you're still stuck.

    post-10515-1224605512.png?width=400

  7. QUOTE (Antoine Châlons @ Oct 21 2008, 08:49 AM)

    I agree with Anders, I almost always use median filter instead of average (and not only for signal acquisition).

    I agree. Moving averages can be tricky when doing signal processing. It "can" smooth a trace efficiently in some circumstances but it has the bad habit of shifting your signal temporally. Frequency filtering is much better for time-critical traces.

  8. QUOTE (maybe @ Oct 21 2008, 04:32 AM)

    In my real application, the vectors will change in every loop (some time it stays the same , but most the time it changes), and I believe if I dont use the "remove all"/"clear data" the plots will overlap with previous. Or am I wrong about it? Thanks.

    It will not overlap indeed.

    To convince yourself, add a random number in every iteration of your VI and you'll see the vectors will be overwritten, not overlapped. If you were in need of overlapping to keep the trace, you'd need to use shift registers and append the new data.

    I suggest you move the "Clear Data" before the while loop so you effectively clear the graph every time you start your VI.

  9. QUOTE (alfa @ Oct 10 2008, 03:25 AM)

    I calculated that 98% of population(people who are at the level of one of the first 3 chakras) are at animal level.

    With 10194 members on LAVA as of today, that makes 203.88 of us that are not at animal level.

    There's hope for us yet! I wonder who is the 0.88 though? :o

  10. QUOTE (km4hr @ Oct 17 2008, 10:22 AM)

    The students will take apart (ie break) any LabVIEW application I create if it's easy to do so. I just want to reduce the chaos by making it a little harder for students to modify my work.

    Ah... I can tell you that researchers will do the same thing, not only students!

    I'd keep a copy of the original code in a Code Repository on a separate disk, and use passwords to protect the diagram from tempering.

  11. QUOTE (shoneill @ Oct 16 2008, 10:46 AM)

    Well I was under the impression that you don't NEED to know the internal class representation. Even casting all objects in an array to a base class will still call the CORRECT dynamic dispatch VI when using those objects. So just casting an object as a parent class does not make it suddenly call the parent version of a dynamic dispatch VI. It will still call the correct dynamic dispatch VI. The QUEUE/notifier/Event simply avoids variant which could otherwise be problematic.

    As AQ has already stated, a single VI with a dynamic dispatch call will do the trick. My idea was to have this VI AQ is referring to within the class, in essence moving the "dynamic dispatch" part up one level.

    Getting the exact VI refnum might be problematic though, so AQ's solution gets around that.

    Shane.

    Shane.

    Now I see. I didn't get what you were explaining at first. Sorry for the confusion.

  12. Hi Michael,

    I could not reproduce the error you get (I'm using LV 8.6). I'm not sure if the version makes the difference, but anyway, the dynamic dispatch didn't work.

    I created A & B (B inherited from A) and the VI dynamically called was always A, whatever I did. As you said, I kind of expected it... but I didn't get the errors you mentioned. After all, B object can propagate on A-type wire.

    I always got the result expected if A:Calculate was called. So yes, it works with static dispatch... but not dynamical. I'm sure AQ will step in to give the exact reason why it doesn't (or maybe shouldn't ever) work. ;)

    QUOTE (shoneill @ Oct 16 2008, 05:35 AM)

    You can launch the VI and then send the actual object via user event, queue or notifier. The launched VI waits for this information (You can pass the event refnum or further via VI server before running it) and then launches the base class of the Dynamic dispatch VI which will retain the "dynamic dispatch" part.

    This way you don't have to go via Variant.

    So what I'm saying is that the code for launching the VI without waiting belongs IN the class. That way you should be able to do what you are looking for without sacrificing the automatic dynamic dispatch handling.

    Shane.

    Hi Shane,

    I don't understand how you will know which instance to call even by wrapping the object in a queue/notifier/user event. If we don't know yet which VI will be called (parent or child), how do you unwrap from the queue when the code is dynamically called? The way I imagine it (not tried this yet), I don't know how I can avoid ending up with the parent object type.

×
×
  • Create New...

Important Information

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