Getting error when I trying to compile as LIB

Thahir
2012-11-10
2013-03-18
  • Thahir
    Thahir
    2012-11-10

    Hi,

    I am getting error when I trying to compile classic ladder as a Library…

    ladderlib.c: In function ladder_init:
    ladderlib.c:51: error: too few arguments to function ClassicLadder_FreeAll
    ladderlib.c:55: error: CurrentProjectFileName undeclared (first use in this function)
    ladderlib.c:55: error: (Each undeclared identifier is reported only once
    ladderlib.c:55: error: for each function it appears in.)
    make: *** [ladderlib.o] Error 1
    

    Please any one give me a solution

     
  • Thahir
    Thahir
    2012-11-11

    now a days forums means, dont answer anything….then why the hell you guys open forums  haaaan

     
  • Hello,

    the library version has been done quite a long time,
    and not astonishing that it doesn't compile any more (for sure since quite a long time now).
    The modifications for a library version has been sent to me by a person long ago, it is a feature I don't use absolutely.
    For sure it could be fixed, after trying to understand how it works, but I'm a lot busy theses days with others things and priorities than that.

    Another possiblity, would be to just add the motor engine ".c" files directly to your project.
    Just take a look in the Makefile, for the required files that are used in case of an embedded version compiled (without GTK interface). I've done that like that long ago for a product, and it works perfectly..

    And don't complains too much for a little long respons. Eh, I work on this project on my free time, and I'm not seriously obliged to reply even the week-ends to people!

    Bye, bye.

     
  • Thahir
    Thahir
    2012-11-14

    thanks for the reply with in your busy schedule..

    any how i did run the classic ladder as a library…. but if trying to run the ladder_init() function , i got the undefined reference error.

    I understand , u not develop the library version of the classic ladder. but if any developer documentation available for your classic ladder means better to find out easy to analyze because i'm not a expert programmer to run through your code.

    If not documentation available means….would you tell me that

    --how to initialize the classic ladder from my program (i.e ..call any function to initialize , memory allocation …)
    --how to load the .clp files to the library
    --how to access the ports , when i using with my application .

    thanks

     
  • Thahir
    Thahir
    2012-11-14

    thanks for the reply with in your busy schedule..

    anyhow i did run the classic ladder as a library…. but if trying to run the ladder_init() function , i got the undefined reference error.

    I understand , as you said earlier you not develop the library version of the classic ladder. but if any developer documentation available for your classic ladder means better to find out easy to analyze because i'm not a expert programmer to run through your code.

    If not documentation available means….would you tell me that

    --how to initialize the classic ladder from my program (i.e ..call any function to initialize , memory allocation …)
    --how to load the .clp files to the library
    --how to access the ports , when i using with my application .

    thanks

     
  • You can take a look at the README_Dev.txt file, started but not really finished with some keys…
    Else as already said, to look at the "Makefile" for the files used for embedded version (without GTK interface) would be a good start. Then generally all files have a name almost clear… when ending by "_gtk" it means a file for the GTK+ GUI so that musn't be used in your case, else for example "files_project.c" to read/write projects… scanning the directory and opening each ".c" is a good start (there is always a comment at top of each file explaining what it is…
    Another tip: "vars_access.c" contains ReadVar() & WriteVar() heart of the soft to access variables. But for hardware I/O ports, it's in "harware.c" !

    Hope it helps, I know always a little hard to discover a project not done by oneself,
    but no miracle, it requires time and motivation…

    Bye, bye.

     
  • Thahir
    Thahir
    2012-12-03

    you are right,
    i did go through your makefile…
    i got the compile undefined reference and i add the hardware.c file with the library compilation , then it's fine :)

    now i almost successfully integrate the classicladder library with my application…but  only one remaining.

    (ladderlib.o):-1: In function `ReadVar':
    ladderlib.c:-1: error: undefined reference to `readplc_input'
    ladderlib.c:-1: error: undefined reference to `readplc_output'
    (ladderlib.o):-1: In function `WriteVar':
    ladderlib.c:-1: error: undefined reference to `writeplc_input'
    ladderlib.c:-1: error: undefined reference to `writeplc_output'
    

    please tell me, why u declare this as a extern function in the libladder.h file……what is the use of this functions?  important or ignore this functions?

    and finally, sorry for disturbing you often …becausei dont have any clear idea about the plc and there is no partner for this project in my company.

     
  • Thahir
    Thahir
    2012-12-08

    hi ,

    please answer….i have been waiting for your answer almost a week……

    if i going to using your application as a library means what are the thing i need to do and also how to give trigger the input from my application or how to trigger the input classicladder from the terminal.

    please answer me….

    regards,
    thahir

     
  • Thahir
    Thahir
    2012-12-08

    hi,

    also how to config the physical i/o when  i'm going to use this as a library for my application (without GTK), or anyway to configure the i/o from the terminal.

    thanks

    regards,
    thahir

     
  • As already, I'm not the person who did the "library" version of ClassicLadder (It's Thomas Gleixner) , so never used, and don't know exactly how… and not even sure it still works with recent releases….
    Look at "ladderlib.tail" for the definitions of the functions readplc_xxxx and writeplc_xxxx that shoud be created in your project I suppose, to do the interface with the lib… Your appli requires to get/set some inputs/outputs vars with the lib!

    By just loading a .clprj project, all the hardware I/O definitions are included !
    So do the project-parametering with the Gtk+ version interface, and then load the project done in an embedded version…

    Bye.

     
  • With the lib version, it seems, the physical I/O should be read/write by your appli,
    and not done directly by ClassicLadder, the normal ReadVar() and WriteVar() are differents…
    perhaps now it should be done differently, if you want that ClassicLadder manage the I/O itself as usual!?