Beckhoff BC start up

Jon R

Member
Join Date
Jan 2007
Location
Tadley
Posts
206
:unsure:

I am trying to detect the start of a BC controller, from a stopped condition(not a full restart) but there is no function available in the standard library.

I have implemented the GetSysTick function, which increments every 1ms, and then I will use this to do a compare. Only problem is when I run my project, the value of the variable I point at the function does not increase.

My line calling the function is below, with isystem_tick declared as a DWORD:

isystem_tick := GetSysTick(bDummy);

The variable bDummy is always set true by declaring it in VAR as:

bDummy : bool := true;

Has anyone got any ideas, or used this before? I am feeling particularly blonde about this, I must be missing something.


Jon.
 
Last edited:
I cant't remember at the moment if a BC has a real-time clock. That is the only method I can think of: read RTC at the beginning of each scan and compare the reading with the stored value from the previous scan.

When you stop the code execution, everything in essense freezes so there is no way to detect the changes. The RTC, however, should still be ticking, regardless of the code execution. If present, of course.
 
Yes there is an RTC block in the TcPlcUtilitiesBC.

I thought the GetSysTick may be easier to implement as it should function in the same way, but I shall try the RTC instead.

Thanks,

Jon.
 
Hi Jon R, The BC9000 has no battery backup for the RTC, so it must be read from an ADS server on powerup. If you have a TwinCAT PC anywhere on the network you should be set, otherwise you'll need a BX or higher. PM me if you'd like some sample code for RTC read function.
 
Problem solved.

GetSysTick does not work in simulation mode o_O.

It does exactly what I want. It is reset to zero on a full reboot and continues incrementing when stopped so a simple compare will do the job.

That was an extreme blond moment. Thanks to LadderLogic and Steve for their input.

Jon.
 

Similar Topics

Here is a How To video showing how to install, configure, and run TwinCAT for for anyone that has never used it before. It is only 6 minutes...
Replies
1
Views
10,685
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
947
Hello sameone have Beckhoff PLC Siemens Sinamics V90 configuration example?
Replies
0
Views
91
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
119
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
201
Back
Top Bottom