Advertising

Variable Name Changing

  • Hello,


    KSS 8.3, KRC4


    I was wondering if there was a way to call a variable name and then change this name mid program. For example, lets say I have 4 arrays and each have 10 elements in side of them. Each element corresponds to a feed rate in a SLIN_REL move.


    DECL REAL TESTARRAY1[10]
    DECL REAL TESTARRAY2[10]
    DECL REAL TESTARRAY3[10]
    DECL REAL TESTARRAY4[10]


    FOR R = 1:4
    FOR S = 1:10
    SLIN_REL {X 1.5} WITH $VEL.CP=TESTARRAY1(S) C_DIS
    ENDFOR


    ******


    ENDFOR


    I would like to be able to include some code where I have the ****** to change TESTARRAY1 TO TESTARRAY2.


    Is there any way to create a string of the variable name and then use that to call the data that is stored behind that variable name?


    I have read something along these lines when using the VAR_STATE command, where its input is the actual string variable name.


    Thank you!

  • AD

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now