Jump to content

eaolson

Members
  • Posts

    261
  • Joined

  • Last visited

Posts posted by eaolson

  1. Over at some other thread, crelf said, " I strongly suggest that this topic go to a new thread." And, lo, there was a new thread.

    So when is it a good and bad idea to use a sequence structure? Should they be banned outright? Even removed from the language? Personally, I think they should be discouraged, are often bad style, but are occasionally necessary.

    Just the other day, I wrote this:

    post-3014-1219330924.png?width=400

    I genuinely don't see any way to guarantee proper execution order without the sequence structure. I usually find the only time I ever use them is when I'm using a LabVIEW node where I can't enforce data flow any other way, e.g. with Wait.

  2. QUOTE (Norm Kirchner @ Aug 20 2008, 01:17 PM)

    oh.... well that works too I guess... almost

    almost... because i'm not sure how to interpret the decimal notation...so I have to convert back

    Also I guess my previous implementation is giving me someone else IP address.

    Very strange.

    I notice that 174.24.0.120 is in a block of reserved IP addresses. Is your computer part of a private network or anything?

    I didn't know about the Resolve Machine Alias node until now, either. However, I can't get it to give me anything other than an invalid input error. How is it supposed to work? The help page is distinctly unhelpful.

  3. QUOTE (normandinf @ Aug 19 2008, 03:27 PM)

    For any inappropriate questions one might want to ask, you can get the answers without asking. All you really need is check out Google, Facebook or MySpace. :P

    I happen to have a fairly common first name / last name combination. Common enough that, when I went to college, I wound up sharing a mailbox with someone with the exact same first and last name because no one else could tell our mail apart. A few months ago I Googled myself just to see what would happen. I came across some postings by someone with the same user name as me in a couple of corners of USENET that are, shall we say, less than entirely family-friendly. I'm a bit worried that's going to cause a problem for me someday.

    Anyway, the original topic of this thread is around here somewhere...

  4. QUOTE (LV_FPGA_SE @ Aug 19 2008, 01:33 PM)

    You are correct, but if this is the case then you should ask the candidate what they can or cannot do, not if they are married or not. You can not assume that just because they are married they can't travel overseas for two weeks.

    And vice versa. You might wind up hiring a single person that can't travel easily because she cares for her elderly mother or something.

    QUOTE (crelf)

    Innappropriate, and (at least in the USA) I think asking marital status is illegal.

    That was my understanding, too. I've just been on a few interviews lately and it's been asked in just about every one.

  5. QUOTE (crelf @ Aug 19 2008, 09:24 AM)

    That's a terrifically horrible question, and frankly none of the interviewer's business - I'd consider a question like that borderline discrimination.

    I agree that it's a horrible question, but disagree that it's likely discriminatory. Inappropriate, perhaps, as I think questions about an interviewee's personal life tend to be. If your family is well enough off and/or you went to an inexpensive enough school that your family could pay for it, well, should that really reflect badly on you?

    Not intending to threadjack, but ... asking an interviewee if he/she is married. Appropriate or inappropriate?

  6. QUOTE (Tom Bress @ Aug 13 2008, 03:58 PM)

    If you are a lone wolf then I would recommend the edit-merge. Since you are the only one working on a given file, you'll never have to merge and you'll avoid having to check files in and out. Why check them in and out if you are the only one working on them?

    I, too, am a lone wolf. I've been using SVN and TortoiseSVN for a couple of years now and wonder how I ever lived without it. I'm just not quite clear on the difference between edit-merge and check-in/check-out. Could someone explain a bit?

  7. QUOTE (Justin Goeres @ Aug 12 2008, 06:30 PM)

    Pretty compelling evidence!

    Stuff like this just makes me sad. It seems to be a combination of basic scientific ignorance, combined with the general anti-intellectualism in our culture, with a healthy dose of paranoid schizophrenia thrown in. It's kind of why I wish people would stop responding to alfa in the 5th Dimension thread. Mental illness ain't funny.

  8. QUOTE (shoneill @ Aug 11 2008, 10:06 AM)

    You may talk about them that way, but they're not stored that way.

    Even the old BMP format stores a collection of rows to generate a 2D picture.

    True, but it seems to me that the API is more important than the internal storage mechanism. You've got:

    • Java's BufferedImage.getRGB(int x, int y)
    • ImageJ's ImagePlus.getPixel(int x, int y)
    • ImageMagick's MagickGetImagePixelColor(... long x,long y, ...)

    I wonder if the discrepancies here are due to thinking about arrays in terms of matrices (row, col) vs. Cartesian coordinates (x,y).

    Matlab actually does store arrays in column-wise format, for some reason.

  9. QUOTE (mross @ Aug 8 2008, 12:56 PM)

    This is a secret English usage trick: We say in mathematics and other places ",Row Column notation." In almost any instance where there is a two dimensional matrix under discussion rows are discussed first, then columns.

    And yet almost any time you're talking about an index of pixels for an image, they're in (x,y) coordinates, which is really (col, row). That one bites me almost every time. I've seen different packages use (0,0) for the bottom-left or the upper-left pixel, too.

  10. QUOTE (Aristos Queue @ Aug 11 2008, 08:42 AM)

    We've talked about removing the "index" tab now that the search tab is more efficient. It's sort of the difference between Yahoo and Google -- a human generated index of keywords only works if your mind works the same as the particular human that generated the index. The search will find all the words used in the text. Now that we have a better "page rank" system for the results, the search tab should generally be more helpful than the index.

    Maybe it's just because my mind does actually work the same as that particular human, but I find the opposite to be true. Mostly because the search tab searches on every word you typed in, without regards to context, and searches every possible form of the words you used (format, formatting, formatter, etc.) It almost always finds a bunch of property pages for something unrelated to what I want. Example: search on "format specifier" or "error code" and your search results aren't very useful.

  11. QUOTE (BobHamburger @ Aug 5 2008, 10:52 PM)

    Darn useful. Two quick questions:

    1. Why the conditional disable structure? Are there targets for which the Tick Count VI isn't valid?
    2. Shouldn't the indicator really be outside the loop? I ask not because I suspect it would impact performance, but because I'm just not really clear when putting indicators and controls in a loop does or doesn't.

  12. QUOTE (crelf @ Jul 29 2008, 11:00 AM)

    Agreed, I do this a lot too, mostly when I need to insert something I forgot between two other elements.

    I especially don't like the idea of having to worry about, not only what I click on, but from what direction the mouse approaches the thing I'm connecting it to. Maybe I'm just a bad mouser, but having to worry about whether I'm clicking two pixels above or two pixels below where I want to click would drive me nuts. (I'd hate those mouse touch-surfaces even more than I do now.) What happens if you connect the wire at a bend?

  13. QUOTE (Xrockyman @ Jul 29 2008, 11:09 AM)

    Imagine that 'y' values for example represents temperature of something, and my 'x' axis represent time in hours. If for example now are 4H the axe 'x' for the last 6 hours will be 22, 23, 0, 1, 2 ,3, . Labview attributed the points correctly but reordered the 'x'.

    LabVIEW did not reorder anything. Your points are correctly plotted at (22,4) (25,3) (0, 2) (1, 36), etc. If you look at where the points on your graph are location, you will see they are indeed at those (x,y) coordinates, just as you told LabVIEW to do.

    I suspect your complaint is that the lines connecting the points are drawn unexpectedly. You probably want the lines to connect the points in ascending x-axis order. LabVIEW is connecting the points in the order that the array is in. Right now, your lowest x-axis coordinate is on point #3, so you have a line connecting point #2 (x=25) with point #3 (x=0). You need to sort your array over the x-coordinate.

    If that's not your intent, you need to describe your problem better.

  14. The one that annoys me the most is that, when you paste a local variable onto a block diagram, LabVIEW instead creates a new control/indicator and pastes in a local variable for that, instead of the original. It's "copy and paste," not "copy and paste in something kinda similar." The location of the new terminal isn't predictable, often winds up halfway across the diagram, and resizes any loops that are set to Auto-Grow.

    What I always wind up doing is undoing the paste, control-dragging the local to some free area of the diagram, and dragging it into position.

  15. QUOTE (Yair @ Jul 24 2008, 12:00 PM)

    Inherent problem, no. But I have seen people saying basically that it's bad style.

    QUOTE

    The problems come if you have two in the same loop (bad, since they can block) or when you handle filter events in more than one without knowing how they work or when you use the same dynamic event registration refnum in both structures, etc.

    I don't use dynamic events a whole lot, so I wasn't aware of that last issue (or had forgotten about it) until just now. It's just obscure enough, and kind of buried in the Help, that I think it warrants repeating: Each event structure must have it's own Register For Events node. Craig S. explains why here.

  16. QUOTE (Daklu @ Jul 24 2008, 08:39 AM)

    Yes, but somebody still has to monitor the notification to see when it occurs. So wouldn't I either have to check for the notification with every iteration of my main processing loop or have a separate loop dedicated to checking the notifier? Note the dynamic vi will be started and stopped several times during a test and Main.vi needs to continue running in parallel to the data collection.

    Yes, either you'll have to have something use Preview Notifier and poll every so often, or have a separate thread/loop with a WON node. Depending on what you're doing with the data, the event method may be a good way to go.

    I know it's generally considered bad form (and can be problematic) to have more than one Event Structure. Is that still the case if you segregate one event structure handling UI events and another handling data-driven user events? Depending on what you do with the data and what your data collection rate is, I wonder if mixing the two could lead to the front panel seeming sluggish.

  17. QUOTE (Daklu @ Jul 23 2008, 12:31 PM)

    I have a Toaster class that reads data from a serial port. The methods I have (among others) to retrieve data are Start, Stop, and Read Buffer. Start will spawn a vi that continuously captures data and puts it in an array. Stop (obviously) stops the data capture process. Read Buffer retrieves the data that is in the buffer. For these methods I don't think I'll need a notifier as the main vi tells the spawned vi to stop.

    It seems to me that this may be susceptible to race conditions. It sounds like you might have this sort of thing going on:

    1. You run Start to begin data acquisition, which spawns a separate thread. That thread runs for a while.

    2. You run Stop to tell the separate thread (the dynamic VI) to stop running. How does the dynamic VI know when to stop?

    3. The dynamic VI notices that it's been told to stop, and actually stops.

    4. You then read the value of the control on the dynamic VI via Get Control Value.

    The problem is that after #2, you may not have anything in place to make sure #3 happens before #4. It could happen the other way around, depending on the whims of the thread scheduling system.

    QUOTE

    I also have "Read n" and "Read t" methods that captures n data packets and captures packets for t time respectively. These would benefit from the notifier I think.

    If you're retrieving N data points, rather than just one, you could also look into using a queue instead of a notifier. A notifier handles one element, a queue handles many.

    QUOTE

    For this to work wouldn't I need to have a separate loop in the main vi dedicated to waiting for the notifier?

    Depends on exactly how you do it. The Wait on Notification node blocks until it receives a notification or (optionally) until it times out. You can also use the Preview Notifier node to check to see if a notification has been sent yet.

    QUOTE

    Since my implementation is in a class, I don't have a main vi in my class to monitor the notification from the dynamic vi.

    That's exactly what the Wait on Notification node does: monitors a notification.

    QUOTE

    Isn't this resolved by putting the indicator in the data collection loop where it is continuously updated?

    True. You could continuously keep the control in the dynamic VI up-to-date and grab its value using the Get Control Value method. That may have a significant speed impact. Property nodes run in the UI thread, so they are slow. I'm not sure if Invoke nodes run the same way. Note that you'll also have to manually convert the output from a variant to the correct data type. Notifiers and queues know the correct data type and do that for you. Again, you'll have to beware race conditions to make sure your dynamic VI is in the state that you think it's in.

  18. QUOTE (normandinf @ Jul 22 2008, 07:34 PM)

    You can use the method "Get Control Value" to recuperate a certain value from your dynamically loaded VI. Wire the label name of your control/indicator to get a Variant of its current value.

    The problem with that is the indicator won't be updated until the dynamic VI finishes and you're not exactly sure when that will be. So Get Control Value may return the initial value or the final value depending on when you call it.

    I would suggest using a notifier to pass out the value that you want. You need to give the dynamic VI the notifier, which adds an extra step, have the dynamic VI put the correct value in the notifier, then just wait in the top level VI for the notifier to be populated with a value.

  19. QUOTE (Norm Kirchner @ Jul 16 2008, 04:05 PM)

    How do you determine what sub-vi is missing because OpenVI Ref only says that "a" vi is missing?

    Interesting question. I didn't notice this before, but if you just use Open VI Ref with a path to the plugin VI, you won't get an error. If you wire a type specifier to create a strictly typed VI refnum, you do get error 1003 when you try to load the plugin VI. In the first case, you get a valid refnum, but the Callee's Names property does not contain the name of the missing VI. Same with Callee's Paths. In the second case, you do not get a valid refnum, so you can't use the property node.

    If there is a solution (other than walking through the VI as a binary file and looking for subVIs), I'm stumped.

×
×
  • Create New...

Important Information

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