Beckhoff TwinCAT3 training course project question

technolog

Lifetime Supporting Member
Join Date
May 2015
Location
Ohio
Posts
315
I did a Beckhoff TwinCAT3 motion training course a couple of months ago. To be honest, it was a little tough going as it was my first sight of Beckhoff and I could have used a more elementary course first. Added to that, I'm getting older :) and I'm struggling to retain new information.

I'm reviewing the training programs we worked on and I'm having difficulty understanding one part and wondered if some kind soul would take a look.

I've uploaded the solution archive here:

https://file.io/YUPOFu

My question is this; the visualizations use a structure of type ST_HMI_Axis. I can see it's instantiated in the Interface Editor tab of the VISU VFM_Axis_Ctrl:

VAR_IN_OUT
stHMI_Axis: ST_HMI_Axis;
END_VAR

However, that's the only place I can see it. The POUs (P_Axis1 & P_Axis2) use a variable gHMI.Axis_1 (also a structure of type ST_HMI_Axis) to pass the HMI data to the program. It must be the same data, coming from the visualization but I cannot see how stHMI_Axis is linked to gHMI.Axis_1 & gHMI.Axis_2. Could someone explain the mechanics to me, please?
 
Also I am little bit confused with the interface editor and I am not able to open your sample prog at the moment. However have you already tried to find all references to the structure? Go over the Var with your mouse, right click and choose find all references. By this way you should be able to find where values to those variables are written.
 
Sorry. It appears the site I chose to host the file deletes it as soon as it's downloaded once. I can't do it at the moment but hopefully, later, I'll pick a different site. Thanks for replying.
 
I'm not very knowledgeable about visualizations in TwinCAT but I think I found your missing link. The VFM_Axis_Ctrl visualization uses the local stHMI_Axis variable; this Visu is then instanced twice in VIS_Main to display both axes. If you click on one of these instances in VIS_Main and look under References in the Properties pane, there is a field where stHMI_Axis looks to be linked to the global gHMI.Axis variables.

visu.PNG
 
Bingo!

If you're not very good, what does that make me? Don't answer that. Thank you. I knew there had to be a link, I just couldn't find it, but it makes perfect sense now.
 

Similar Topics

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
5,975
Hello, I would like to know if anyone can tell which Library under Twincat3 (VisualStudio IDE) is assigned to get runtime information about free...
Replies
1
Views
1,198
I'm new to TwinCAT3 and I've been searching for a tutorial on object-oriented programming. I've seen this link on Beckhoff's Infosys site but was...
Replies
2
Views
2,768
TwinCat3 Beckhoff "Add route to remote system failed ADS Error 1804 (0x70C)" Hi everyone, I have a problem connecting with a Beckhoff CX5120...
Replies
4
Views
39,674
Hi everyone, This is my first time posting, so please forgive any omissions or mistakes. I am attempting to control the velocity of a stepper...
Replies
18
Views
741
Back
Top Bottom