Jump to content

hooovahh

Moderators
  • Posts

    3,392
  • Joined

  • Last visited

  • Days Won

    284

Everything posted by hooovahh

  1. Okay I've come back with more, sorry about the wall of text. Attached is a new version with most of the core code unchanged but with several new features. Webpages and VIs that are the pages can have spaces in their name Webpage names come from the VI title if there is one Rectangle decorations now work properly Position and size can be updated periodically by using the config Decorations Can Change or using the Force Update (more on that later) Floating text decorations now work using the Text class Position and text can be updated periodically by using the config Decorations Can Change or using the Force Update, size and boldness are sent only on start at the moment Default Refresh Rate can be set with the config Show Border which is the size of the FP can be set with the config, no way of updating this at the moment but I think it should be able to be Synchronous Requests enable the web page to only request new data, once it has received a reply from the last request With this enabled the refresh rate can be set to 1ms without pilling up requests With this enabled if no request comes in once every 5s a reply is automatically sent, this is in case a request is lost and no reply sent, this is per connection Reduce Sent Data can be set with the config This will look at what data was sent for each object and not send it if the data hasn't changed. The code still has to get all the values and attributes but can help in places where there isn't much changing often. There is a separate list of objects, and what is sent, for each unique session. The first request from the web page is for full data in case things have changed since the time the HTML page was made All controls/indicators on the UI support being shown as an image. Controls that don't belong to a specific class will be defaulted to this mode A control that is an image cannot be interacted with in the web page, except for boolean controls When shown as an image, position, size, and visibility are also sent with each request along with the new image value New Value Only mode for all supported control types This will send just the value of the control for each supported type, position visibility and other properties will only be sent using the Force Update New Force Update function This is a VI that can be called from the main VI that will force objects whos references are passed in (or optionally all objects). This means controls can be sent as a Value Only mode in most situations, but then if a property does change on an object, it can be forced to send its new attributes. The example has been updated to have a button which shows and hides controls, and then an Update button that uses this Force Update function All controls support Visibility size and Position attributes which are sent on Force Update, or if the control is not Value Only This also will update any captions or labels on corresponding controls for visibility, position, and value Progress Bar now supports ranges that are negative, and that don't start at 0 Ranges can be updated if the control is not Value Only, or if Force Update is used Ring controls now can have the items in the drop down updated These are not updated if sent as Value Only, unless Force Update is used Picture Ring now supported On start each unique picture that the picture ring can be is stored as a variable in the JS file, and then the value is sent for which to display Code exists to try to detect duplicate Picture Rings, and only create one variable for each unique set of images, this also makes scanning faster Graphs now support up to two scales properly, but there is some kind of bug with multiple graphs not sure what it is yet String class now supports justification, background color including transparent, font color, font size, and boldness as attributes Captions, and Labels should work on controls now with some support for size External IP address can be set on Publish This is necessary if you want the web page to be accessible from somewhere other than localhost Default Control Behavior is available on Publish Here you can specify an array of control names that should default to Image Only, Value Only, or Value and Position This supports control names that start with a common string too Show Config Dialog on Publish If this is true, or if not all controls have been configured, then the dialog pops up to configure the page settings Config location moved into www directory Reorganization and cleanup Things I'd like to see some day, but I don't intend on working on this any time soon More native control support, things like path controls, tables, trees, listboxes, dials, scrollbars, picture boxes, and Combo boxes Support more graph tools like zooming, setting ranges, and changing other graph settings Support for tabs Support for right click menus if possible RT Support I think this one is possible, if the original static page is generated on the host, and the Value Only is used Multiple windows? Maybe by opening new windows with new URLs. Independent pages for each client Right now all clients share the same view of the same VI, it would be nice to be able to use a clone VI and have it generate new URLs and pages for each connection Better dynamic dispatch for creating the objects Right now adding a new control type is a bit of a pain because dynamic dispatch isn’t used for selecting the class type for a GObject. Doing this would mean just making a new class, and having it inherit from the control class Most VIs with no documentation, and some with the default icons, basically more documentation is needed VIPM Package could be made exposing just the 3 VIs needed, Publish, Force Update, and Cleanup FP Publisher Hooovahh Edit 2.zip
  2. I hadn't noticed any difference in the last couple of days, but my work connection is somewhat slow to begin with.
  3. Oh yeah I forgot about that toolkit. I tried it when it first came out, and realized the core of it was the code I already posted and figured I wouldn't need it. Sure the toolkit has other neat features that my code posted above, doesn't do, but for the most part I didn't need them. I remember some kind of quick color selection option where you could have a single image, and then swap selected colors for the other states of the button. Still not having the source code available makes it quite limiting when you want to automate, or pull pieces apart for your own needs. I think this used to be be a paid product but now appears free, I also don't remember the internet requirement when I used this before but maybe it was.
  4. You make some good points, but I don't completely agree: Ever been to a robotics competition? NI is pushing their stuff there for sure. Then there are the engineering colleges that offer LabVIEW courses for those that aren't CS/CE. I'm not blind to changes, but I'd hardly call it a demise, especially in my personal life in the surrounding job market where I got 3 job offers in the last 3 weeks, and I'm not talking about random Linkedin recruiter messages.
  5. There are plenty of online resources both free and paid for learning LabVIEW. NI Learning Center NI Getting Started -Hardware Basics -MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations) -LabVEW Basics -DAQ Application Tutorials -cRIO Developer's Guide Learn NI Training Resource Videos 6 Hour LabVIEW IntroductionSelf Paced training for studentsSelf Paced training beginner to advanced, SSP Required NI also periodically offers courses in LabVIEW. But the way I learn best, is to actually do the work. So having some projects that push the limits of your knowledge, and force you to do research is what I recommend. Short of shadowing someone who knows what they are doing.
  6. I have no sources but also have heard R&D mention how IPE for clusters just forces the compiler to do something, where using an unbundle modify bundle, will have the compiler do what it thinks is best, and in simple cases like this the compiler will choose to do the same thing as what the IPE would force it to do. The most recent thing I remember AQ saying is something along the lines of, tell the program what to do, and not how to do it, and the majority of the time you will be better off. There are of course cases where the compiler will choose to do something it thinks is better, but with some testing you can force the compiler to do something more efficient. On topic a bit, I do commend your implementation for not over engineering. Most of these improved error things I've seen involve many layers and layers of objects of objects with so much overhead I can't imagine using it. As others have said the ever growing arrays could be an issue, and I also share the comment that the most important part is the error being logged. In the past I also had a system where the last 4 states of the state machine would also be logged when an error happened, so you could see what states it when to leading up to the error.
  7. Sure thing, I had to clean it up a bit but here it is. Attached is some code that I originally found in this thread showing how to read the contents of a control file, and replace a section with a new PNG. I think one caveat is the PNG that is being replaced needs to be larger (in file size) than the new PNG but in my tests I haven't seen an issue. https://decibel.ni.com/content/thread/4901 Extract the attached code, and run the Replace Button Decals\Create Multiple Controls From PNGs.vi It should set the control values on first run to paths relative to the running VI to use the example images and controls included. It will make a control for each PNG in the directory chosen. This will replace the decal, the VI Icon, change the label, the button text, and VI title so that it can be packaged up with VIPM nicely. I also included a VI to extract images from controls. Create Multiple Controls From PNGs.zip
  8. Well the community thanks you for your effort. In the past I could automate replacing button decals with ones from other PNG files. So I was at one point able to just script out a few hundred system buttons, with glyphs from an open library. This worked out well enough, but I still ended up having to do some manual manipulation of every control.
  9. I did not know that this was a semi-standard, but I think the majority of the time I have used checkboxes it was in this type of UI.
  10. I've had issues with switch controls like these in the past with users who aren't exactly sure what the states of the switch are the first time they use it. I don't want to say it is unintuitive, it is just one of those things you need to some times learn the first time. Don't get me wrong I like the look of the flat controls you've shared and I can see using them, but I can already hear some of my users when they see the switch the first time, and see the text "OFF" they will ask, "Does clicking this turn it off or is it off right now?" As soon as you've seen the two states of the button it is quite clear which is ON and which is OFF As a result I generally try to use system checkboxes, radio buttons (with two states with text for each), or a drop down, like a system enum.
  11. Yeah using the original cable, and using no extensions is a good test to see if it works in any situation. You shouldn't have to have a work around, but if there isn't any other option, you can try to capture the error seen when the device is disconnected, then have your code retry to connect to the hardware with some amount of timeout so that if it goes away for a short time you can recover. This is of course only if the DAQ you are trying to measure isn't a continuous signal in which case the only solution is to not disconnect in the first place. Some NI USB devices have firmware updates, is this one of them? You can go into MAX, find the hardware, and there usually is a tab or button for updating the firmware. Have you tried other USB ports? They aren't all equal and some have less internal hubs than others. Have you seen this type of issue on any other computer? It is possible the device is faulty.
  12. Not quite. So the VI macro works like the XNode (cause it is) where an input can have the ability to become any data type, then the type propagation within the VI will go through all the primitives inside, or polymorphic types, or whatever just like it does when you change the type on a wire in a normal VI. The output changes based on the input, in almost all situations, the reverse is not true. When you wire the output of an XNode the inputs don't change. The only exception I know of is with a few XNodes like my Variant Repository, which will look up stream when you wire an output, and then attempt to change the output to be the type that it is wired to. Another exception to this is the variant to data, where in some rare cases it will change the output based on what is wired to it, and the Type input can be left unwired. I would not expect this new structure to work this way. I suspect it just looks at the inputs and sees which cases cause no broken wires, then changes the outputs as needed. BTW can't wait for 2016 now, along with a few other beta features that will finally be given the attention they need.
  13. I'm not NI, and this is slightly off topic, but in the past NI's answer has been that technical limitations came up when with the licensing of XNodes for public use which caused NI to stop looking into making it open. It sounded like NI (or some within NI) saw that this was a niche group of developers that would want this, and figured it wouldn't hurt to open it up, but ran into issues which were not easily overcome. With little reason to continue looking into fixing these issues, and with such a small group of developers who would use it, it sounded like NI wanted to invest in other areas instead. Being part of this small group I certainly am not happy with the decision and hope it changes, but understand why NI hasn't continued to work on opening it up as far as I know.
  14. Again I never got around to implementing it, but I assumed the reason for having the double buffer size, was because you would then never need to perform a shift, which is where I thought the more intensive operation would be. By having a double buffer size I can perform a read and just have it read the subset of N samples that I want continuously, but of course to to do this a single write has to write to both halves of the buffer, but again no shift is needed. The method you described is close to what is currently implemented (in the non-xnode version posted), where there is one buffer, but it won't shift data, it will write it, and then if it gets to the end of the buffer, write again at point starting at 0. This means no shifting and no double writing unless you reach the end of the buffer. The trade off is that when you do a read you need to shift the data, if the subset you are trying to read wraps around the buffer, if it doesn't no shift takes place. Since the shifting was taking place anyway on some reads, I had the read function write the shifted data back, so the next write starts at pointer 0 again. These are the 3 implementations I've thought about with minor details changing how it is done under the hood, causing different performance. As I mentioned before the current implementation is probably better than most if you are writing more often then you are reading, which was my case when I was needing this. I never did any bench marking between these three.
  15. I'd also suggest you wire directly to the PC. Using any hubs powered or unpowered is asking for trouble.
  16. I went looking into the 2016 beta I had and I couldn't find this. Is this a thing that isn't in the beta but is intended to be in the 2016 release?
  17. Other than the discussion mentioned, where you can load the LabVIEW OS (Pharlap?) in VirtualBox, there has been no new progress. This would be a very cool thing to have, but my I wouldn't know where to start. If you make any progress on this be sure and update this thread, or the one linked to the following thread.
  18. Yeah I like that. It could fix several things I've been thinking about, like what if you want to adapt an input to a 1D of any kind of data, but it must be a 1D array? Then you could have a case where you wire your input into a Search 1D array, which would break if a 1D wasn't wired. Not sure how this would work for performance performing a task with a primitive, whos output isn't used. The compiler might optimize away code and do strange things. Want to ensure only a cluster is wired? Wire that input to an unbundle function. Want a 2D of something? Wire to a transpose. Still there are times when I want more complicated checks, like the input is a cluster, and one of elements is a numeric, and has a label of XYZ, but I guess that's when XNodes could come in.
  19. So usually this is where I mention that discussing the beta material on the forums is against NI's NDA, and how you probably shouldn't talk about it. But in this case I'll let it go for more than one reason. Welcome to the forums. Can't wait to play around with the expanded VIMs in 2016 that feature does sound useful. If you are reading LAVA's discussions about VIMs I hope that you've realized one of the key features we'd like documented, is how to force a control to be a defined type, and not always adapt to type. I see that code for this has been started in the VIM XNode but doesn't appear to be complete, and relies on arrays of strings on the front panel labeled something specific. I'd suggest adopting what has been used on the right click frame work, assuming NI has gotten good feedback. Here you can have a control defining the types that an input can become, or choose it to be the one type it is in the template, or choose it to adapt to any type. The configuration of this matters much less to me, than the fact that it actually works. I'm not a fan of having to jump through hoops to get things to work, but I am grateful when those hoops exist.
  20. Sure thing, attached is my Post-Install. It will look at all MNU files installed, and look for any files that share the same name as the XNode, and replace them in the palette, with the actual XNode call. I add a suffix to installed VI files so my Post-Install only looks at the name before the _ suffix, because the suffix isn't added to XNodes by VIPM. It has a few OpenG dependencies, so if you are making a package be sure and add those to the dependencies list, so that they will be installed before trying to run the Post-Install VI. Oh and you'll want to open it and resave it, I back saved to 2012 and assume paths to the OpenG library might be messed up. As for the reply, some of the abilities describe being able to be called, here is the description for the GetTerms4 ability: But as for a formalized list, I just don't have one. Here are a few other string values I've seen put into the Reply and have things get called. UpdateImageAndBounds, UpdateTerms, GenerateCode, Initialize, this list just comes from seeing what others have done. Post-Install Custom Action Replace XNodes in MNU.vi
  21. You should never use the abort execution button, unless you have to. Pulling the rug from under any application is a bad idea and you should allow it to perform the cleanup operations that the developer made for it. Many times in the LabVIEW world it has been said that using the abort button is like crashing your car into a tree to stop it. It will stop the car, but it may have other consequences. The more proper way to exit is to hit the red X in the upper right corner of the window, but of course for that to work the developer needs to add the Panel Close? event to an event structure, and then cause the code to perform the cleanup that pressing the stop button would have done. In this example this wasn't done because it is just an example and not a full application. As for your other question, the last time I needed to upload a website for free I used comlu which is apparently hosted through this site: https://www.000webhost.com/features They have FTP and other basic features, but there is no way you will be able to install the LabVIEW run time engine and various other tools to make this work from there. If you need to have a site that is driven by this technology, you are either going to pay for full access to a VM, or make your own VM and run a web server from it. I think this tool primarily can be useful from within a network, where a computer with a static IP in the corporate network can just serve pages for access within the network.
  22. You actually can put an XNode directly on the palette. Look at the Add-ons >> Find LabVIEW Add-ons which on first being created will open up a web page. A fun little trick that you can use to do something to do all sorts of things on first copy. I have one function that can open a folder to a network location where some specialized documentation is stored. When you are editing the palette manually, you just need to change the filter on the browse dialog to show all files (*.*) and select an XNode and it works as it should. For VIPM there are a few tricks, but the best I've come up with is a using the Post-Install action VI. In the Post Install you can see what VIs were added to the palette, so I will search for any XNodes, then see if a merge VI was made for that XNode (just the same name but different extension), then read the functions palette, replace the path of the merge VI with the path to the XNode, and then resave the functions palette I opened. A bit of a pain for sure, but once you have it working the updating or adding new XNodes can be done just by making a merge VI, and adding it to the palette, then the Post Install does the rest. But for your situation I wonder if the Copy ability will work just as well, where the dialog is seen on the creation of the XNode instance.
  23. The Webservices dependency has been removed. All that is needed is to run the Example.vi, then open the Example.html in a web browser, I've been using chrome because of the awesome page debug and inspect features. Because of this it might be possible to use this on an RT system as well, you just might have to generate the HTML, and JS files from a host.
  24. That's the only downside I can think of is the thread swapping/performance. Still not sure why it works this way, it could be a bug, I'd post on the NI forums and see if you get the attention of someone at NI.
  25. Wow that is strange. So all methods to try to get this information out of the New Value, is going to fail because that information simply isn't there for some reason. OpenG has a few methods, and NI has newer Variant functions in 2015 and those also won't work. There is also a few methods to disconnect type defs but that doesn't seem to help. One method that does work, but might not be desired is to use the control reference in the event, then go to a property node and read the Value then get the name from this. I'd recommend getting the name the way you currently have, and then use this method if the name is empty. You can also use another function to determine if the variant is a type def, and if it is then use the property node method.
×
×
  • Create New...

Important Information

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