beckhoff cx1000 task help

moonglaive

Member
Join Date
Jul 2009
Location
Wuhan
Posts
8
I am now using cx1010,but confusing about its task configuration.Can anybody send me a little program using event trigger task?

Other question,if I set cycle time to 10ms,does it mean that after 10ms, even the program not finished, it will restart from the beginning?

my email: [email protected]

thanks
 
Last edited:
Hi Moonglaive,

Are you programming a PC? (The following description describes a PC, not BC)

Tasks in TwinCAT are cyclic, not event oriented. When the task is scheculed to run at 10 ms (The default), it will run once during that time, and wait for the next 10 ms time to run again.

If the program does not finish in 10ms, then, there is an "Overrun", this error is counted, and displayed in the System Manager.

Thanks,
Steve
 
The man Steve arises! Good to see you on the board ol' buddy! You're probably a TwinCat/CoDeSys expert by now.

Joe_WaZoo
 
Yes,the program is running on PC.Now,I encounter a new problem.When I use the GETCPUCOUNTER function, the time I get goes all the time.It never stops or can be reset.HOW can I use this block to finish a timing task?

An easy problem is:

when a pulse signal(cycle 20ms) input at time A,after time B,send the pulse signal out.

I am wondering that using GETCPUCOUNTER,the time B can be precise in 1us.HOW can I do that?

Thanks for reply.
 
Last edited:
the precision when using 20 ms is 40 ms and not us that is impossible on a pc or a plc.
events are possible make a task in the configurator and in this task set an event to happen.
next is where the program can find the subroutine.
 
I think there must be some internal timing in the CX series. The manual instructs that the time can be precise in 100ns when using the function GETCPUCOUNTER.So can time A be recorded sometime and after a specify time B, the event will be done?
 
The code executes every 20ms, so that is the limit of the resolution of the timing of any 'events' you capture. It is possible to set the task time down to say 0.5ms to improve your resoloution, and provided the i/o is configured correctly this will work. If you need microsecond resoloution, you need to use EtherCAT terminals that support the distributed clock functionality to time-stamp your samples.
Roger
 
I use TwinCAT timer functions to get absolute time, rather than count PLC cycles, which is what you appear to do. It returns the time when the call is made, which sounds like 20 ms intervals for you. A couple of possibilities:

1. Most counter functions return a 64-bit answer as two 32-bit variables. Your program has to combine them appropriately. You may be looking only at the low word, which is why you see the answer jumping around erratically. Someday, TwinCAT will have 64-bit variables and this issue will go away (IEC6113-1 defines them). Sorry I cannot currently view my PLC code and forgot if I call GETCPUCOUNTER or a related function.

2. Are you calling the counter function from multiple SFC blocks? Each SFC block holds until the next PLC cycle before flowing thru the output gate, i.e. each block takes at least 20 ms.
 

Similar Topics

Hi all! I was wondering if that serial port is available for user programming, or is it only for debug purposes? I have tried to google tutorials...
Replies
2
Views
2,295
Help wanted !! I have a Beckhoff CX1000 with Windows XP installed. On a laptop i have installed TwinCAT PLC. From the Laptop I perform a...
Replies
1
Views
3,596
Unregistered
U
Hi, I'm trying to import a Rockwell/AB EDS to Beckhoff but I'm not sure how to import/install the EDS. It is a PowerFlex 525 EDS. Is there a way...
Replies
1
Views
90
I'm trying to integrate a Beckhoff IPC with a Controllogix PLC. There is some documentation, on the Beckhoff website, on how to do a PLC-PLC comms...
Replies
0
Views
100
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,067
Back
Top Bottom