Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/30/2009 in all areas

  1. I suppose I'll clarify my point for just a sec, then I'll try to follow my own points (about to be given) and provide alternatives. I think using (not even abusing) the Val(signaling) property is far far worse than globals depending on usage. Hence the fervor. I don't expect pretty code out of the gate but I don't know how to stop a newbie from adopting poor practices out of the gate other than striking the fear of god into them. Agreed, using dynamic events 'as truly dynamic events' is not a beginner topic, but I believe the use of 'user events' are beginner material which only requires knowledge of the mechanics of wiring them up. and summing up those last few points: I think that a smarter person than I would not need the 'fear-o-god' tactic to discourage poor techniques. Rather it would be much more classy and eloquent to give knowledge to them through some simple example programs demonstrating the bad aspects and demonstrations of better ways to do it. Now onto my attempt at eloquence: Jim Carmody did a great job with exactly what I think San was gunning for so I'll try not to replicate that First on some of the dangers of using the Val(signaling) Some simple programs are created that are fully reactive (waiting for some event to happen) and you will see this as just an event structure in a while loop. <a href="http://content.screencast.com/users/NJKirchner/folders/Jing/media/8689b74b-ac72-44c8-952e-80c386e03c21/2009-11-29_1536.png"><img'>http://content.screencast.com/users/NJKirchner/folders/Jing/media/8689b74b-ac72-44c8-952e-80c386e03c21/2009-11-29_1536.png"><img class="embeddedObject" src="http://content.screencast.com/users/NJKirchner/folders/Jing/media/8689b74b-ac72-44c8-952e-80c386e03c21/2009-11-29_1536.png" width="448" height="226" border="0" /></a> And depending on the scope of the code, this can get the job done just fine and avoid extra coding that may never be utilized. But the problem, and this sounds much closer to what San was looking at, is what happens when you now need to invoke the code within this state without the user hitting a button? By default, if the user doesn't know any better, they'll use the Val(Signaling) property. This is typically because it will require almost no extra code to be written other than dropping that property node. Well this starts to snowball into a bigger issue when someone decides that they just don't want to execute that one event state, but rather I need 4 states executed and I want that state to always be the second of the 4. What typically happens, is that the end user just starts stringing together multiple Val(signaling) properties for multiple controls to call multiple event states. This is particularly bad because there is no guarantee that as you string together Val(signaling) properties that they'll execute in that order, so you've just introduced potential bad logic in your vi. Now it gets even trickier if you like to use property nodes all over you code because if you need to better understand the flow of the program, how do you know who and what is controlling the state firing? Search for Val(signaling): you get all usages of that property (fail). Search for all property nodes of a given control: you now find every property of a control and you only find the property nodes that are directly linked to that control and you miss any non-linked property node. <a href="http://content.screencast.com/users/NJKirchner/folders/Jing/media/54b79210-0b47-42d6-9770-4be1f36bbe13/2009-11-29_1555.png"><img'>http://content.screencast.com/users/NJKirchner/folders/Jing/media/54b79210-0b47-42d6-9770-4be1f36bbe13/2009-11-29_1555.png"><img class="embeddedObject" src="http://content.screencast.com/users/NJKirchner/folders/Jing/media/54b79210-0b47-42d6-9770-4be1f36bbe13/2009-11-29_1555.png" width="437" height="142" border="0" /></a> And just to re-itterate. Don't underestimate the need to understand the flow of a program. You will someday need to re-learn what you wrote. Someone's LAVA tagline is perfect for this "Imagine the next person to work with your code is a deranged psychopath and knows where you live" So now onto some alternatives and notes about the Val(Signaling) property. Its intent in life is to provide that 'if all else wont work' kind of functionality to the LV language. An example of this is when using the data terminal of an event case. In this case you want that data on the terminal and the only way to programatically fire that event and still have that data is through the Val(signaling) property <a href="http://content.screencast.com/users/NJKirchner/folders/Jing/media/41648ccd-13e7-4e07-9cce-b867b4dc6821/2009-11-29_1605.png"><img'>http://content.screencast.com/users/NJKirchner/folders/Jing/media/41648ccd-13e7-4e07-9cce-b867b4dc6821/2009-11-29_1605.png"><img class="embeddedObject" src="http://content.screencast.com/users/NJKirchner/folders/Jing/media/41648ccd-13e7-4e07-9cce-b867b4dc6821/2009-11-29_1605.png" width="448" height="223" border="0" /></a> Now the alternative or smarter architecture associated with this, is to have the event cause a reaction in some other piece of code somewhere else that you have more control over than an event structure. This is where a solid event driven producer consumer design pattern comes in handy. I won't go into the architecture of this here but what this does allow you to do is have the code to be executed in a place that can be easily invoked programatically or interactively. Do the amount of wires increase? yes. Does the architecture increase in complexity? yes. Do you have a much more flexible and debuggable piece of code for just a little more effort? No question about it absolutely. So for the how-to-do-it portion of the code. San, It sounds like you are monitoring your code for the 0xFF Byte and want some other part of code to react when this happens. The code that Jim sent is about spot on and the only other thing that you'll need to do is share the reference to that newly created user event around your codebase. <a href="http://content.screencast.com/users/NJKirchner/folders/Jing/media/6f18fd2d-c4a3-4e6b-9c38-c62bac86edf8/2009-11-29_1617.png"><img'>http://content.screencast.com/users/NJKirchner/folders/Jing/media/6f18fd2d-c4a3-4e6b-9c38-c62bac86edf8/2009-11-29_1617.png"><img class="embeddedObject" src="http://content.screencast.com/users/NJKirchner/folders/Jing/media/6f18fd2d-c4a3-4e6b-9c38-c62bac86edf8/2009-11-29_1617.png" width="316" height="265" border="0" /></a> The part of code that needs to fire the event, will use the 'Generate User Event' vi <a href="http://content.screencast.com/users/NJKirchner/folders/Jing/media/8a8cf0e9-cc0d-445d-acf9-b9483e37fbcf/2009-11-29_1619.png"><img'>http://content.screencast.com/users/NJKirchner/folders/Jing/media/8a8cf0e9-cc0d-445d-acf9-b9483e37fbcf/2009-11-29_1619.png"><img class="embeddedObject" src="http://content.screencast.com/users/NJKirchner/folders/Jing/media/8a8cf0e9-cc0d-445d-acf9-b9483e37fbcf/2009-11-29_1619.png" width="235" height="488" border="0" /></a> And all parts of the code that need to respond to that event need to dynamically register for that event and then have an event case that registers for it. <object width="810" height="612"> <param name="movie" value="http://content.screencast.com/users/NJKirchner/folders/Jing/media/e17f4a92-a2a5-428a-b981-2393f28ebc2a/jingh264player.swf"></param>'>http://content.screencast.com/users/NJKirchner/folders/Jing/media/e17f4a92-a2a5-428a-b981-2393f28ebc2a/jingh264player.swf"></param> <param name="quality" value="high"></param> <param name="bgcolor" value="#FFFFFF"></param> <param name="flashVars" value="thumb=http://content.screencast.com/users/NJKirchner/folders/Jing/media/e17f4a92-a2a5-428a-b981-2393f28ebc2a/FirstFrame.jpg&containerwidth=810&containerheight=612&content=http://content.screencast.com/users/NJKirchner/folders/Jing/media/e17f4a92-a2a5-428a-b981-2393f28ebc2a/2009-11-29_1624.mp4"></param> <param name="allowFullScreen" value="true"></param> <param name="scale" value="showall"></param> <param name="allowScriptAccess" value="always"></param> <param name="base" value="http://content.screencast.com/users/NJKirchner/folders/Jing/media/e17f4a92-a2a5-428a-b981-2393f28ebc2a/"></param>'>http://content.screencast.com/users/NJKirchner/folders/Jing/media/e17f4a92-a2a5-428a-b981-2393f28ebc2a/"></param> <embed src="http://content.screencast.com/users/NJKirchner/folders/Jing/media/e17f4a92-a2a5-428a-b981-2393f28ebc2a/jingh264player.swf" quality="high" bgcolor="#FFFFFF" width="810" height="612" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/users/NJKirchner/folders/Jing/media/e17f4a92-a2a5-428a-b981-2393f28ebc2a/FirstFrame.jpg&containerwidth=810&containerheight=612&content=http://content.screencast.com/users/NJKirchner/folders/Jing/media/e17f4a92-a2a5-428a-b981-2393f28ebc2a/2009-11-29_1624.mp4" allowFullScreen="true" base="http://content.screencast.com/users/NJKirchner/folders/Jing/media/e17f4a92-a2a5-428a-b981-2393f28ebc2a/" scale="showall"></embed> </object>
    2 points
  2. Name: Code Capture Tool Submitter: Ton Plomp Submitted: 03 Jul 2009 Category: LabVIEW Tools Network Certified LabVIEW Version: 2009License Type: BSD (Most common) The Code Capture tool allows you easily create screenshots of you LabVIEW code for use in documentation, web-sites, wikis, emails. This tool provides an API for creating images of LabVIEW code as well a GUI for easy capturing and use of code. Further info is provided in the help-screen (F1) of the program. For the latest version visit the Code Repository For the latest version of the source code, visit SourceForge For more info, visit the LabVIEW wiki with the documenation. A series of videos is available on screencast: Code Capture Tool Installation ============ To install the Code Capture Tool, run the 'Install Code Capture Tool.vi' in the LabVIEW version of your choice, or use the OGP file in conjunction with VIPM. A wizard will guide you through the installation procedure. Usage ============ After installing and restarting LabVIEW, you can open the Code Capture Tool via the 'Tools' menu to capture an image of the current VI. For more info open the About screen of the GUI. Uninstalling ============ To remove the Code Capture Tool from your LabVIEW installation remove the following files in your LabVIEW folder: Project\Code Capture Tool.vi user.lib\CCT.mnu And the following folder: user.lib\_Code Capture Tool In your LabVIEW data folder (in Windows, this is normally: My documents\LabVIEW Data) is a configuration file called Code Capture Tool.ini, which can be removed at any moment. However this file can be shared between mulitple versions of LabVIEW, I recommand you to use a special LabVIEW data folder for each LabVIEW version. Contact ============ Comments, bugs and thank yous can be expressed to the NI Forums community , and on the LAVA community at the CCT discussion thread. Click here to download this file
    1 point
  3. "Climategate". And to think this wasn't even a word a month ago. Stock up on the popcorn. IMO this is the biggest scam in history. I've believed this for years, but now the story has legs. Seems the Internet wasn't the only thing Al Gore "invented". If we can't trust scientists to be honest ...
    1 point
  4. Name: Multi-Column Listbox XControl Submitter: Karissap Submitted: 02 Jul 2009 Category: X-Controls LabVIEW Version: 8.5 Version: 1.2.0 License Type: BSD (Most common) Make this available on the VI Package Network?: Undecided Copyright © 2007, Karissa Purcell All rights reserved. Author: Karissa Purcell --see readme file for contact information Description: An XControl with enhanced features for the multi-column. To access X-Control features select More… from the shortcut menu. Features Automatic Ordering -. The Rows are ordered by a selected column in either ascending or descending mode (alphabetically). Columns can be selected by clicking on the column header with the hand tool. The sorted row is displayed in bold font with a \/ or /\ marker at the end of the name. Value Filtering – Rows can be hidden by applying value filters. The value filters will apply upper and lower limits (alphabetical) for columns. Alternate Line Colouring – Gives the Multi-Column Listbox a professional look by applying an alternating background and text row colour. Dependencies: Labview 8.5.x or higher Open G Array Library: oglib_array Change Log: 1.2.0: Fixed edit cell behaviour. Improved ability to convet older versions. 1.1.0: Added more commenting. Fixed bug in cell editing of column headers. Added saving of adjusted column widths. Added example vi. 1.0.0: Initial release of the code. Click here to download this file
    1 point
  5. I'm now up to 3 reputation points (woo-hoo!). Is there any way to see which of my posts got the points?
    1 point
  6. Conspiracy James is out of town this week so I'll be glad to fill the void. XKCD: http://xkcd.com/258/ And just because it's Paul: Every thing we ever know could all be lies. We know the earth is round because many different independent groups tell us it is, but I have never done any experimentation to determine if it is. What about atoms, and molecules and the periodic table of elements is that all made up? Could be I don't know for sure it isn't. For all I know computers could run off of fairy dust and moon beams, I've never built one from scratch, how do I know what makes it work? Ultimately I don't know, I take all the information that is given to me and I formulate an opinion based on what I am told is fact from groups and organizations which may have a private agenda. I believe global warming is an issue we should be concerned. I may be completely wrong but I know that I don't have the technical data to backup hardly any claim without referencing someone else's work, which could be total crap.
    1 point
  7. Great idea, but it's worth noting that one must be extremely careful with string-based Case Structure ranges. For example: 1) The range of "UI:".."UI:Z" is not inclusive of "UI:Z". To be inclusive you need to explicitly add it like this: "UI:".."UI:Z", "UI:Z" -- see docs for details. 2) If you wanted to include frames like "UI: Zoom Out" (that have more characters than just "UI: Z"), then you'd probably want to set your range to something like "UI:".."UI:zzzzzzzzzzzzz" (Note: I used lowercase "z" on purpose -- see #3, below) 3) String range matches are case sensitive (even if your case structure is configured for Case Insensitive Match, I believe), so you'd want to use a range like "UI:".."UI:zzzzzzzzzzzzzz", since "z" (0x7A) > "Z" (0x5A) -- see docs for details. Cheers, -Jim
    1 point
  8. A couple of ideas come to mind, sorry but no references to back me up. 1) ".... so this topic further investigation." or something to that effect is what I was taught is how all research papers should end. The explanation that came with that note to me is that nothing gets researched without funding and there will be no funding without a reason so ... more research dollars. 2) "Power" durring recent climate hearing in congress all of the pro-change people were scheduled early so that teir version would make the news before it was too late to go to press. The con arguement was little covered. 3) "Power" the meeting that is scheduled for helsinky (spelled very badly, sorry) include provision to enforce climate regualtions on a global scale effectively setting the first hints of a World Government with power to enforce climate laws. 4) No mention of atomic energy in all of the "solutions" unless we happen to be talking about a country other the the US and then it is OK fro them but not us. 5) According to an interview given by Lord Monkton (again bad spelling) indicated that they predicted phenomenon on which global warming was based (CO2 concentration increase inhibits radiating heat) has been measured using new satalite data and was shown to be false. Just trying to help, and am full aware of how crazy i sound but still desire to help any one willing to read. Ben
    1 point
  9. Selected anagrams of Elliott Darcy Relf: (edit: fixed misspelled name in link text. the anagrams themselves are correct.) Latticed Elf Lorry Called Tritely For It Corralled Lefty Electoral Dirt Fly Fecal Ditty Roller Torridly Let Fecal Craftier Old Telly Title Farce Drolly Fed Troll Literacy Frilly Rotted Lace Clearly Filed Tort Do Filter Rectally
    1 point
  10. Here is small utility VI to create system button with a given image. François, you have my blessing to include it in your UI Tools and modify as you like (particularly to include hover states) Create Button with Image.vi
    1 point
  11. Here's a demonstration video with the new (2.0) features:<br/> <object width="360" height="554"> <param name="movie" value="http://content.screencast.com/users/TonPlomp/folders/Default/media/4a988906-a72a-41f4-a978-35e68c0f2d20/CCT2.0_controller.swf"></param>'>http://content.screencast.com/users/TonPlomp/folders/Default/media/4a988906-a72a-41f4-a978-35e68c0f2d20/CCT2.0_controller.swf"></param> <param name="quality" value="high"></param> <param name="bgcolor" value="#FFFFFF"></param> <param name="flashVars" value="thumb=http://content.screencast.com/users/TonPlomp/folders/Default/media/4a988906-a72a-41f4-a978-35e68c0f2d20/FirstFrame.png&containerwidth=360&containerheight=554&showstartscreen=true&showendscreen=true&loop=false&autostart=false&color=1A1A1A,1A1A1A&thumb=FirstFrame.png&thumbscale=45&content=http://content.screencast.com/users/TonPlomp/folders/Default/media/4a988906-a72a-41f4-a978-35e68c0f2d20/CCT2.0.mp4"></param> <param name="allowFullScreen" value="true"></param> <param name="scale" value="showall"></param> <param name="allowScriptAccess" value="always"></param> <param name="base" value="http://content.screencast.com/users/TonPlomp/folders/Default/media/4a988906-a72a-41f4-a978-35e68c0f2d20/"></param>'>http://content.screencast.com/users/TonPlomp/folders/Default/media/4a988906-a72a-41f4-a978-35e68c0f2d20/"></param> <embed src="http://content.screencast.com/users/TonPlomp/folders/Default/media/4a988906-a72a-41f4-a978-35e68c0f2d20/CCT2.0_controller.swf" quality="high" bgcolor="#FFFFFF" width="360" height="554" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/users/TonPlomp/folders/Default/media/4a988906-a72a-41f4-a978-35e68c0f2d20/FirstFrame.png&containerwidth=360&containerheight=554&showstartscreen=true&showendscreen=true&loop=false&autostart=false&color=1A1A1A,1A1A1A&thumb=FirstFrame.png&thumbscale=45&content=http://content.screencast.com/users/TonPlomp/folders/Default/media/4a988906-a72a-41f4-a978-35e68c0f2d20/CCT2.0.mp4" allowFullScreen="true" base="http://content.screencast.com/users/TonPlomp/folders/Default/media/4a988906-a72a-41f4-a978-35e68c0f2d20/" scale="showall"></embed> </object>
    1 point
  12. lol First I totally agree with you that this can be bad as in using globals is bad. But everything has a place, and everyone is at different programming levels and knowledge levels, so I think depending on a per use case it needs this needs to be judged. So taking the topic into perspective: You think someone who has openly stated they are new to LabVIEW is going write beautiful code, first time, off the bat? Understanding dynamic events is hardly a basic level subject. Especially given they are unfamiliar with design patterns (also stated). I am by no means having a go here, just establishing an estimated LabVIEW experience level based on the facts posted. So if someone starting out has a basic application, and the use of Val(Sign) property works and gets the job done, but they learn stuff along the way - is that such a bad thing? I never stated to abuse it like a red headed step child, I stated a method that could achieve the result outlined in the original post. Additionally I am of the opinion that it is not detrimental that somebody has knowledge of how the Value Signaling works. If they do not know it exists, or do not understand how it works, then how are they to know why its bad? Programming is a journey (well at least for me), it is about finding stuff out, trying different things (can always skin a cat different ways). So telling someone to disregard the Val(Sign) property means discouragement from learning something and from trying it out for themselves. This in my opinion, is counter-productive to that journey. Bad, bad, bad Norm.
    1 point
  13. Darren has created a new group on ni.com for Quick Drop Euthusiasts. Check it out, as he is discussing possible 2010 release ideas. Cheers
    1 point
  14. Hi Athalia As long as all functions and structures etc... used are available in 7.x then you should be able to. I know you can't save for 7.x using 8.2.1, I don't know which is the first lower version that will work but 8.0 should be fine (maybe someone can confirm which it is?). You will have to open the VI in LabVIEW 2009 first. Then select File>>Save for Previous Version... Then save it down to e.g. LabVIEW 8.0. Then you will have to open the new VI in e.g. LabVIEW 8.0 Then select File>>Save for Previous Version... again to 7.x
    1 point
  15. Well, I have a term for this that I use in the code. I've never had a need to expose users to that term. In general, as in the Error List Window, we talk about run-time type propagation, as in, "The run-time type must be propagated from dyn input to dyn output." We also use "run-time type preservation," which is how the new LV 2009 primitive "Preserve Run-Time Class" got its name. In the code, I call these two terminals "thralled", since the result of the successful propagation is that the output terminal's type is now thralled to the input terminal's type. I picked this somewhat arcane term because it was unique in the LV vernacular, whereas "linked" or "chained" or "bound" had other uses. If you'd like to use that term, I can guarantee that nothing else in LV uses that term, either in the code or in public. To restate this using my terminology... "If the input terminal is successfully propagated to the output terminal then the output terminal is thralled to the input terminal. Given this guarantee, when a subVI is written to take a parent class but the subVI node's input terminal is wired with a child class, automatic downcasting can convert the output terminal to match the input terminal."
    1 point
×
×
  • Create New...

Important Information

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