Beckhoff EL5151 and EL5101 64bit timestamp to CX8090

g.mccormick

Lifetime Supporting Member
Join Date
Jul 2012
Location
IN
Posts
961
I am going to attempt to use a EL5151 and EL5101 to read a torque flange (freq output) and encoder. I need to be able to do calculations that will calculate a moving average of the torque flange and the motor speed based on motor revolutions. To increase the accuracy of these calculations, I am wanting to utilize the timestamp for the EL modules as well as the count values.

Basically when the calculation is triggered, I want to calculate the delta counts and delta time from last calculation. The timestamp is a 64bit number. So far I have found that including the TcUtilities.lib and creating the variables as follows:
n_Trq_Inpt_Nanotime AT %I*: T_ULARGE_INTEGER;
n_Trq_Inpt_Lastime : T_ULARGE_INTEGER;
n_Trq_Inpt_Deltatime: T_ULARGE_INTEGER;

I have been able to link the Timestamp from the 5151 to n_Trq_Inpt_Nanotime.

I have created a quick calculation as:
n_Trq_Inpt_Deltatime := UInt64Sub64(ui64a:= n_Trq_Inpt_Nanotime, ui64b:= n_Trq_Inpt_Lastime);

I have build this without error. My question is now what? This will leave me with a relatively small value in n_Trq_Inpt_Deltatime as a 64bit ULARGE. For me to do other calculations with that, I really need it in a 32 bit correct? Is there anyway to convert the value to a different value that is 32bit?
 

Similar Topics

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
1,004
Hello sameone have Beckhoff PLC Siemens Sinamics V90 configuration example?
Replies
0
Views
99
hello, I am using Beckhoff with TwinCAT3 and when I change or add some new hardware or for any reason, there is a mismatch in the real hardware vs...
Replies
1
Views
126
I have a Beckhoff CX7000 IPC with some digital I/O built-in and I additionally need two analog inputs 0-10V. Can I install both Ethernet terminals...
Replies
4
Views
207
Hello, We are currently working on a project that involves connecting a linear potentiometer to our Beckhoff PLC. After researching, we...
Replies
2
Views
197
Back
Top Bottom