Sign in to follow this  
Followers 0
Marco8037

Get Date and Time of an exter HMI on a variable on Twincat

1 post in this topic

Hello all. I'm making a program where I use an HMI from exter to be connected to a PLC from Beckhoff. I am using the information designer to programme the HMI, twincat for the PLC and the beckhoff ads protocol to comunicate between the 2 equipments. I don't know yet what kind of PLC I am going to use, but I would like to get the actual date and time (of the HMI) on a variable to use on twincat. If I declare on twincat a global variable like this: Variable_date: DATE_AND_TIME; And if I import the variables from the rebuilded file on twincat, I cannot see the the variable "Variable_date" on the list of imported variables. Since the value on a DATE_AND_TIME variable is stored in secconds as an UDINT variable, begining from 1970/01/01 at 00h00m00sec., I could also declare the same variable as an UDINT variable to solve my problem. (An UDINT variable is imported successefuly). However, my question is: How can I write on that variable the actual date and time of the HMI terminal? If the variable "Variable_date" is declared as an UDINT variable I do the following on Information designer: Then, I have iserted an analog numeric: Then, I have filled the analog signal with the same variable: After this, I have run the HMI programme: I was expecting to see some numeric value on the analog numeric that I have created. However the shown value is 0. Does anybody know what am I doing wrong? Or does anybody know an easiest way to do this? Thanks very much. Marco Nunes

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0