I have a string variable that contains the name of an external variable. How can I use the value of that string to get the proper value from the external?
The pseudocode of what I'd like to do is here
Code: Select all
PROGRAM someProgram
VAR
someString : STRING[50];
someWord : WORD;
END_VAR
VAR EXTERNAL
someExternalA : WORD;
someExternalB : WORD;
END_VAR
someString := 'someExternalA';
someWord := SOMEGET(IN := someString); //GET THE VALUE OF someExternalA
someString := 'someExternalB';
someWord := SOMEGET(IN := someString); //GET THE VALUE OF someExternalB
END_PROGRAM
Code: Select all
someWord
Code: Select all
someString
Code: Select all
SOMEGET(IN := someString);
Thanks