RobotStudio event

String limit

Hello everybody!
I need to define a certain number of strings so that, whenever an error happens, the message contained inside the string can be displayed on the teach pendand.
The problem is that if I try to uncomment the bond lines, RS tells me that there are 12 sintax errors. Anybody can tell me why? Is there a limit for the number of strings that can be declared?

Thank you very much :)

Attached the code:

    PROC select_language()
        TPReadFK reg1,"Please select the desired language:",stEmpty,stEmpty,stEmpty,"English","Turkish";        !select language
        IF reg1 = 4 THEN
            error_code1 := "This code does not correpond to any rivet1 type!";
            error_code2 := "This code does not correpond to any rivet2 type!";
            vacuum_error1 := "Vacuum has not been correctly generated on gripper 1!";
            vacuum_error2 := "Vacuum has not been correctly generated on gripper 2!";
            place_error1 := "Rivet 1 still attached to gripper 1!";
            place_error2 := "Rivet 2 still attached to gripper 2!";
            rivet1_uncorrect := "Rivet 1 code has not been received correctly!";
            rivet2_uncorrect := "Rivet 2 code has not been received correctly!";
        ELSEIF reg1 = 5 THEN
            error_code1 := "Bu kod herhangi bir perçin 1 tipine karsilik gelmez!";
            error_code2 := "Bu kod herhangi bir perçin 2 tipine karsilik gelmez!";
            vacuum_error1 := "Vakum, tutucu 1 üzerinde dogru sekilde olusturulmadi!";
            vacuum_error2 := "Vakum, tutucu 2 üzerinde dogru sekilde olusturulmadi!";
            place_error1 := "Perçin 1 hala tutucuya takili 1!";
            place_error2 := "Perçin 1 hala tutucuya takili 2!";
!           rivet1_uncorrect := "Perçin 1 kodu dogru sekilde alinmadi!";
!           rivet2_uncorrect := "Perçin 2 kodu dogru sekilde alinmadi!";
        ENDIF

Comments

  • I just tried this in RS, no errors:

    MODULE TEST1
        VAR string error_code1;
        VAR string error_code2;
        VAR string vacuum_error1;
        VAR string vacuum_error2;
        VAR string place_error1;
        VAR string place_error2;
        VAR string rivet1_uncorrect;
        VAR string rivet2_uncorrect;
        
        PROC select_language()
            TPReadFK reg1,"Please select the desired language:",stEmpty,stEmpty,stEmpty,"English","Turkish";        !select language
            IF reg1 = 4 THEN
                error_code1 := "This code does not correpond to any rivet1 type!";
                error_code2 := "This code does not correpond to any rivet2 type!";
                vacuum_error1 := "Vacuum has not been correctly generated on gripper 1!";
                vacuum_error2 := "Vacuum has not been correctly generated on gripper 2!";
                place_error1 := "Rivet 1 still attached to gripper 1!";
                place_error2 := "Rivet 2 still attached to gripper 2!";
                rivet1_uncorrect := "Rivet 1 code has not been received correctly!";
                rivet2_uncorrect := "Rivet 2 code has not been received correctly!";
            ELSEIF reg1 = 5 THEN
                error_code1 := "Bu kod herhangi bir perçin 1 tipine karsilik gelmez!";
                error_code2 := "Bu kod herhangi bir perçin 2 tipine karsilik gelmez!";
                vacuum_error1 := "Vakum, tutucu 1 üzerinde dogru sekilde olusturulmadi!";
                vacuum_error2 := "Vakum, tutucu 2 üzerinde dogru sekilde olusturulmadi!";
                place_error1 := "Perçin 1 hala tutucuya takili 1!";
                place_error2 := "Perçin 1 hala tutucuya takili 2!";
                rivet1_uncorrect := "Perçin 1 kodu dogru sekilde alinmadi!";
                rivet2_uncorrect := "Perçin 2 kodu dogru sekilde alinmadi!";
            ENDIF
        ENDPROC
    ENDMODULE

    Lee Justice