Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/29/2011 in all areas

  1. At best, the Events are a bit like an occurrence, not a replacement for polling, just a good hint at what might be a good time to poll. The problem as AQ hints at, is that it can be tricky to catch all of the ways that a user can change the scale range. For example, what if I paste a new value, and then make another window active and then return to the FP. The new value is entered via this process without a key press or mouse click. Polling is a robust method to catch these changes. And since I started using LV long before the days of the Event Structure I will pass along a tip from the old days: a simple way to throttle the polling loop is to use the "Wait for Front Panel Activity" function with a long timeout (500 msec). Keeps it responsive when necessary, and out of your way when nothing is happening. In many instances I do not display the Marker values for a slider, and I actually use separate controls to set the range. This makes it very easy to detect the value change.
    3 points
  2. I normally don't post on LAVA, but lately I have been experimenting with the WebSocket protocol, ecmascript, and the SVG DOM for creating animated browser displays with data streamed from LabVIEW. The technique is surprisingly simple. All you have to do is create a script to change the attributes of the SVG elements using the Document Object Model. The WebSocket protocol has a built in message event handler that allows you to create your own script function which executes when messages are received. The browser connects to the socket server and sends a handshake when you create the WebSocket object in script. All you need do is put a TCP/IP listerner in your diagram and return this handshake as described in the wikipedia article on WebSockets. Once the connection is made, you can stream bidirectional data between your LabVIEW application and any bleeding edge browser (Firefox 4, Chrome 9, Safari, IE9?). You can use the DOM to set the transform attributes of SVG elements using the streamed info (rotate, scale, set heigh, width, line points, etc.). Now that we can all design our own GUI objects using Inkscape (free), I suggest a concerted effor to develop a standard SVG format, streaming protocol (based on WebSockets) and open-source script library. The very best thing about this is that it is all FREE, and runs on any platform that has an HTML5/SVG/WebSockets supporting browser (I'm keeping my fingers crossed for the next firmware revision of the Nintendo DSi), and requires NO PLUGINS. So all you folks with iOS and Android who feel left out by the WebUI Builder, or those of us who are infurated by it's $1500/yr price tag (after spending $ on LabVIEW RT/FPGA), Cheer Up! Here are some screenshots of my efforts. The files are opened in the OS, but will also work when served by the old-fashioned "non-webservices" LV web server (you gotta add an SVG mime type to the mime-types file). You can also use RGraph Library and the HTML <canvas> tag if you want to implement a non-SVG browser solution. The library is free for non-commercial use. I suggest a community effort the create the standard SVG formats for UI elements, and a free, open-source ecmascript library for handling the messaging and DOM animation tasks. If there is interest, I will upload my script as a starting point, but I must warn that there is much improvement needed. sm
    1 point
  3. This is a recorded webcast from Trevor Christman, a member of LV R&D on the Language Team with me. In this webcast, Trevor lays out the basic ideas behind OOP, explains how these are implemented in LabVIEW, and shows off parts of the LabVIEW user interface. This is an excellent presentation, and may help those of you who don't enjoy reading documentation learn the power of LVOOP. I fielded questions during the presentation, which you can see scrolling past in the chat window. http://zone.ni.com/w...oc/p/id/wv-1766 [EDIT] There is a sequel presentation now: http://zone.ni.com/wv/app/doc/p/id/wv-2003
    1 point
  4. Thank you guys for your support in this matter. I have solved the problem using a little trick, I'm changing the baud rate of the serial port with a less resolution then I write a 0x00 character on the bus then I change again the baud rate to the value it has to work and then I send the bytes on the bus. This allows me to send the right break on the bus which is used for synchronizing the device. But it would be nice to have the possibility to have a break which is add up to 1ms exactely! Thank you all.... Regards.
    1 point
  5. Since I didn't set a lower limit on interest. Here is a ZIP file with the project and demo SVG and HTML files. It's crude, but works. Some things about the project: 1. The script file for the SVG demo is www\libraries\webpanel.js file. There is a line of code in that scipt that is: var ipAddr="LocalHost"; This line of code must be edited to replace LocalHost with the IP address of the server when serving the file in which this script is embedded. If you just want to test it by opening the WebPanelTest.svg file from the disk using Chrome, it must be set to localhost if you have your LV server enabled. You could make a VI that edits the webpanel.js file and sets the IP address on startup. 2. If you want to server the SVG file from the LV web server, you will need to add the following mime type to the C:\Program Files\National Instruments\LabVIEW 2009\resource\webserver\mime.types file: image/svg+xml svg svgz On the cRIO, the mime.types file is in the ni-rt\system\webserver folder 3. To test the SVG panel, open the LV 2009 project and run the SVGDemo.vi. Open the www folder, right-click the WebPanelTest.svg file, and select Open With > Google Chrome (you must install Chrome 8 or 9 first) Watch the panel update from the VI. Use the slider to move the dial indicator. 4. To test the RGraph Library Example, open and run RGraph Demo.vi. Open RGraphdemo.html using Chrome. You will need LV 2009 minimum for this demo. I'll keep watch here and try to answer any questions that are posted. I really would like to get an open-source project started based on this idea of a common SVG format for free Web UI controls/Indicators. If everyone pitches in a little, it could progress quickly and drive a stake through the heart of NI's misguided Silverlight adventure. Too bad about the security issue confusion, but from what I read, it seems to be a proxy issue that affects Flash and Java, as well as WebSockets. I hope Mozilla.org wasn't too hasty in disabling WebSockets in FF Beta 8. WebPanelLava.zip
    1 point
×
×
  • Create New...

Important Information

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