Jump to content

Neil Pate

Members
  • Posts

    1,156
  • Joined

  • Last visited

  • Days Won

    102

Posts posted by Neil Pate

  1. Didn’t you already have that problem?  If your “Do Action A” event sends a “UI—>CTRL:Do Action A” message to your second loop, nothing will actually happen till it finishes with “Somebody->CTRL:Do Long Running Action B”.

     

    Bingo! It just took me a bit of time to realise it :-)    

     

    For a long time I resisted putting everything in a single loop as having the Event Structure in a separate loop kinda fools you into thinking you can respond quickly to events, but you cannot really as you say because the lower loop is tied up doing something else. 

  2. I routinely use User Events to receive messages in anything that is a UI component, and often in things that aren’t a UI component (so I can give them a ‘debug’ UI if needed).  To me, the topmost loop you have is redundant; it does nothing other than stream the Event Queue into the Message Queue, with no ability to do any actual work (since it doesn’t have access to any state information) and it requires you to write lots of extra build-and-parse message code.  Pointless.

     

    Pretty much all of my existing code used this two loop structure per module as well, but I have recently seen the light (drunk the kool-aid?) and swapped over to a single loop with the Event Structure just as one "step" of the module (now I like to call them Actors ;-)  .. Takes a bit of thinking about as any long running processes (i.e. stuff happening in another diagram) can really scupper things, so now you need to do things like spawn off workers etc.

  3. How big are the images you are writing to disk? I would have thought that the bottleneck in most systems would be the speed of physically writing to disk, not the passing around of the data in the software. Modern CPUs/RAM can shovel ridiculous quantities of data around if the software is architectured properly.

  4. Dequeue with -1 timeout should use virtually zero of your CPU resources. You can rely on this mechanism on RT the same as your do on the PC. 

     

    RT-FIFOs do have the option where read and writes are polling (using CPU) or blocking (CPU sleeping), but as you state you are using queues and not RT-FIFOs then this does not apply to your application.

     

    Is it possible that perhaps something else is going on that periodically causes a big CPU spike? If it is a quick event you may not notice it in your CPU profiling code, but some other bit of code may be affected.

     

    The other culprit could be timed loops. Are you using any?

  5. This is good to know about. I use Ultramon so am surprised I have never seen this issue.

     

    As you said in the other thread hooovahh, I do not know how people manage to develop large applications in LabVIEW without tremendous quantities of display pixels. The more the merrier for me these days. I have a 19" vertically oriented monitor on the left dedicated to any open .lvproj windows, a 27" to the right of that (so in the middle), and another 19" to the right of that and still wish I had more space at times! 

  6. I would consider modifying the current path (CWD) to achieve this not only hacky

     

    Totally agree with you, but...

     

     

    That's admittingly a small time window,

     

    Very very small probably if you set the CWD immediately before calling the DLL function.

     

    I suppose deciding whether to use this function or not depends an awful lot on the risk of something going wrong combined with the likelihood of it happening. 

  7. No.

    What you are describing is merely prepending a sub domain name. Whilst sometimes people put a proxy on a sub domain, it's not a requirement. Besides, you may need to authenticate with the proxy.

     

    Under normal conditions, the GET request URI is usually a relative path (doesn't have to be but is usually the case) and the HOST field of the HTTP header contains the domain of the target page. It's is slightly different with a Proxy.

     

    The GET URI is the full URI of the target page (including the http:// and the domain name of the target page). The HOST field is the domain name of the proxy server and you connect to the proxy server, not the server that has the page.

     

    A proxy may also require authentication and these parameters are also sent in the HTTP header fields (see section 2).

     

    I don't believe any of the LabVIEW web oriented VIs support Forwarding Proxies (the sort I think you are describing) out of the box. I may be wrong and they added them in later versions, but  I haven't come across any. You might try Rolfs HTTP VIs, I can't remember off-hand if they support proxies and the OpenG site is down ATM so can't check, Apart from that I expect you will have to hand craft these headers and handle the responses the old fashioned way (and you will be stuffed if it is SSL/TLS).

     

    Thanks for the insight Shaun. I do recall seeing Rolf's HTTP VIs, and this is what in fact lead me to believe I could just prepend the proxy, but probably I just misunderstood. I don't really know enough about this stuff so I guess it is time to learn something!

  8. Hi All,

     

    I have an application which uses a Web Service to talk to a LabVIEW based server, somewhere on the internet. The application works very well under normal circumstances, but I am having some trouble getting any comms through for one particular customer. The difference for this customer is that I know they use a proxy server for all web traffic. I have not had much exposure to proxy servers, but my understanding is that if I just prepend the proxy server IP address (or name) to the "address" of any http type requests everything should work fine.

     

    So in other words, if I normally call http://mywebservice/testmethod then to get this to work with a proxy server I would just need to re-direct my request to http://myproxyserver/mywebservice/testmethod

     

    Is this correct? If so there must be something else going on as I have tried this and still cannot get any comms going. The IT guy I am working with says none of the requests even get to the proxy server.

     

    Has anybody done any work with Web Services and proxy servers?

     

     

  9. However, working code is a better yard-stick for coding competence 

     

    Definitely have to disagree with you here.

     

     

     and that's what employers want.

    depends... do they want something quick and dirty that will help them right now, or something with more thought (and probably neater) that will probably serve them better in the long run. Different clients have different requirements.

     

    Anyway. I am not really moaning or anything. If I fail it due to missing functionality then next time I just better not take the five pee breaks I needed this time around  :lol:

    • Like 1
  10. Do you guys know if Inno Setup has an easy way to install prerequisites, like the LabVIEW Run-Time Engine? My fallback plan was to make a "base installer package" that will install the RTE through LabVIEW's builder profile. Then have another installer for my program.

     

    It's annoying, but it would only be a two-step process that first time. After that, I think people can just go directly to my latest installer for upgrades.

     

    You can get the Inno setup to execute another application as part of the setup, in the example pasted below I execute the RTE setup exe. Note I have manually extracted the RTE so that it consists of its bits and pieces. You also have to tell Inno to include the files in the setup (that is the [Files] section)

    
    
    [Files]
    Source: "C:YOURPROJECTNAMEResourcesInstallerLVRTE_Extracted*"; DestDir: "{tmp}LVRTE_Extracted"; Flags: recursesubdirs createallsubdirs

     

    [Run] Filename: "{tmp}LVRTE_Extractedsetup.exe"; Parameters: "/q /AcceptLicenses yes /r /disableNotificationCheck"; WorkingDir: "{tmp}LVRTE_extracted"; Flags: waituntilterminated; StatusMsg: "Installing LabVIEW Run-Time Engine"

     

     

  11. I think perhaps the design, style and documentation should be worth more. I have a pretty high level of coding standard (i.e. block diagram neatness, comments etc) that I always try and aim for. This is ingrained in me after more than 15000 hours of doing LabVIEW. As such, it is very difficult to override this instinct and code "messily" just to try and get all the functionality in.

  12. Glad that helped you. I also prefer the fact that it creates a single setup.exe file, rather than the way the NI installer creation creations (I think) .msi 

     

    Inno setup makes it quite easy to run other things as well as part of the setup, so you can install (for example) .net or the LabVIEW runtime etc.

  13. Wow, interesting program! I downloaded it and am looking through the documentation/examples. I'll give it a try tonight! Any "gotchas" I should be aware of? It looks like I can modify some of the example files and run them from the same directory as my built application.

     

    I use Inno Script Studio to generate the actual installer. There is nothing I can actually think of that caught me out, other than it just took some time to figure everything out (like admin rights, banner graphics, unlocking directories etc).

    • Like 1
  14. Mike, not sure if this will help you, but if you add

     

    NI_Appbuilder_logging=TRUE

     

    to your LabVIEW.ini file then you will get a comprehensive build log for your .exes and installers. If your installer is failing to build just scroll down to the last line and see if there is a more verbose error message there.

     

    The log file is in the same directory as the .lvproj

    • Like 1
  15. Hi Lewis,

     

    I am also taking my CLED next Tuesday (you taking yours in Newbury, right?) and will probably not be using the sample projects, although I may borrow bits and pieces.

     

    You are probably right in that the exam will be quite a close match to the sample project, but I think you would have to spend too much time modifying it to meet the new requirements.

×
×
  • Create New...

Important Information

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