Jump to content

asbo

Members
  • Posts

    1,256
  • Joined

  • Last visited

  • Days Won

    29

Posts posted by asbo

  1. This is just kind of a shot in the dark, but I would say that #1 is better for speed and #2 is better for memory. #1 only calls VTD once but does have to allocate the n-array buffer ned mentioned. #2 calls VTD many times but only allocates one array (and it can pre-allocate it, at that).

    Unless you're running on a P133, the speed difference is likely negligent. You can test this by passing in a very large cluster (1000+ elements) and see what kind of times the profiler gives you. Without knowing more about the cluster in question, I'm not sure which method I would choose.

    If you don't know, you can see where buffer allocations occur by going to Tools > Profile > Show Buffer Allocations.

  2. I believe that per NI, that "best" method is to use directly linked property nodes. I feel like this was a question on the CLAD or something.

    My preference would probably be Option 2, just because it's going to be much cleaner overall. I don't know why this is considered worse than using directly linked property nodes.

    While you may be able to get away with not closing your references (LabVIEW will probably garbage collect them of its own accord) it's absolutely best practice to close them yourself.

  3. QUOTE (dblk22vball @ May 1 2009, 12:01 PM)

    I am looking to increase the menu font so that it is easier for you to click on the menu easier.

    I don't know that there's any functionality for this in LabVIEW, but you can do it from the Windows (XP and below) side of things by going through Control Panel -> Display -> Settings tab -> Advanced button -> DPI field. About 200% or so look pretty touchscreen-able.

  4. QUOTE (jlokanis @ Apr 29 2009, 09:24 PM)

    2. The screenshot function no longer worked now that I changed the server to be run as a windows service. This is because it was not associated with any user who has a screen to render. So, this new version has the web service VI call out to any EXE that the user is running and runs the screen grab code in that user's app instance. The caveat is the user EXE must have the 'get local screenshot.vi' embedded and in memory so it can be used by the web service. I am open to better solutions to this if you have any.

    You can bind the service to a user account (instead of the default Local System Account) which should give you access without needed to include that VI ... but I've never had to configure service logons programmatically.

  5. If you have an initialization sequence/state of some sort, that would be a great place to just pre-fill the headers; unless you're not streaming data to the file per acquisition, in which case you can use Build Array to prefix your data array with a row of headers like crossrulz described.

  6. I see what you mean about the floating point; I suppose it would only really be useful for cases involving zero and having a floating point input. For example, (-inf,0] and (0,inf) - the second case would exclude zero - with an input of 0.01. Since it has to be typecast to be used by the case statement, will it be coerced to 0 or to 1? Obviously, my intention would be that it be coerced to 1.

    Maybe I should just change the suggestion to be "Use floating point in Case Statements" :P

  7. I looked around and was surprised to find this hasn't been mentioned anywhere. By default, you can create numeric ranges by setting the case to be, say, "..0" to include zero and any number less than zero. I think it'd be handy to have exclusive ranges as well. Yes, there was always alternate ways to implement the logic, but that can get messy. Can't come up with any good notation for it, though. Maybe "1.,10" is the same as [1,10)?

  8. What kind of table are you using that it takes a dynamic data input? A normal table takes a 2D string array. If you typecast both the numeric and the time stamp to strings, you can use a Build Array to create the proper input for the table.

    You may not actually need the cluster - your circumstances aren't very clear. You should probably post a screenshot of your VI.

  9. QUOTE (LVBeginner @ Apr 23 2009, 02:46 PM)

    How come I can do a GET on the first webpage, but when I'm trying to do a GET on the hermes server I get the error that my security policy denies me access. My IT guy has opened up ports for the hermes server but it still doesn't work.

    I think there's still some kind of configuration issue at hermes' end -- can you browse to the page in your browser? If so, you might have to fake a UserAgent header or the like. I get the security policy error you mention when trying to browse to the page, however.

  10. QUOTE (crelf @ Apr 22 2009, 06:24 PM)

    QUOTE (neBulus @ Apr 23 2009, 06:45 AM)

    In modern versions* of
    LV
    that is a waste of time. The for loop does that "for" you behind the scenes.

    In either case, I would leave it up to the developer to decide whether the data structure is large enough to necessitate that. If you keep giving out complete answers like that, crelf, you might find yourself out of work ...

  11. There are a couple ways you could do this with a single state machine - your choices are depend on your preference of Q's or string arrays. The important part, though, is to have two of whichever you prefer (or maybe even mix the two if you're feeling crazy). The idea is that one Q will manage the discrete steps and one will manage the automation steps. Initialize the discrete Q with Init or whatever initial preparations you need to do, then have your Default state be something to the tune of "DQ Next Automation Step". You'll need to have a few extra steps like "Start Voltage Loop" and "Next Voltage Loop", but doing it this way will let you have the opportunity to pause, change settings, whatever in between steps.

    If I have a chance later, I could build you an example of what I'm talking about, but I don't have any code ready which I can distribute.

  12. QUOTE (nitulandia @ Apr 17 2009, 11:33 AM)

    The function tries to rename the file. If the file is being used I get an error msg "access denied". I've pasted the function below, in case anyone is curious.

    Oh, DUH. I don't know why I didn't think of this - back in text-based programming, I would always just rename a file to itself (whatever.zip -> whatever.zip). It would fail if the file was locked and if it succeeded, I had no extra cleanup to do.

  13. It depends, I think, on the type of lock the other program has on it. There are normal locks and there are exclusive locks. In the latter case, you should indeed get an error when trying to open an exclusively locked file. However, I don't believe many programs use these. Try doing a read and see what happens as well. Maybe even try writing something to filesize+1 and then deleting it back out if it works.

    There's always mucking about in the Windows API - there's definitely a routine which will get you the information you want, as I've used several programs which enumerate the processes with a lock on a file. Of course, you could always try deleting it - if it works, you know for a fact it wasn't still being downloaded. :)

×
×
  • Create New...

Important Information

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