Post by open on How to create a stopwatch?
CODESYS Forge
talk
(Post)
Hi @ph0010421, I tried the program the TimeTaken is calculated when stop is triggered. I want the TimeTaken to be continuously calculated and counting when a BOOL variable is true. I tried to program this way: Declaration: PROGRAM PLC_PRG VAR bStartStop: BOOL := FALSE; // Start/Stop button bReset: BOOL := FALSE; // Reset button bRunning: BOOL := FALSE; // Flag indicating whether the stopwatch is running tStartTime: TIME; // Variable to store the start time tElapsedTime: TIME; // Variable to store the elapsed time END_VAR Implementation: // Main program logic IF bReset THEN // Reset button pressed, reset the stopwatch bRunning := FALSE; tElapsedTime := T#0s; ELSIF bStartStop THEN // Start/Stop button pressed, toggle the running state IF bRunning THEN // Stop the stopwatch bRunning := FALSE; ELSE // Start the stopwatch bRunning := TRUE; tStartTime := tElapsedTime; END_IF; END_IF // Update the elapsed time when the stopwatch is running IF bRunning THEN tElapsedTime := tElapsedTime + T#1s; // Adjust the time increment as needed END_IF However counting of the seconds is not accurate. I tried changing the main task cycle time interval to 1000ms. The counting of seconds become slower. (see attached) Please help
Last updated: 2023-12-08
Post by t-roger on Beckhoff EL6652-0010 with Codesys
CODESYS Forge
talk
(Post)
Hi, I have the same problem. Have you found a solution to this problem? t-roger
Last updated: 2025-03-20
how to make a real time CLock
CODESYS Forge
talk
(Thread)
how to make a real time CLock
Last updated: 2011-05-25
Time Measurement between two events with V2.3 using Wago750-890
CODESYS Forge
talk
(Thread)
Time Measurement between two events with V2.3 using Wago750-890
Last updated: 2020-12-26
CNC Jumps G20 - SMC_NCInterpreter and long time to process
CODESYS Forge
talk
(Thread)
CNC Jumps G20 - SMC_NCInterpreter and long time to process
Last updated: 2024-08-03
Calculate Time Between Two Events Using RTC
CODESYS Forge
talk
(Thread)
Calculate Time Between Two Events Using RTC
Last updated: 2024-08-14
Temu Coupon Code $100 Off [acr639380] First Time User
CODESYS Forge
talk
(Thread)
Temu Coupon Code $100 Off [acr639380] First Time User
Last updated: 2024-10-18
Control Win one instance at a time
CODESYS Forge
talk
(Thread)
Control Win one instance at a time
Last updated: 2024-10-25
Control Win one instance at a time
CODESYS Forge
talk
(Thread)
Control Win one instance at a time
Last updated: 2024-10-25
Control Win one instance at a time
CODESYS Forge
talk
(Thread)
Control Win one instance at a time
Last updated: 2024-10-25
Control Win one instance at a time
CODESYS Forge
talk
(Thread)
Control Win one instance at a time
Last updated: 2024-10-25
Temu coupon code $100 off [acp856709] first time offer
CODESYS Forge
talk
(Thread)
Temu coupon code $100 off [acp856709] first time offer
Last updated: 2024-10-25
Temu Coupon Code $100 Off [acu934948] First Time User
CODESYS Forge
talk
(Thread)
Temu Coupon Code $100 Off [acu934948] First Time User
Last updated: 2024-10-25
Temu Coupon Code $100 offβ§ [act892435] for First-time Users
CODESYS Forge
talk
(Thread)
Temu Coupon Code $100 offβ§ [act892435] for First-time Users
Last updated: 2024-10-26
Temu Coupon Code [acu577459 & acq615756] first time customers
CODESYS Forge
talk
(Thread)
Temu Coupon Code [acu577459 & acq615756] first time customers
Last updated: 2024-10-26
Temu Coupon Code [acr552049 & acq615756] first time customers
CODESYS Forge
talk
(Thread)
Temu Coupon Code [acr552049 & acq615756] first time customers
Last updated: 2024-10-26
Temu Coupon Code 90% Off [acq615756] for First-Time Users
CODESYS Forge
talk
(Thread)
Temu Coupon Code 90% Off [acq615756] for First-Time Users
Last updated: 2024-10-26
Temu Discount Code UAE β£ ["^"acr900074"^"] for First-time Users
CODESYS Forge
talk
(Thread)
Temu Discount Code UAE β£ ["^"acr900074"^"] for First-time Users
Last updated: 2024-10-26
Temu Discount Code Romania βΉ ["^"act900074"^"] for First-time Users
CODESYS Forge
talk
(Thread)
Temu Discount Code Romania βΉ ["^"act900074"^"] for First-time Users
Last updated: 2024-10-26
[30% off] Temu Coupon Code β€ [acr900074] for First-time Users
CODESYS Forge
talk
(Thread)
[30% off] Temu Coupon Code β€ [acr900074] for First-time Users
Last updated: 2024-10-26
Temu Discount Code Chile β» ["^"acq615756"^"] for First-time Users
CODESYS Forge
talk
(Thread)
Temu Discount Code Chile β» ["^"acq615756"^"] for First-time Users
Last updated: 2024-10-26
Post by nz-dave on MC_HOMING
CODESYS Forge
talk
(Post)
also get this error in place of the other from time to time.
Last updated: 2025-04-04
Symbol Configuration to be Build every time!
CODESYS Forge
talk
(Thread)
Symbol Configuration to be Build every time!
Last updated: 2025-05-23
Post by totorovic on Project loses 'Download time' information
CODESYS Forge
talk
(Post)
Nobody knows how to modify the download time information ?
Last updated: 2025-07-24
Medical Billing Time Limits in California and Washington Explained
CODESYS Forge
talk
(Thread)
Medical Billing Time Limits in California and Washington Explained
Last updated: 2025-09-03
To search for an exact phrase, put it in quotes. Example: "getting started docs"
To exclude a word or phrase, put a dash in front of it. Example: docs -help
To search on specific fields, use these field names instead of a general text search. You can group with AND or OR.