Announcement

Collapse
No announcement yet.

EV3 My Blocks

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Re: EV3 My Blocks

    I'm a rookie coach this year, but I've been tooling around with the software, and it seems to me that double-clicking on the My Block when it's on the canvas allows you to edit all of its parameters. I might be misunderstanding what people are trying to do, but that seemed to do the trick.

    What I'm not sure of is if that only allows you to change that particular instance of the My Block, or if it applies those changes to all instances of it.

    Comment


    • #17
      Re: EV3 My Blocks

      On NXT-G you can open MyBlocks and change the NAME of input and output parameters. You can also change the icon for the MyBlock. EV3 does not allow this. Once you close the MyBlock builder the interface for the MyBlock is cast in stone.

      Changing input parameter VALUES on a MyBlock only affect the one MyBlock. Input parameters wouldn't be very useful if they had to be the same for all instances of a MyBlock.
      Last edited by DeanHystad; 09-27-2013, 09:33 AM.

      Comment


      • #18
        Re: EV3 My Blocks

        Originally posted by grumpit View Post
        I'm a rookie coach this year, but I've been tooling around with the software, and it seems to me that double-clicking on the My Block when it's on the canvas allows you to edit all of its parameters. I might be misunderstanding what people are trying to do, but that seemed to do the trick.
        I see how you can edit the variable the parameters feed into but I don't seem to be able to find a way to edit anything have to do with the parameters block (the one that appears before the start "block" in the myblock) after creation. Were you able to edit those or just the variable blocks that the wires fed into?
        Coaching the Flamingos since 2004!
        Team #79 - The Blue Cheesy Flamingos
        https://www.facebook.com/KalamazooFLL
        http://www.KalamazooRobotics.org

        Comment


        • #19
          Re: EV3 My Blocks

          It was just the wire parameters and the contents of the My Block itself.

          Comment


          • #20
            Re: EV3 My Blocks

            I'm having a tough time understanding the disappointment about not allowing changes to a MyBlock's interface. In most text languages I cannot add parameters to functions, nor can I change the function's name. Why do you expect something different from a graphical language?

            In LabVIEW you can add inputs and outputs to a vi (their name for a MyBlock) after it is created. This gets me in trouble about as often as it helps me, so I try hard to get the interface right the first time. Renaming inputs or outputs is very safe. Inputs and outputs are more defined by the connector plug position on the block than by name. Deleting inputs or outputs almost always creates a rats next of broken wires that need to be fixed. LabVIEW has something akin to a traditional compiler that reports errors and even jumps you directly to the problem code. EV3 and NXT-G just tell you there is a problem, no description and little indication of what or where the problem is. Given the limitations I am happy to accept the safer, slightly more restrictive tools.
            Last edited by Dean Hystad; 10-16-2013, 12:13 PM.

            Comment


            • #21
              Re: EV3 My Blocks

              Originally posted by Dean Hystad View Post
              I'm having a tough time understanding the disappointment about not allowing changes to a MyBlock's interface. I can't add arguments to a function's calling interface most text languages, nor can I change the function's name. Why do you expect something different from a graphical language?
              Curious as to what languages are you talking about? I have coded in a few different langagues, currently a .NET developer, and have never seen this limit with a text based language.
              Coaching the Flamingos since 2004!
              Team #79 - The Blue Cheesy Flamingos
              https://www.facebook.com/KalamazooFLL
              http://www.KalamazooRobotics.org

              Comment


              • #22
                Re: EV3 My Blocks

                This is a limitation on any strongly typed text language. C, C++, C#.... The arguments are as much a part of the function definition as the name. If I have a C function "MoveSteer(DurationTypes durationType, double duration, MotorPorts left, MotorPorts right, double steer, double power)", I cannot add a parameter "bool brake". Adding the parameter makes this a new function. The name is still the same, but any programs that used the old function will not work with the new function.

                The nature of NXT-G and EV3 makes it possible to add inputs and outputs without breaking existing code, but this must be done in a very restricted way. You cannot rename the MyBlock. You cannot remove, rename or change the type of any inputs or outputs. You cannot change the order of the connectors. You cannot change the default value of an input. Changing any of these alters the interface in ways that can break existing programs or at least result in confusing behaviors.
                Last edited by Dean Hystad; 10-16-2013, 12:24 PM.

                Comment


                • #23
                  Re: EV3 My Blocks

                  Perhaps we are talking about two different things. My problem is that with ANY language I can add a parameter to a function definition at any time then simple change where I call it to now pass in the new parameter. That is where my pain point is. To me a myblock is a sub or function and I should be able to add new parameters as needed.
                  Coaching the Flamingos since 2004!
                  Team #79 - The Blue Cheesy Flamingos
                  https://www.facebook.com/KalamazooFLL
                  http://www.KalamazooRobotics.org

                  Comment


                  • #24
                    Re: EV3 My Blocks

                    No, we are talking about the same thing. When you add an argument to a C# method you destroy the old method and create a new one. It may have the same name (in many cases the real name, not the display name, is also changed), but to the computer it is a completely different method. Programs that used the old method no longer work and must be modified to use the new one. EV3 is better in that you have to explicitly destroy (delete) the old MyBlock. It is harder to reduce your mostly functional program to smoking rubble. IF you want a new MyBlock that has additional inputs and outputs EV3 does nothing to prevent you from doing so.

                    Many programmers take advantage of polymorphism in object oriented languages to provide enhanced functionality while maintaining backward compatibility. If I have a method Goop[int arg1] and I find out I really need the additional flexibility that Goop[int arg1, double arg2] provides, I will write the new two argument Goop method and modify the existing method to call the new method with a default argument. Programs that call Goop[int arg1] will continue to do so, and continue to work. When I need the extra flexibility of Goop[int arg1, double arg2] I can call that instead.

                    EV3 does pretty much the same thing by default. To add inputs/outputs to existing MyBlocks I open the old MyBlock, toss in some constants or variables to provide wire connection points, select the "guts" of the MyBlock and create a new MyBlock. Now I have a new MyBlock with the enhanced interface and I have the old MyBlock for backward compatibility. The backwardly compatible MyBlock calls the new enhanced MyBlock with default values for the new inputs. Old programs still work and you are free to continue using the old version of the MyBlock, or replace them with the new.

                    I fail to see why this is something to complain about.

                    Comment


                    • #25
                      Re: EV3 My Blocks

                      I understand that technically that is whats happening but think of it from the user side. For me when I write a function in whatever text based language and I want to add a new parameter, I am adding it to the EXACT same lines of code with an addition of a couple words. I don't need to copy and paste the code to create a new function, add my parameter then delete the old function code.

                      I think about the way I code right now in real life. I am writing a library and oops things have changed and now there is actually three parameters I want to pass in now instead of two for this function. Having to copy and delete the way a myblock works would drive me crazy. When teaching anyone OOP (even the college kids I taught) you want to start out with straight forward concepts. Adding in workaround like this mucks up the ability to keep it clean and simple.
                      Coaching the Flamingos since 2004!
                      Team #79 - The Blue Cheesy Flamingos
                      https://www.facebook.com/KalamazooFLL
                      http://www.KalamazooRobotics.org

                      Comment


                      • #26
                        Re: EV3 My Blocks

                        Take your "real life" example. You have a library you wrote. You then write 80,000 lines (a small application) of code that use this library. You realize that a function would be more useful if it had three parameters instead of two. The existing code works fine, but you want this new functionality for some special cases. What are you going to do? What do you do if you are a supplier of programming libraries and you have 10,000 customers who use your code?

                        Now imagine you are 10 years old. You had a robot that was doing most of the missions yesterday but now you can't even download the programs. The tournament is tomorrow. Boy, I sure am glad LEGO updated the MyBlock editor so I can open up a block and change parameters.

                        The best solution is a little more time spent on design. When I don't design at the keyboard I don't make many mistakes. As for changing MyBlock interfaces, I don't think you should. Create a new MyBlock but leave the existing (unless it doesn't work). What is the harm of having "MoveStraight" and "MoveStraightWithAccel"?
                        Last edited by Dean Hystad; 10-16-2013, 03:47 PM.

                        Comment


                        • #27
                          Re: EV3 My Blocks

                          Originally posted by Dean Hystad View Post
                          Take your "real life" example. You have a library you wrote. You then write 80,000 lines (a small application) of code that use this library. You realize that a function would be more useful if it had three parameters instead of two. The existing code works fine, but you want this new functionality for some special cases. What are you going to do? What do you do if you are a supplier of programming libraries and you have 10,000 customers who use your code?

                          Now imagine you are 10 years old. You had a robot that was doing most of the missions yesterday but now you can't even download the programs. The tournament is tomorrow. Boy, I sure am glad LEGO updated the MyBlock editor so I can open up a block and change parameters.
                          Yes but I have the ability to do it either way. For our team 80% of the time the issue if found with new MyBlocks not long after creation and they care very little about keep previous version.

                          The best solution is a little more time spent on design. When I don't design at the keyboard I don't make many mistakes.
                          I have a group of very young, new student. The best way to teach is hands on. Yes it would be great we could have 100% spec out programs but that doesn't even happen in real life. They can only think ahead so far and when they make a mistake, now they are stuck with the myblock. 10 revisions later we have movestraight, movestraighwithaccel, movestraight26.... and on and on and on. Good programming habits are hard to establish and not something I am going to accomplish in three months meeting once a week.

                          In the end it comes down to it's a pain in the butt. Can we do it? Yes. Do we want to waste our precious time? No. KISS is what I teach the kids and this goes against that.
                          Coaching the Flamingos since 2004!
                          Team #79 - The Blue Cheesy Flamingos
                          https://www.facebook.com/KalamazooFLL
                          http://www.KalamazooRobotics.org

                          Comment


                          • #28
                            Re: EV3 My Blocks

                            I guess we'll disagree on this one though I have enjoyed the discussion.
                            Last edited by Dean Hystad; 10-16-2013, 04:12 PM.

                            Comment


                            • #29
                              Re: EV3 My Blocks

                              Originally posted by BlueCheesyFlamingos View Post
                              For our team 80% of the time the issue if found with new MyBlocks not long after creation and they care very little about keep previous version.
                              I think that's the real problem. Dean is absolutely correct that once you've deployed the MyBlock throughout a project, most changes you would make at that point would adversely affect the programs in the project. But what I'm seeing with my kids, is that they build a MyBlock, test it, then realize that they forgot a parameter (or gave it a misleading name, or picked the wrong icon). They're still at the development stage here and will usually go through multiple iterations while creating a MyBlock. Having to rebuild the MyBlock each time is really frustrating for them. Sure, it would be great if they could figure this out in their heads or on paper beforehand, but I've got 9 year olds who really are more engaged (and I think learn better) by jumping in and trying things quickly.

                              Comment


                              • #30
                                Re: EV3 My Blocks

                                A comment in this thread by David A. provided a method of adding custom icons in the "C:\Program Files (x86)\LEGO Software\LEGO MINDSTORMS Edu EV3\Resources\MyBlocks\images" directory. Sounds like a simple solution and it does work. However, I read in another post about disqualification issues when using third party software. Would creating icons outside of the ev3 software and then adding them to the ev3 software put the team outside the limits of the rules?

                                Comment

                                Working...
                                X