Function Block

Help
Claudio_72
2007-08-03
2013-03-18
  • Claudio_72
    Claudio_72
    2007-08-03

    HI,
    I'm testing the classicladder on Windows 2000 version 0.7.100

    I'd ask if it is possible to create a function block with input/output parameters, in order to use it in different parts of the program avoiding to editing more times the same ladder code.

    Regards

     
    • Hello,

      oh! ClassicLadder 0.7.100 on Windows ? Compiled it by yourself? If you've the sources modified for it (only Makefile perhaps) it could be interesting for other people !

      Else, in ladder there isn't really the concept of function block available...
      But, perhaps with the "sub-routines" using "indexed variables", you could have something usefull for such cases.

      An indexed variable is a variable depending oh the content of another one (the "index")
      Example: %MW100[%MW4] will correspond to %MW number 100+value of %MW4
      if %MW4 equals 12, it correspond to %MW112.
      It can be used to scan a range of variable, or like you as a parameter value for a sub-routine.

      A little sub-routine example using parameters with indexed variables
      %MW4 => variable to which add value (%MWx)
      %MW5 => value to add

      Main in ladder (pseudo-code):
      %MW4:=45
      %MW5:=500
      Call SubRoutine0 => will add 500 to %MW45
      %MW4:=32
      %MW5:=250
      Call SubRoutine0 => will add 250 to %MW32

      SubRoutine0 (pseudo-code)
      %MW0[%MW4]:=%MW0[%MW4]+%MW5

      Little example without a lot of interest, but just to show the principle...

      Else, the "indexed variables" usage should be available in the next version !!!

      Hope it helps.

       
    • Claudio_72
      Claudio_72
      2007-08-09

      Hi Marc,
      Thank you for your answer.

      I've modified the source for Microsoft Visual C++ environment.

      I'm testing it and I'll be happy to give it if it can be useful.

      Can you tell me if is it possible to add some comments in a rung?
      It could be useful for the reading of the ladder source.

      Any idea when will be available the new version with "indexed variables"?

      Regards

      Claudio Montemaggiore

       
      • I think some people are interesting by a Windows version updated (the current using gtk 1 is very very old...). So yes, when finished if you can upload an executable and the sources used for, please do it !

        It is possible to have a comment for each rung. There is an edit on top right for that. In the last version, there is a hint/bubble help, and in the example given, there are some comment written.

        I think a new version with the "variables indexed" features should come before end of august !

        Bye, bye.

         
    • You will find the new 0.7.122 version featuring the "indexed variables" !

      Not a lot of tests done, but it seems to work with the little example I've used.

      Hope it will be helpfull, it takes a little more time than I were thiking... but well now it's available, and it have to be done!
      Have fun.

      MaVaTi.

       
    • Claudio_72
      Claudio_72
      2007-10-03

      Hi Marc,
      thanks for your reply.
      I've run some test about indexed variales and  seem to work.
      In order to have a true "block function", probably it needs that also bit variables
      could be indexed;is it right?

      Do you think is it possible?

      An other point that could be helpfull is the facility "cross-reference", in order to have a speed and full visibility of a variable in the ladder design.
      I don't know a lot about gtk,
      what do you think about this?

      Bye,

      Claudio Montemaggiore

       
    • Hello !

      The indexed variables are only possible in the arithmetic evaluator: eval and compare blocks. The modifications has been done there: eval + edit parts.
      To have them everywhere would means to double all the variables everywhere + test it (little slow down...).
      I don't know if in other products it is something they support there...
      Perhaps, just to be able to use booleans variables (indexed) in the eval/compar could be a solution!

      Yes, cross-reference is very usefull when you don't remember where (or if) a variable is used.
      A lot of work to do ! ;-) It can be everywhere (and you have to test that in search function...)
      The gtk part if displayed in a text area isn't the real problem!

      It is now envisaged at my work too that classicladder could be used to add automation language to a product. I've compiled it fastly with MinGW under Windows, not a lot of difficulties... I will post it soon for download for people intersted.

      Bye, bye.

       
    • Claudio_72
      Claudio_72
      2007-10-12

      Hi Marc,

      can you give some information about automation language? Is it something to
      help the developer to have a global view of the projet?

      In order to have the possibility to "browse" in the project, it could be helpfull a "find function" to search text string in the ladder project, for example in the comment sections.
      What do you think about it?

      Thank you

      Bye,bye
      Claudio Montemaggiore

       
    • Well automation language, are for me all the types of languages used on PLC and listed here:
      http://en.wikipedia.org/wiki/Programmable_logic_controller#Programming

      ClassicLadder has 2 types usable: ladder and Sequential.

      Yes, also a nice idea, that could be interesting to be done.
      But, it is really interesting for big programs ! Not sure if someone make one for now with ClassicLadder ?! ;-)

      Bye.

       
    • Another interesting link on Wikipedia about automation:
      http://en.wikipedia.org/wiki/Automation
      ClassicLadder will not adapted for all the usages listed there ! But for simple ones why not ? ;-)