Jump to content

Neil Pate

Members
  • Posts

    1,156
  • Joined

  • Last visited

  • Days Won

    102

Posts posted by Neil Pate

  1. So my current framework is very "actor" based (home-rolled solution, yup "yet another actor framework"), but one thing my actors do not do is take care of the serialising of their own configuration information, instead this is handled by the System Config action engine.

    Now I think perhaps each actor should be responsible for the serialisation of its own config. However this could lead to trouble if they are all trying to write to the same file on disk at the same time, so I guess each actor needs its own config (ini type) file or other solution (a DB as proposed, which I am not that keen on as I am very much a fan of human readable config files).

    My plan was to extend my config action engine to include a user event for data change, and try and remove the global access out of each actor so that my actors (just a class), store the config in their own private data. I definitely do not want a message per parameter though, just a single event saying "config changed" but then I think this leads to more pain as the user event would either need to include the entire system configuration as its data, or I need to have an event per parameter? hmmmm...

     

  2. 1 hour ago, ShaunR said:

    If you can use a LV2Global to transfer information then it isn't a separate process-in the operating system sense. May seem pedantic, but it makes a huge difference to the solutions available.

    Anyway.....

    I think most people now use a messaging system of various flavours so it's usually a case of just registering for the message wherever you need it.

    Yeah, when I say process I do not really mean OS process, rather "free-running loop within the LabVIEW application context".

    I have messaging for a bunch of other stuff in my framework, just never got around to doing this for config type information.

  3. I am wondering how others implement the sharing of configuration information between processes.

    For example, I have a camera with an acquisition time specified by a user. This value is editable by the user during run-time and persisted to disk so next time the application starts it is used. The process doing the image acquisition is free-running, and the GUI doing the editing of this parameter is in another process. The technique I use to solve this is a bit old and rusty, namely an LV2 (actually Action Engine) with all the system config in it with methods to read and write from/to disk as well as set accessors for each of the variables. The acquisition actor just reads out the value as it needs it, but does not actually store it internally in its own process. I currently have no mechanism in my framework  for informing a process that a configuration value has changed. This works fine, but I wonder if others have gone the extra step and implemented configuration data using User Events and removing the global data store?

    In an actual system there will likely be significantly more configuration parameters.

     

  4. I read the node names from a file on disk, along with a description of their data type.

    This I use to set up the server, see attached.

    Note: I don't really have much OPC-UA experience, so cannot say if this is good or bad practice as I have done it. It works fine for my purposes though.

    The other frames of the case structure deal with the other possibilities, like Folder.Item etc

    Capture.PNG

  5. Ditto for me, I would be very sad if this place shut its doors.

    I think the audience here is very different to ni.com forums, and personally I do not like the community aspect there, it feels too distributed.

    If I have questions, which I still quite regularly do, this is where I am going to ask them.

    Put another way, lavag.org is one of the few sites I would gladly pay towards the cost of running, so thanks for everything Michael :-)

  6. I still must be doing something stupid, how do I actually made modifications to an existing (or a copy of) XNode?

    I can open the ability VIs fine, but they are locked.

    All I want to do is try and modify your XNode to make it accept a DVR to a variant rather than a plain variant. This is my first real foray into XNodes, so I am probably missing something obvious even though I have tried to read as much of the literature as I can.

  7. Off-topic indeed, but I would love to chat about it ;)

    I generally don't back up my "PC" i.e. the OS etc. I know I should, just never get around to it. All my dev stuff is in Bitbucket (so offsite) and a NAS on site. I try to not go more than a day without pushing my changes out to these backup sites. I use VMs for old versions of LabVIEW and for testing purposes.

    (Even more offtopic, I use CrashPlan offsite backup for my personal stuff like photos and videos etc)

    In London I was pretty happy with 150 Mbps broadband and still that is way to slow to regularly upload multi-gig VMs. I never got sophisticated enough to do things like rsync with my VMs, so they just ended up being stored locally on a big mechanical HDD. Now that I am living where broadband is not so good (1 Mbps) I really really cannot synch VMs.

    My question is just this; how do you synch your VMs offsite? Is there some clever stuff going on in OS X that does diffs and stuff to a VM container so it only uploads the small changes?

  8. Quite happy with it James... After NI patched the issue I mentioned in my first post that prevented proper authentication with name+password. I never got certificates working properly either, but this may have also been fixed by the patch.

     

    I have mainly used it as a client, and have production ready code stable with with approx 100 tags. I have created some proof of concept code to run the server side as well and it worked fine.

     

    My only issue is that the server does not allow to register for listeners, so you have to poll. I don't really know all the nuances of OPC-UA so perhaps this is normal, it just seems strange that the client can get periodic events (nicely handled in an event structure), but the server has to poll. 

     

    I am planning on using it in several more projects, it certainly seems to do everything I need and is much easier to integrate into your codebase than other OPC-UA toolkits.

    • Like 1
  9. Tried to install Vision again today, this time 2015 SP1 on a fresh installation of Win10 and same problem. Grrrr.

     

    Something is weird about my PC though, if I install the Intel LAN drivers I also get a hard crash  :angry:

     

    Edit: narrowed this down a bit, seems to be PXI Service Runtime 2015.  Is this even necessary for a "normal" PC?

  10. Very nice indeed  :beer_mug:

     

    I am thinking about using this in a project where I have to interface with some external equipment via OPC-UA and some other custom protocol. I have lots of "variables" (tags) and want to experiment how things can be done as much as possible by just using a channel name in my code rather than individual element access.

     

    Anybody given any thought as to how best to share the variant between processes? Lots of options here, as Kahrma mentioned perhaps a good technique is a DVR? 

  11. Yeah much of what I learned about .Net picture boxes, image resizing, z-layering, and transparencies in LabVIEW, stems from that one GDI Resize VI that I think started from here.

     

    http://forums.ni.com/t5/LabVIEW/Net-image-resize-how-to-convert-to-format-labview-can-use/m-p/2199022#M704093

     

    That spiked my curiosity and I've written several image library tools since then, which have been used in a few tools like my ribbon interface, that I never completed.

     

    Say one other thing I didn't think about, is that there is a vi.lib tool for turning a PNG stream of data, into LabVIEW data.  I think it is just a DLL call in the background but it might load the PNG in a slightly different way.  It is found at this path.

     

    <vi.lib>\wsapi\VIs\PNG Data to LV Image.vi"

     

    Ah yes, that is the same VI "GDI Resize" I am using now (Thanks Darin.K). Internally that VI does use the PNG Data to Lv Image.

     

    That solution works perfectly, I get a pixel perfect representation of my PNG file. 

  12. Chris, both images are the same size, the picture from the left is from paint .net, the one on the right are just the pixels represented by colourboxes.

     

    hooovahh, I think you are right. I actually found code on my PC very similar to what you linked to, and I tried this and it works perfectly.

     

    By the way, I also give credit and thanks to the author of the VI I found on my PC that I downloaded from lavag some time ago, it is called GDI Resize.vi

     

    So my conclusion is that something strange is happening in the PNG Read VI. I think I have peeked into it before and it is just a LabVIEW.exe function call wrapped?

  13. Hi All,

     

    I am getting some strange behaviour when using LV to read a PNG file.

     

    For reasons I cannot explain I get coloured pixels where I do not expect them. The attachment shows what I expect versus what LV is giving me. I have tried playing around with the transparency threshold input as a last resort but this does not seem to have too much effect.

     

    Any ideas? Any other tricks for reading a PNG file?

     

     

    post-7375-0-86560800-1456938088.png

  14. Hi Neil, do you know where I could find a simple example on how to start to combine labview and sdl to create something similar to https://plus.google.com/107942026210962154106/posts/9cZoas7UgLy ?

     

    Hi, sorry I just saw your post now.

     

    There is no tutorial I know that mixes LabVIEW and SDL. I basically used lazy foos SDL tutorial (http://lazyfoo.net/SDL_tutorials/) which are done in C, and just ported the logic to LabVIEW, wrapping the SDL DLL as needed.

×
×
  • Create New...

Important Information

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