Jump to content

Mark Yedinak

Members
  • Posts

    429
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Mark Yedinak

  1. Questions:

    1. What happens if the class can't find the xcontrol? Is the class broken? Or, since the xcontrol is essentially a window into the class data, does the fp representation default to the cube? If that's the case, considering that the xcontrol isn't a class member, doesn't it violate the classes private data?

    The X-Control could be listed as a friend of the class and therefore have visibility to the private data. Actually NI did a nice thing by creating a community declaration for class methods. In traditional OO a friend of the class would have access to all private methods. NI created the concept of a community method. Private methods remain private to the class. Community methods are visible by friends of the class as well as class members. And of course public methods are visible to all.

    1. Is the intended use case for the class designer to implement and deploy xcontrols with the class or to leave that to the class users?

    I voted for the idea in spite of my questions; I trust AQ to take LVOOP in the right direction.

    This is a good question and if nothing else the user of the class should have the ability to override the X-Control with their own version.

    Actually, I'm hoping for some clarification on this one.

    AQ is right almost all the time, so I pay a good deal of attention to his suggestions.

    I'm skeptical of the above description, though. I like that on a subVI the class control and indicator are cubes or boxes. This is one advantage over using large clusters. (Something like visual encapsulation, maybe?)

    Of course it would be good to have a way to display the contents of an object easily on a UI, and I can see how XControls are well-suited for this task. I just want to ensure I can still use the box control or indicator on the front panel (or the block diagram as a constant).

    Paul

    Based on the presentation at NI Week when this topic came up I believe that the push is to make the X-Control the default. However you would still have teh option of using the cube.

  2. That's a good idea.

    I had a project a few years back where I had to create tip strips for 1024 indicators. After that I never wanted to see a tip strip again. smile.gif

    I should probably give them another chance.

    In addition to using the VI description you could also use the Help Tag using an external help file. There are various tools available for creating, editing and compiling help files. Again, this puts your documentation for all of your VIs into a common place and takes advantage of the context help as well as the help file support.

  3. If there is a discrepancy between code and docs, I'm going to believe the code. Assuming it worked at one point, the code doesn't lie. And the only thing worse than no documentation is incorrect documentation.

    I agree the unbundle/bundle of a state is great internal documentation. That's my second pic in my original post. But the problem comes when you're an anal-retentive coder (like me) and insist on everything being neat and tidy. In this instance that means everything in a BD having to fit on one screen. All the wraps around the state machine take up lots of screen room (my development computer is 1024x768) so I tend to turn each state into a subvi to get more wiring space. So now that self-documentation is buried down another layer. When I'm first looking at the code again after a couple years, I have to click in and out of all the state subvis to figure out what gets read/written where. I'm doing that now with a piece of code, and looking at ways to make that process easier in the future is what started this whole thread. Either that, or I need to get therapy for my anal-retentiveness, and then this wouldn't be a problem anymore. smile.gif

    Since you are already putting the code into subVIs then take advantage of the documentation property and tip strips for VIs. By doing this you simply need to select the particular subVI and show its help. You save yourself from having to open the VI and you also get some consistency in your documentation by forcing the document property to be filled in for all of your VIs.

    As far as which to believe, the code or the comment, you are right that the code is what is actually being done but you can't say with any certainty that it is what is right. The comment could be correct and it was simply coded wrong. That is one of teh main reasons I don't like using embedded comments in code.

  4. I wish I had have been there! I'm glad you enjoyed it and it was thought-provoking - I think it's a very interesting topic and an opportunity for us to make a real difference in an area that we all know could be better :)

    Um, I'm pretty sure that I was sitting next to you at Iron Works. I didn't think you had that much to drink already. :D

    The one issue that I see with your proposal for the overt conversion is that it will still require lots of rework for old code. At a minimum all of the old code will need to be wrapped to do the conversion. Truthfully I am not sure what the best answer is with respect to backward compatibility but it will certainly be an issue to contend with.

  5. Just to throw my two cents in I generally don't believe in lots of documentation in the code itself. The main reason is that it is generally not maintained and therefore is rather useless. If you are in the code and you see that the code is different from the in source documentation which do you believe? A solid architecture, good use of modularization (and yes, all subVI's should have accurate documentation for the VI itself), meaningful data and subVI names as well as good style along with system level documentation tends to work best. I am not saying that you shouldn't use any documentation in the source code but it should be minimal. In the case of a state machine I do label all wires in and out of the state machine but they are labeled outside of the individual cases. As others have stated I try to minimize the number of wires flowing through a state machine and when appropriate I bundle the data into clusters. The unbundle and bundle by name inside the individual states will help to "document" what data is being used in the individual state (provided you use meaningful names on you cluster elements).

    Lots of comments embedded inside the source code are just one more thing that need to be maintained.

  6. Strictly speaking you can't do what you are asking. A pure hexadecimal number is an integral value and cannot represent a fractional value. You can get the hex representation for the binary value of the double value but without knowing the internal representation of the value in terms of the mantissa and the exponent the hex value is rather meaningless.

  7. Having attended the presentation I can certainly say that it was an excellent discussion and a very interesting topic. Several of us continued the conversation at dinner Thursday evening.

    The one aspect I wanted to say though is that whatever architecture gets chosen it should provide support for multiple errors. A good general purpose error handler should be able to see multiple error events and take the appropriate action. A prime example for this would be some system failure that is of a high priority and then a secondary error when trying to log the event. Both are certainly problems but how they are handled is completely different. With a single error the application would have to decide whether to ignore the error when logging the data or worse, override the more critical system error with the log error.

    Anyway, for those who were unable to attend I highly recommend reviewing the presentation.

  8. You can look through the examples that NI provide. This gives you a pretty good handle on what can be done in LabVIEW. As for books you might want to pick up LabVIEW For Everyone. This is a good book for learning LabVIEW. The other thing you can do is hang out here. This place is a wealth of information.

  9. I would look at two things that will help with your multiversion environments. First, if you are not using LabVIEW projects already then I would start using them. They help significantly to reduce cross linking issues and generally keep things more organized. Along the same lines I would look into using some sort of source code control. This way you can save code their and branch you applications and keeping working version for each of the different versions you are using.

    Now, do you need to distribute source or can you simply distribute stand-alone applications. If the latter then you don't need to be so concerned about the different versions of LabVIEW. However if you do need to distribute different versions you will need to use the approaches I suggested above. In addition, you will need to have each version installed on your development machine. You can save code to an earlier version but that is only supported for two revisions back. So, over time this does not become a workable solution. The only true way to support multiple versions is to have each version installed. If you need to do this I suggest that you look into the SSP program.

  10. If you want help you will need to post either a more complete snapshot of your VI or the code itself. From the tiny snippet you posted it is hard to see what you are doing. Not to sound nasty of anything but I would suggest that you take the LabVIEW Basics I and II courses or at a minimum pick up the book "LabVIEW for Everyone". You would benefit greatly from some training to help get you started. While LAVA is a great source of information it is not the best place to try and learn LabVIEW from the ground up. There are better resources for that.

  11. QUOTE (lovemachinez @ May 14 2009, 09:48 AM)

    I'm new in labview; so I search the google for it but cannot find...

    if in C language, I will create variable "int x;" to combine with initial string path and then use x++; to increase it.

    But in labview I cannot find how to create the variable like C language.

    Does Labview have an variable like this?

    No, LabVIEW does not "declare" variables in the way that you are thinking. The data is on the wire. Internally LabVIEW handles the allocation of the storage required and the wire carries the data through your application.

    As for your original questions here is a very basic (an contrived) example of how you can create new file names.

    • Like 1
  12. Based on the screen shots you posted your will never process your queues faster than 100ms per item. You have waits in your processing loop which will gate your performance. Since you are using the networks queues there really isn't a need to have the additional waits. The queues themselves and the TCP functions they use all have there own timeouts. Simply use those and take the appropriate action when a timeout does occur. Thus can simply be ignoring the timeout and going back to check for more data in the queue or the extreme case which would be to abort your application. Another alternative is to not include a timeout value (essentially a wait forever) on your queue. If you do this though you will need some external piece of code which will destory the queue allowing the code waiting un it to exit with an error.

  13. QUOTE (Sonny @ May 12 2009, 04:57 AM)

    Hey,

    I'm using the Networkqueue-vi's from ragglefrock and I must say it 's a really nice code. But the programm i use them in is quiet complex and when sending data from one computer to another via the networtkqueues the transfer is pretty slow and the queues run full of elements.

    I tryed to use them in simple vis and it turned out that even then I can only pass data nicly at a rate of 1Hz which is far to slow for my application.

    Is there anybody who had a similar problem or does anyone have a suggestion what might go wrong and how I can fix it?

    It would be very helpful!!

    Thanks in advance

    Sonny

    Can you post a screen shot of your code? This sounds more like an issue with how you are reading or waiting on the queue rather than an issue with the queues themselves. We have been using them extensively and have not seen any of the issues you describe.

  14. QUOTE (Michael Malak @ May 11 2009, 06:21 PM)

    I probably should have also included up front that I have 2-3 decades of non-LabVIEW experience and that the requirements for this project are well-defined and set in stone due to the existence of a previous application lineage with the same use interface in continuous use for the past 15 years.

    The suggested solution of an array of clusters of WaveGraphs is probably going to work for me, and actually answers directly the previous question I asked on the User Interface subforum here, which is why could I create an array of toggles, a cluster of WaveGraphs, but not an array of WaveGraphs.

    Given that you are essentially rewriting this application you can use this as an opportunity to make improvements. Just because something has been done for 15 years doesn't mean that it can't be improved. I am not trying to be argumentative but simply suggesting that this is an opportunity to make improvements to your application. There is quite a bit to be gained from user interface improvements. Good design can help to clarify things, improve productivity, help eliminate errors and so forth. Whenever I have to go back and touch old code I look for ways it can be improved. That is all that I am saying. And for the record I also have several decades of software engineering experience.

  15. QUOTE (ShaunR @ May 11 2009, 04:53 PM)

    You could but I would agree with mross. You need to think of what the user truly wants and design a user interface that meets those needs. Your suggestion while functional is actually looks rather unprofessional. Depending on the target audience this solution simply wouldn't do.

  16. I would never have considered using the N parameter to give me the number of iterations executed. I would always use the I value.

    As for the break I am glad they have added it. It made searching arrays easier than using while loops. When using while loops you would have to check for both the stop condition and the size of the loop. With the break in the for loop I no longer have to worry about the array size. I do see how this feature could be abused though.

  17. QUOTE (Black Pearl @ May 7 2009, 09:44 AM)

    Do I read correctly between the lines, that these tracking tools go further than just bug fixing?

    They can. They are useful for entering new feature requests, enhancements, bugs found during your testing as well as customer found bugs. Generally you can assign priority to your items which help you to scope the effort required and organize your tasks.

×
×
  • Create New...

Important Information

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