Jump to content

silmaril

Members
  • Posts

    114
  • Joined

  • Last visited

Posts posted by silmaril

  1. ZITAT(Aristos Queue @ Aug 17 2007, 10:29 PM)

    Use the project window as a pinned palette during development. When you deploy, deploy the library with a .mnu file that is part of the regular palette hierarchy.

    Wait a second... does this mean, there is a way to have a library that comes with it's own .mnu file in my project and whenever I load the project, I get an additional sub-palette in my functions palette?

    If this can be done: How exactly? :question:

    If not: This would be a great feature for people that don't want to save user data in the programm files directory. :thumbup:

  2. ZITAT(Ben @ Aug 15 2007, 02:49 PM)

    Here is a screen shot of one of the sub-VI's after scrubbing to protect the inocent. ;)

    This construct was natural for me when I started out and was still thinking about pushing things onto stack and poping them off. It also has a natural dual priority scheduling feature in that if you insert at the head of the queue those states pre-emt others and low priority can put at the back of the queue. When we only had a single thread and were trying to do more than a PC wanted to, these were useful.

    It just strikes me that thinkinga bout pre-empting and priority of execution is falling by the wayside now that we have almost 100X the CPU from just 5 years ago.

    So you still use this type of structure?

    Isn't that exactly the structure from NI's old Advanced courses, which came from VI Engineering originally?

    This example shows how a good LabVIEW programm looked like some 10 years ago. ;)

    I think a queued state machiche is still a very good idea, but there are some things to keep in mind:

    I would not recommend using strings for the case selector. Better use a (typedef!) enum instead. This way you can avoid typos that take you hours to debug. I also recommend not having a default case. This way your can make shure, you have really made your own decision which case to run for each state.

    I don't really think a simple shift register is the best way to save your states. Depending on your application you might want to use a functional global or Queue functions instead. If you application is event-driven, you can also use user events for this (with the drawback that you cannot insert events at the beginning of the event queue).

    I like to add a variant data type to each queue element. This gives me something like function calls with parameters.

    Of course, using such a queued structure doesn't mean it has to be the only loop! As mentioned by others, you can still have several other loops in parallel. For example your user interface is running in the main loop with additional parallel loops for DAQ and qriting to file. Inter-thread-communication can be done using queues, notifiers or events.

    Especially with all those multi-core processors around, it really is a waste of CPU power to write single-threaded applications.

    No, I don't think the days of the QSMs are over. But everyone has to keep up with the times, even old LabVIEW programmers. :)

  3. ZITAT(konroh @ Aug 14 2007, 07:02 PM)

    page seems to work in my firefox, you can also install IE Tab (https://addons.mozilla.org/en-US/firefox/addon/1419) and open any page you want in firefox including things like Exchange webmail.

    IE Tab is how I tried MSIE for this site :thumbup:

    Anyway I don't like using it - especially if I don't know if the page I am visiting is worth it.

    I just tried on my private computer: it works fine with Firefox. Maybe it's some problem with one of my addons. I don't think I will invest much time to dig further into this...

    One thing I can say for shure: there is no firewall that prevents us from watching youtube videos at work :P

  4. ZITAT(yen @ Aug 11 2007, 01:42 AM)

    Displaying and hiding a ring is not a common UI behaviour.

    Right, it's not common, but that doesn't mean it has to be bad ;)

    I'm doing the same with enums in my current project. I am displaying quite a large table to the user. Every time the user clicks on a cell, the appropriate control for this column is set to the last value from the cell, moved into the right place and given the focus. I am doing this for different data types (some are just simple string controls, some are enums).

    Now I had exactly the same problem: how do I know when the user is finished editing without changing the value?

    I solved this by using the "Mouse Down" events of both the table and the pane to make the edit-controls vanish whenever the user clicks anywhere else. This works great as long as we have a real "mouse user". If the user likes pressing the tab key to jump to the next input field, he will be disappointed. :angry:

    I think this could be solved using "Key Pressed" filter events, but it seemed to much effort to add this just for one button.

    What we really need are "Got Focus" and "Lost Focus" events for controls! :thumbup:

  5. ZITAT(karthik @ Aug 8 2007, 11:14 AM)

    In text based programming languages, Defect Density is generally measured as number of Major Defects found in thousand lines of code(i.e.Defect Density (at any stage) <= 1 Major/KLOC ).Is there a yard stick to measure Defect Density in LabVIEW?Can anybody please through some light on this standards? Karthik SP

    I think for all those "measurements", lines of source code can easily be replace by number of nodes in LabVIEW.

    Just open this dialog: Tools >> Profile >> VI metrics

    and see if that helps you further.

    The more interesting question is: How do you define a "Major Defect"? ;)

  6. ZITAT(cobra21 @ Aug 7 2007, 03:31 PM)

    I am designing a fast-scanning labview program which controls both a piezo stage and photon detectors. Threads for stage movement and data acquisition are completely separated without any data dependencies. But it seems like the stage moves quite randomly when data acquisition is in progress at the same time. For example, the stage was supposed to scan for 100ms per each line (which is implemented by a timed loop to fire triggers in a constant rate), but hardware response for that varies from 60 to 200. Then I redesigned a VI for data acquisition only and ran it with a compiled version of stage controller VI, which eliminated the problem. I wonder why this happens and also if it is possible to ensure time-strict multithreading without any upgrade from 8.20 or introducing real-time module. If not, can they be a solution?

    I will post the code upon request, but to briefly describe it, a thread for the stage is in a timed loop and for data acquisition in a for loop. Those two call library functions inside the loops. i heard from manufacturers of two devices that they are not USB demanding and should work well each other. My CPU is 2.3GHz dual-cure.

    Which kind of hardware are you using?

    Maybe there is some better way to programm your application.

    On the acquisition side you should be using a buffered acquisition (most propably continous).

    Depending on which hardware you use, you might be able to use buffered output as well (or programm the complete movement in advance on a motion board).

    The point is: if your I/O hardware can do the critical timing, all your LV application has to do is initialize it and get all the data when there is time :)

    This doen't sound to me, as if you really need an RT system.

  7. ZITAT(MartinD @ Aug 6 2007, 06:30 PM)

    We are talking about GPL here. Basically my application uses ImageMagick extensivley, that's covered by some license "compatible with GPL". Now with the advent of the LAVA code repositry "LVOOP ImageMagick Interface" I'm tempted to use that also. That's covered by the GNU GPL version 2 license.

    You said: Don't forget: If you use GPL code, your complete work must be under the GPL as well!

    This concerns me a little. There may be some parts of code I would prefer to remove the diagrams from. Those that talk to bespoke hardware etc. I wonder where the line is drawn here because I cannot provide the source code for the NI functions for example. I guess the key is "all my work" becomes covered by the GPL.

    Are you really using ImageMagick's source code in your application?

    Then you have to make your work GPL as well.

    But it sounds as if you are only writing some application that invokes ImageMagick. I don't think you have to make your programm open source in this case.

    I am not shure, if you are allowed to include the ImageMagick installer in your own installer.

    Seeing how this is handled in other projects, you might need to deliver it as two separate installers and your users must install both of them separately.

  8. ZITAT(MartinD @ Aug 6 2007, 03:52 PM)

    Yep. That's correct as I understand it, too.

    ZITAT(MartinD @ Aug 6 2007, 03:52 PM)

    But while the terms a conditions start off quite well it seems to become more restrictive towards the end. If I sell an installer that puts an exe on a windows system do I really need to have an about box that reads "WITHOUT ANY WARRANTY" etc?

    Yes, you must meet certain conditions that make it clear that your work is under the GPL.

    Don't forget: If you use GPL code, your complete work must be under the GPL as well!

    ZITAT(MartinD @ Aug 6 2007, 03:52 PM)

    I'm not 100% percent shure about this one.

    As I understand it, the users must have some way to get the source code. You don't need to ship it with every installation, it should be enough to have them downloadable on a server.

    If you want to provide a warranty: just go ahead! You can do this without breaking the GPL.

    ZITAT(MartinD @ Aug 6 2007, 03:52 PM)

    Until now I have avoided the use of any code repositry VIs in my application that I intend to sell but to be honest thats becoming a bit of a pain now, I'm wasting hours
    :(

    Just to be shure: Are we really talking about GPL here, or rather about some libraries that are under the LGPL?

    If it's LGPL, then it's much easier. You don't need to publish your own source code in this case and your application doesn't need to be under the LGPL itself.

    You still have to deliver the LGPL license text with your software and make clear what you are using, but I think that's just fair.

  9. ZITAT(Marginal @ Aug 6 2007, 03:08 PM)

    Prompt please how to control the level of record of the line input of sound card with LabView?

    You should be able to do this with only two express VIs.

    "Acquire Sound" and "Amplitude and Level Measurements" should do the trick.

    Of course you could the same using "real" VIs as well, which is just a little bit more complicated. ;)

  10. ZITAT(konroh @ Aug 6 2007, 03:09 PM)

    I have a vi I am working on, and for some reason, every change I make causes the CPU to go to 100% for several seconds, for instance, dropping a constant on the block diagram or a new control on the front panel, or anything else besides just cosmetically moving things around basically locks up LabVIEW for several seconds. This is on a fast laptop (Dell M90, core2 2.0Ghz, 2gb RAM) and only happens on this one vi, which isn't very large (340kb). Any idea how to find the culprit? This happens on 2 different laptops, so I am pretty sure it is something in this particular VI...

    I remember this kind of effects from a 25 MB VI with > 6000 front panel elements in LV 7.1.

    (No! I didn't write that one! :angry: )

    Can you post your VI?

    It's really hard to guess what might be wrong without looking at it.

    One thing you can try quickly: Hold down Ctrl-Shift while pressing the run button with the mouse. This causes LV to recomile the VI hierarchy. Maybe you are lucky and the VI gets broken, which would show you the culprit.

  11. ZITAT(abuch06 @ Aug 3 2007, 04:16 PM)

    I know that you can add annotations to a waveform graph by right clicking then selecting "add annotation". Right now I have my program identify annotations and place them where I want, but I cannot seem to create them inside the VI.

    Is this possible?

    This sounds as if you were already reading and writing the property "Annotation List" to change the placement of your annotations. If I am right, you are already almost there :thumbup:

    Just use the graph's property "Annotation List" to get the current list of annotations.

    You can simply add more elements to this array and write the complete array back to the same property.

    Just to make myself clear: you always have to write the complete list of annotations to the property. As far as I know there is now simple way to add only one annotation without first reading all the existing ones.

  12. ZITAT(Ben @ Jul 31 2007, 09:27 PM)

    Yes Ben, you summed up my problem exactly. :thumbup:

    ZITAT(yen @ Jul 31 2007, 09:17 PM)

    Not that much code. Check out Altenbach's example
    . Now you just need to modify it and create a subVI out of it.

    Thanks very much for this link, yen!

    You are right: This is far lesser code than I thought.

    Maybe I should try putting this into an XControl. Using a circular image with transparent "edges" and a transparent picture control should provide the impression of a circular control as I need it.

    Plan B is using a picture ring with predefined pictures at certain angles. This would work as long as I only need quite big angular steps (which I don't know for shure at the moment).

    Thanks to all for your answers!

    I think you helped me a lot! :D

  13. Hi folks,

    I would like to have a control that shows an image that can be rotated easily.

    I know that this can be done using a picture control and a lot of LV code.

    Looking at the controls that come with LabVIEW, I can see that something very similar to what I am looking for is already there: The knob / dial / meter / gauge (which is basically all the same as far as I can see).

    I tried customizing those controls and importing another picture for the needle. This works fine. My imported picture is moving in a circle whenever values change. Unfortunately, it only moves around, it doesn't rotate :( .

    Does anyone know a way to have a rotating knob with my own picture on it?

    Or maybe there is some other way which I just didn't see?

    Thanks in advance for any help you can give me!

×
×
  • Create New...

Important Information

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