Posts by Zadok the priest

    Hello everyone,


    I use KR300-2700

    Controller KRC4

    KSS Version : 8.6.7


    I want to create a dynamic string name with using a variable. I could not find which operand should I use to combine variable with a string.



    I mean, my variable name is fileName and it holds “Test” string as :


    fileName = “Test”



    I want to combine fileName variable with “.txt” string but which operand should I use instead of & or +


    CWRITE(“krl_fopen”, .. , … “ Test ”<whichoperand> .txt”, …. )


    I wanna use in this line that operand.


    Could you help me about that topic? Thank you in advance!

    Hello everyone,


    I use KSS 8.3.42 Version.


    I have a problem with signal decleration variable. My problem : I defined new signal variable like :


    Code
    SIGNAL pieceCounter $IN[65] TO $IN[72]


    And I wanna use that signal variable like:


    Code
    pieceCounter = pieceCounter * 6 ------- And KSS gives me error. "Write Protection ......"


    I said okay with that error message. I define new variable and I try to assign signal variable is like:


    Code
    DECL INT pieceCounterz
    .
    .
    pieceCounter = pieceCounterz
    pieceCounterz = pieceCounterz * 6
    
    
    for i = 1 to pieceCounterz STEP 6 

    That code gives me write-protection error again.


    My question is : How can I use the values of signal declaration variables ? Or how can I assign these values to another variable?


    Thank you in advance !

    Yes, that is an option of course. However, like said panic mode, this option will be too much of a burden for me in terms of software, algorithm and controlling many things. Thank you so much for suggestion.

    1 - you may want to check the manual for directory loader. it i recall there are some limitations.

    2 - that is possible (check mounting of volume). not really worth the effort if you ask me.

    3 - several examples (including ones from me) are already shared. basically open file, read from file, close the file. you can try to parse the values immediately in CWRITE or separately using SREAD. both are very similar but SREAD is a bit more flexible and forgiving.



    Thank you for your great example, panic mode. I used that piece of code and it is working. However, I want to assign that read values to variables. I added a few line to your example code.


    The number of coordinates that will come to me from outside will be able to change. In other words, 4 coordinate lines can come, 15 coordinate lines can also come.


    If you noticed this code that I added, it is possible to process 3 lines of coordinate information. I want to make this code dynamic. In other words, it needs to create as many variables as the number of coordinate lines that will come from the outside and write the value into it.


    When I send 2 coordinate lines instead of 3 in the .txt file that the current code is reading, my code stuck line 37 -wait for condition. Since there are already two lines of coordinate information and the reading is over, it shouldn't be stuck there, right?. How can I prevent this? We can accept the maximum coordinate line that will come to me from the outside as 100. Is there any chance you can help me with this problem I described?


    Thank you in advance.

    Thank you for your quick answer hermann.


    1. Yes, but you need an option 'directory loader' (Iirc), but have no idea how you want to write those files with your Siemens plc.


    1- Actually, my external device is not siemens plc. I use windows-based pc. So, using the 'Directory loader' package, I can update the .src and .dat files that I call within the code, even though the robot program is not stopped and robot automatic (only AUT mode) running?



    2- Okay, i will update files over a windows share. [C:/KRC/ROBOTER/UserFiles/] Is this the path where I need to create the file? Can I use another path?


    3- Also, I read CWRITE/CREAD doc. However, i couldn't understand brightly.


    My coordinates points are : x,y,z,a,b,c


    Mytest.txt:


    154.6, 177.4, 196.8, 57.4, 87.6, 71.3

    1444.6, 557.3, 196.8, 57.4, 88.0, 66.8

    1665.4, 544.7, 196.8, 77.5, 74.3, 65.1


    For example mytest.txt file has a 3 line info about coordinates. I want to read these points and then seperate them. Could you give me example about that ? I want to read from "[C:/KRC/ROBOTER/UserFiles/Mytest.txt]"


    Thank you in advance...

    Hi everyone,


    I am new on the KUKA.


    KUKA side:

    - KSS 8.3.42

    - KR300 R2500

    - Profinet&Profisafe 3.2.4 - package


    PLC side:

    - S7 1511 TF

    - TiaPortal v15


    Note : I have no safety interface board. I am using Profisafe communication for safety.


    Now, I guess i am in trouble with that content. I have profinet communication. And my work is sorting project. The coordinates of the objects I will sort will be sent to me from outside. And the coordinates of all these pieces are sent to me at once. Maybe 10 pieces, maybe 20 pieces. My questions are:


    1- Is it possible to import .dat and .src files from external device directly to the robot while the robot is running in automatic mode?


    2- When i researching in this perfect forum, i saw that CWRITE/CREAD functionalities. When i examined that documents, i have to do CREAD function for reading file where is in the UserFiles folder. Is it possible to read over Profinet connection ? And also, Can external device create files to this folder?


    3- And in the other hand, when the robot in auto mode, can external device create a new .dat files in R1/Program folder ? And Can this file be updated ? Or is there any other way ?



    If all these questions get negative answers, Please can you suggest the most logical and applicable solution to solve this problem?


    Thanks in advance sir!..