Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/18/2018 in all areas

  1. A little while ago I posted some code on how to create boolean controls with images that scale well because the images are vector based and can scale up or down better than a static image like a PNG. After making that I made a utility that allows for selecting an image, and a control template and it creates the control. I showed this off to Danielle Hamburger and she encouraged me to clean it up and post it to the community. I'm still putting this in the In Development section just because there are several external tools needed that working around would be ideal if this were to be finished but for now it works and I use it often. So it works like you'd think. There is a library of vector images you select from, pick the one you want, then pick the Control Type (which is a folder of CTLs), then click create and it creates the control setting the decal button, VI description (adding License text if needed) and sets the icon editor icon. Dependencies If you just run the Vector Boolean Control Creator you'll need OpenG Time, OpenG File, and the JKI State Machine toolkit installed in LabVIEW 2015 or newer. The included libraries will work without anything else as long as you are in Windows (more on that later). If you want to include your own controls there are a few more steps and I left a text file explaining that in the Template Controls folder, but I included several already. If you want to add your own images I also left instructions in the Libraries folder. I wrote a VI that can convert from SVGs to the needed PNG and EMF files as long as you download inkscape (again instruction text files included). But inkscape is only a dependency if you want to use that utility to add your own libraries which are in SVG. Demo For good measure I made a Jing video showing how it works. Windows Only... So the Windows only part is an interesting one. I started with my UI being just a single 2D picture control and as you type your search in the top, it would go and open each image that matched the result, shift them into rows and columns, detect the number of columns shown, then detect and show mouse selection, and all the other stuff that would be needed. To say the least it was slow. I tried several ways to improve it, but in the end it was slow and I couldn't come up with a solution I liked. I could have added a search button but I really like the live search of typing it in and seeing it update as you type just like the icon editor glyphs do. So for a first release I went with the cheap and hacky solution and that was to leverage some .Net to embed a Windows Explorer window into my front panel, which is just the search results of a folder on disk. This now means you see the PNG images on the front panel, but it will only use that to show the UI to you, but then use the vector based EMF file when creating the control. Doing the search was a bit weird too since I couldn't figure out how invoke a search with the Explorer .Net so instead I wrote to a temp location a saved search that is XML, which I tell the UI to navigate to which then shows the search results. Oh and there is some .Net GDI resize going on so the PNG image is used as icon editor icon for the control but dependency could likely be removed with some G work. Anyway hope people find this useful. Vector Boolean Creator.zip
    1 point
  2. Depending on the LabVIEW realtime version used it may be necessary to add an extra configuration file to the system (this is for Linux based cRIOs but should be the same for myRIO): For FTDI based devices this usually seems to work out of the box, but your mileage may vary depending on the USB vendor and product IDs used by the manufacturer of the device. But the NI Linux realtime kernel has additional drivers to support other adapters too. The first check is to run lsmod from a command line on the controller (you know what SSH is, don't you) to see what module drivers are currently loaded. First run it before the adapter is plugged in after a full reset of the system and then after plugging in the adapter. There should be at least one new driver module loaded which has usbserial as parent. If this already fails the adapter is not recognized by the Linux USB subsystem. Once lsmod has shown a driver to be loaded make sure the adapter is plugged in and then look for /dev/ttyUSB devices by entering ls -l /dev/ttyUSB* on the command line. This should give a listing similar to: crw-rw-rw- 1 admin tty 188, 1 Oct 28 02:43 /dev/ttyUSB0 Important here is that at least the first two rw- are present and that the group (after the admin owner) is set to tty. If VISA recognizes the port but lists it as Not Present one of these settings is most likely wrong. To change the permissions with which a specific device is mounted by the kernel device discovery subsystem there are two different methods depending on which Linux kernel version is used. NI Linux Realtime 2013 This uses the old mdev system to add dynamic devices. Make sure to add following line to /etc/mdev.conf ttyUSB[0-9]* root:tty 666 Possibly the root entry should be replaced by whatever the login name of the administrative account is on that system (admin). NI Linux Realtime 2014 (and supposedly newer) This uses the newer udev system to add dynamic devices. Create a text file with the name ttyUSB.rules with following contents: KERNEL=="ttyUSB[0-9]*", GROUP="tty", MODE="666" Add this file into this directory: /etc/udev/rules.d
    1 point
×
×
  • Create New...

Important Information

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