Posts by lmonari

    [...] but clearly CAST_FROM() cannot handle it.

    The same applies to CAST_TO().

    [...] problem seem to be only when passing buffer as a as parameter. [...]

    Yes. Not only, as you suggesteded, the problem can be avoided declaring the buffer in the local DAT file but also if you declare the buffer as a GLOBAL variable and then using it directly in any subprogram, still without passing it as a parameter.

    Thank you very much for the help

    [...] i am talking about variables PASSED TO your sub or function when your sub or function are called.

    Here I hope to give you a better example, also with external variable initialized.

    All the code above is contained in one single module.

    The error persist if I move the declaration of the char array "myBuffer" in the .dat file of the module.

    Thank you again for your time

    DEF ExampleError( notLocalBuffer[] :IN )

    The brackets in the definition of the input array do not affect the problem. The same error persist even with the brackets. as you can see in the attacched image (left side).

    so how about those details...? how and where is everything declared and initialized?

    My goal is to have a procedure that takes in input a char array of variable lenght and perform a CAST_TO or a CAST_FROM using this array as buffer.

    The example i reported is defined in a file .src with the same name of the procedure, located in a subfolder of KRC:\R1.

    In this particular case the procedure I am showing in the snaps is named "test_cast" and is written in the file "test_cast.src", located in "KRC:\R1\test" folder.

    I also tryed to declare a function instead of a procedure, as shown in the image (right side), but the error persist.

    Thank you for your help

    From my experience on KSS 8.3, the buffer array of the CAST_ functions must be locally declared.

    So, for example, this code will result in a compiler error:

    DEF ExampleError( notLocalBuffer :IN )
        DECL CHAR notLocaBuffer[]
        DECL INT offset, aInt
        offset = 0
        CAST_FROM( notLocalBuffer[], offset, aInt )

    while, this will give no error

    DEF ExampleOk( notLocalBuffer :IN )
        DECL CHAR notLocaBuffer[], localBuffer[4]
        DECL INT offset, aInt
        DECL BOOL res
        res = strCopy(localBuffer[], notLocalBuffer[])
        offset = 0
        CAST_FROM( localBuffer[], offset, aInt )

    The same happens with CAST_TO.

    Nothing changes if the buffer is declared as a global variable or if the buffer is passed by reference ( :OUT ).

    Does anyone know why?

    Are there other ways to use the CAST_ functions with not locally defined arrays?

    Thank you for the help

    Hi Julian
    It really depends on "how much realt time" you want.

    RSI can cycle at 4 ms, no lower than that.
    A much simpler way to do that is using EKI (ethernet Kuka inteface). Program the submit interpreter to read the $AXIS_ACT variable every cycle and send it via TCP.
    Clearly this second option is not hard real time. The cycle time of the submit is not fixed, but with few simple commands stays around 12 ms/cycle, but yes, is not fixed as the submit shares cpu resources with the robot interpreter so it may vary

    1) Create a interrupt that checks a digital input linked with your sensor and calls a specific procedure. Declare this interrupt at the main level.

    2)Create a subprogram were you activate the interrupt and move the robot in all direction you want.

    3)Inside the specific procedure, write the command BRAKE in the first line. Write some other code if you need, then end the procedure with RESUME.

    Doing like this, after the interrupt procedure has been called, the pointer should be resumed at the main program level: the current movement, started at the subprogram level, interrupted by the digital input, wont be completed

    [...] I've also had some luck loading points from a text file, which could be as large as you like -- the UserFiles directory has several GBs of free space. Both of these require some careful programming to get the timing right and avoid stop&go motions, but it's been done.

    Hello SkyeFire

    I'm facing this issue of limited memory space in the R1 directory (KRC4, KSS 8.3).

    The solution I've implemented at the moment is using EKI to stream data, but it would be very helpfull to know how to use txt files saved in the user directory (and also avoid stop&go motions).

    Could you give me some tips on how to do it?

    Thank you anyway

    I want to know what o_file[] is when it come to configure the external module ,how to modify it and according what to modify, introduction about cread/cwrite in application of profinet and ethernet/ip all mentioned this O_file,so i want to konw what its mean? and also the iodriver,iodrvname in the first picture,how to change it?thankyou foryour time ,i will appreciate your answer,thank you !attachment is the picture the manual says!!!

    Hello astonhan

    did you find a solution? I'm also trying to configure an external module but I can't find any information about how to do it

    Thank you!