Twincat3 value of variable pointed by string

mrburns

Member
Join Date
Mar 2022
Location
sjoki
Posts
2
Hi,
In Twincat3 x64 is it possible to get value of variable of which name is read from a string variable?

Code:
VAR
VAL1             :REAL:=555;
POINTER          :STRING:= 'VAL1'; 
RESULT           :REAL;
WORKS            :BOOL;
END_VAR

<ST>
RESULT := GET_THE_VALUE(POINTER) // WE WANT THE VAL1 VALUE 555 SOMEHOW

IF RESULT == VAL1 THEN
        WORKS := TRUE;
END_IF;
</ST>
 
No, not with structured text as far as I know. Maybe elaborate on what you are trying to achieve, there might be some other solutions to the problem.
 
Ok. Thanks. This was not important. I was just testing things. Somehow I just thought that this might have been possible. I have done something like that when using serial connections between python programs and arduinos.
 

Similar Topics

Good afternoon all I'm having some troubles trying to go online with a twincat3 project that has been developed with another laptop (I will call...
Replies
1
Views
1,567
Today I had first time experience to troubleshoot Twincat3 project, that has motion control and is semi complicated and it was project not done by...
Replies
3
Views
1,478
Hello I'm programming a project in TwinCat3. I'm not new to programming but I have never really programmed anything too complex. I want to...
Replies
3
Views
1,732
So for my senior design project in electrical engineering my group and I are designing an inspection system using twinCAT3 as the basis of the...
Replies
4
Views
1,824
Hey Everyone, hope everyone is safe and healthy. So I got my hands on the following hardware. I have no experience in programing in ST and...
Replies
13
Views
6,049
Back
Top Bottom