Send parameters

  • Our Kawasaki Units are meant to produce one product of differing dimensions. For the robots this means they need to be given three distinct values.


    These values can be real or integers.


    - Is it possible to cast from real to integer and vice versa ?
    - How can I allocate a variable name to a signal so I can use e.g. IF SIG(buffer.full) ?
    - Is it possible to use something like IFNOT ?


    I need all values at the same time, yet more complex data types are not available.
    Would the following work? The goal is to collect the values and call a function to begin production. I am looking for an elegant way to do so.


  • Quote

    - Is it possible to cast from real to integer and vice versa ?


    - Not sure what you mean, could you clarify this?


    Quote

    - How can I allocate a variable name to a signal so I can use e.g. IF SIG(buffer.full) ?


    - If buffer.full is to be mapped to a specific output, ie output number 20 - would be written as:
    buffer.full = 20
    SIG buffer.full; Turns on Output 20
    - Outputs/Inputs are not mapped specifically to a signal, they are just mapped to real values.
    - The command used, will then execute the real value in conjunction with the command.


    Quote

    - Is it possible to use something like IFNOT ?


    - Yes.
    IF NOT SIG(buffer.full) THEN
    xxxxxxx
    END


    I don't quite understand what you are trying to from your example, as it's written.



    I'm assuming you wish to read 'words' (16 bits) based on signals coming into the Controller (inputs) and define local variables with the integer value - probably via a fieldbus protocol.
    Then CALL a subroutine and parse in the received variables (BCD integer values from the incoming signals).
    - defining is done from right side of '=' to the left.
    - Also your BITS are referring to output signals not input signals and are overlapping too.


    For example:
    BITS 289,16 = .height
    - Means, set Outputs (289 - 304) with the (BCD) integer value of .height
    - .height needs to be defined with an integer value first.
    - in its current condition, would produce an 'undefined variable' error.
    BITS 290,16 = .width
    - Means, set Outputs (290 - 305) with the (BCD) integer value of .width
    - .width needs to be defined with an integer value first.
    - in its current condition, would produce an 'undefined variable' error.


    In this arrangement, your outputs (BITS) are overlapping also..........


    So your program re-written to read incoming signals would be:



    - If using fieldbus protocol, obviously your signals need to mapped in the signal allocation aux function also.......


    Hope this helps........................

Advertising from our partners