Transferring parameters in binary to the higher-level controller

  • Hello guys!


    I have seen signals received from the PLC in many posts:


    However, in this thread i would like to ask how should i send a value like 100 to PLC?




    I think i have to "declare" signals as i wrote upper, but this time i have to use outputs:


    Code
    DEFDAT
    
    SIGNAL EXAMPLE $OUT[1] to $OUT[16]
    
    END

    However, i can't use RETURN in the function section to send to PLC the value, can i?



    I hope you can help me guys!


    Appreciate your help in advance!:help:

  • Declare properly scoped signal, for example by creating MyGlobals.dat


    Code
    DEFDAT MyGlobals PUBLIC
      SIGNAL EXAMPLE $OUT[1] TO $OUT[16]
    ENDDAT


    then in your program(s) use it as you like


    Code
    EXAMPLE = 100


    you would use it as a variable, not a function.

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • As an addition:

    Your code in the first post doesn't work.

    Can also be done very easy:


    Declare properly scoped signal, for example by creating MyGlobals.dat


    Code
    DEFDAT MyGlobals PUBLIC
    
      SIGNAL EXAMPLE $IN[1] TO $IN[16]
    
    ENDDAT


    then in your program(s) use it as you like



    Code

    Code
    Carlength = EXAMPLE

  • Hmm it's weird, cause it is working:)


    The only thing what i missed is the EXAMPLE(what is the name of the signal) after return:


    Return EXAMPLE


    I will consider your idea and i will use it, cause it is more simply!:)


    Thank you very much for your help!:bravo:

Advertising from our partners