A couple of questions

pnn
2011-09-17
2011-09-21
  • pnn - 2011-09-17

    Hi friends,

    using CoDeSys 2.3.9.28, I have a couple of questions, as follows:

    1. Is it possible to perform a conditional compilation of code?
      This means, compile or not compile certain parts of POU's code based on something specified in the project itself, or ideally in an external file.
      I don't want to compile the same project for different targets or so, target is the same, just to conditionally compile a few lines of code in certain POU's.

    2. About editors GUI
      Is there any chance the GUI to remember windows sizes/positions between sessions - after a project close/open?
      Or at least to set a smaller default size for a new window?
      I mean imagine an SFC POU and a step in it having an ST entry-action with one line of code. When I double-click "E" in the editor, the action code is opened in a new window which takes approx. 80% of the screen size. Can I do something so that this window appears smaller? If I re-size it, for the current session the window size/position is remembered. But not after a project close/open.
      This may seem a minor issue, but having to resize and reposition windows all the time is a true productivity killer.
      I can't find such a thing in the configuration options, but maybe it's possible via some registry or .ini file editing?

    Thanks

     
  • shooter - 2011-09-18

    1.
    yes see compile commands.

    2.
    no not possible as far as i can see.

     
  • pnn - 2011-09-20

    thanks shooter but which compile command you mean? I can't find any related to conditional compilation.
    Maybe you mean dir lib <libdir> which I guess allows to compile different versions of the same library? If so, I don't want to maintain different versions of libraries</libdir>

    Say I have code like this

    IF var1 > 5 THEN
    var2 := 10;
    END_IF;


    and want sometimes to set var2 to 10 conditionally (if var1 > 5), and sometimes unconditionally. To do so I need to conditionally compile lines 1 and 3 - is that possible?

     
  • shooter - 2011-09-21

    look for the word pragma in the helpfile or in the book.
    difficult to explain here just play with it.

     

Log in to post a comment.