Jump to content

Jeffrey Habets

Members
  • Posts

    193
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Jeffrey Habets

  1. QUOTE (LV_FPGA_SE @ Jul 26 2008, 12:54 AM)

    Very good point. Earlier this week I asked a coworker of mine what I should be calling the design pattern employed by Functional Global Variables, but used for another purpose. So are these Global Functions, or what do we call them? (Different methods implemented in a Case structure, acting on a set of variables stored in uninitialized shift registers of a While loop)

    I guess they're precursors to very simple LV classes.

    In OO terminology they would classify as a singleton design pattern. Because that's basically what they are: a class of which only one object can be instantiated.

    An advantage of this particular singleton implementation is that we don't have to pass a class reference around. :) Disadvantage ofcourse is that reads are always serialized and we have to wire and set the method selector everywhere we call a 'method' of the class.

  2. If you have "Allow drag" for the cursor set to off you can't drag the label either. So that wouldn't be an option.

    You can set the label offset to the cursor position in the "Cursor list" property.

    Mind you that if you have a scale multiplier set other than 1 to one of the scales the cursor is connected to. The cursor label will "drift away further" from the cursor position each time you change the position. This is a bug in LV.

  3. I use a 14.1" laptop with 1280x800 resolution (Dell Inspiron). I choose this because it's very portable, and I can work up to 4-5 hours on one battery charge. The only down-side for me until now is the vertical resolution. Not for the BD's, cause I keep these always quite smallish, but for the FP's. Most customers use screens with resolutions of at least 1280x1024, and sometimes an application simply needs to use all available screen real estate. Well, I can tell you its pretty difficult to get to the bottom of a 1024 pixel high FP with the scrollbars turned off on a screen that has only 800 pixels vertical resolution. :thumbdown: My next laptop will probably be the smallest one available with at least 1050 pixels vertical resolution.

    Although the system at home/work (a desktop system with 24" 1900x1200 resolution) is a way more relaxed work environment I don't want a laptop with that same resolution, so I just try and keep all BD's within my laptop's resolution.

  4. QUOTE (horatius @ May 15 2008, 07:51 AM)

    It is:

    QUOTE (LabVIEW help)

    . If a Feedback Node globally initializes and you
    , the Feedback Node initializes to that value on the first call of the VI in an execution. If you do not wire an input value to the initializer terminal, the initial input of the Feedback Node for the first execution is the
    . Each time the VI runs after the first execution, the initial value is the last value from the previous execution. The following block diagrams show the differences in value from execution to execution for a Feedback Node with a wired initializer terminal and a Feedback Node with an unwired initializer terminal.

  5. QUOTE (psiam @ Apr 28 2008, 10:03 AM)

    How can I control PIC programmer (MPLAB IDE V8.00) with LabVIEW 7.1?

    I think there is a commandline executable that's part of MPLAB (PM3.exe) that you could call via system exec with the right parameters to program your device. You should find more information in your MPLAB documentation or on the Microchip site.

  6. QUOTE(Yen @ Nov 8 2007, 05:41 PM)

    Yes of course.. But for simple (lv2-style) sub-vi's where you know not much will change later on, it's still convenient to just use a shift reg or two-three..

    I'll enter it in the product suggestion center...

  7. Hi guys,

    I have the habit of always labeling my shiftregs on the left hand side of the loop they're on. I use free labels for that, but it would be nice if the labels where (optionaly) automatically created (like with objects on the FP). They would be attached to the shiftreg, moving with it when the shiftreg is moved up or down.

    besides being a handy feature for myself, it would probably also encourage others who don't label their shiftregs now to do it anyway, because it would be the next logical (more or less forced) step after creating the register.

    What do you guys think?

  8. QUOTE(tcplomp @ Sep 19 2007, 02:19 PM)

    I've been thinking a little about this, what you expect is a read-only 'value' property for latches and a read/write for switches.

    But there's an issue. Value is a property of the 'Control' class... and not of a '...... Control'. So the Boolean latch class should disable the write property of a Control.

    And using a the 'dynamic casting' as you showed force me to use two event cases with the same contents.

    I don't understand why you would need two event cases.. In this particular case we are only interested in checkboxes, and I expect these to be in switch mode, not latch..

    For latch mode your event code would be of no use anyway since reading/writing of the boolean value property is not possible. So, just wire the array of strict bool-refs to the RegEvents node and you can handle all switch booleans in one event case.

  9. QUOTE(tcplomp @ Sep 19 2007, 10:16 AM)

    I guess making the Value a variant is NI's way of saying: watch it, there's something special going on here.. You're actually not allowed to use the Value* properties for reading or writing a boolean that is in latch mode. If you try it, you'll get an error..

    QUOTE(tcplomp @ Sep 19 2007, 10:16 AM)

    I propose two have two boolean reference types:
    • Switch

    • Latch

    Ton

    Yes, that would be nice.. But as it is now, there's only one boolean object with an attribute that lets it behave in different modes (instead of using inheritance hierarchy of various boolean controls), thus only one reference..

    As a workaround to get strict types you could cast to a reference linked to one of the checkboxes like this:

    post-906-1190203262.gif?width=400

    You could also filter the array of controls by looking at the Mechanical Action (private) property to makes sure you only get refs to the right controls.

  10. Why go through all the hassle.. Just use the spacebar when your checkbox has focus..

    Besides the fact that you don't have to program it, it is more common user interface behaviour to use the spacebar for that.

    QUOTE(tcplomp @ Sep 19 2007, 08:01 AM)

    Does anyone know why I get a variant value for a boolean datatype?

    I guess it's because your boolean references are not strictly typed.. LabVIEW has no way of knowing whether the booleans you register dynamically have a mechanical action of switch or latch.

  11. QUOTE(dsaunders @ Sep 12 2007, 11:52 PM)

    Well, well... :unsure: I'm not doing too hot here. You are right. I didn't even notice the lack of coercion dot. Thanks for correcting this, and pointing out some new behavior for enums that I didn't know about. I do agree with jpdrolet, though, that it would be better documented in the code to put the correct enum constant down, rather than incrementing or decrementing.

    I knew something was bothering me about this. It works since, as Dave pointed out, it is really just casting an enum to the same enum. But I had tried to typecast a numeric to an enum before and it doesn't work. There is no error, and it compiles. But for some reason the enum output always goes to the default value (the first element).

    This is a classical problem.. It happens when you try to cast a number to an enum where their representations are not the same.

    E.g. trying to cast the output of 'Search 1D array' function (i32) to an enum (default u16) will always give you some unpredictable results (well, they are predictable I guess, but you'll have to do some bit-twiddling then..) unless you first convert the i32 to a u16.

  12. I've been doing OO development in LV for several years now with Endevo's GOOP2.

    I was very excited when I first heard of LVOOP coming to LV and toyed with it as soon as I got my hands on it. But it never went further than that..

    Reasons for me to not use them where:

    • Lack of proper tooling, I was actually used to saving time doing OO, not spending more.. :-)
    • Problems with build exe's, this is a HUGE problem since most of my customers require exe's. I was hoping this would be fixed in 8.5 but Jaegen's reply didn't sound to hopefull.
    • I need by-ref, I simply can't implement my oo-designs with just by-value classes.
    • I don't do an awfull lot of LVRT projects, but if I do I would like to use OO there too.

    Now most of these issues are taken care of by Endevo's GDS and one of the by-ref wrapper frameworks it supports, so it is highly likely I wil be using LV-classes next year.. :thumbup:

    But this all depends on the behaviour of classes in executables.. I hope to have time to do some internall testing so I can use it with confidence in a customer project.

  13. QUOTE(John Rouse @ Jun 22 2007, 06:48 PM)

    1) Create object (x)

    2) Use object (x) in VI(a) : ( VI(a) runs independently using object(x) methods to do some task )

    3) Start VI(b) : (ALso an independent process)

    4) Inside VI(b) obtain a valid reference to object (x)

    How to get this ref in VI(b) without a direct wire connection?

    You can name your objects..

    The private "New" method that is used in the Create method to construct the object has inputs Create method and Object name. Set the latter to some unique name for your object and set Create method to Create or lookup existing. This way a first call to the create method will create the object, but every subsequent call will return a reference to the existing object.

×
×
  • Create New...

Important Information

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