Store PLCnext CommunityPLCnext on LinkedInPLCnext on Instagram  PLCnext on YouTube Github PLCnext CommunityStore PLCnext Community

  1. gian.flores
  2. PLCnext Technology & PLCnext Controls
  3. Tuesday, 27 July 2021
On PCWorx, I am able to access two system variables PLC_TICKS_PER_SEC and PLC_SYS_TICK_CNT. How can I get access to these two variables on the plcnext?
Accepted Answer
Stefan Brinkmann Accepted Answer Pending Moderation
0
Votes
Undo
As Martin has described it is possible to use the TickCount parameter in C# and output it via a function block (see attached image).
Attachments (1)
Stefan Brinkmann Accepted Answer Pending Moderation
0
Votes
Undo
The variables still exist in PLCnext Engineer but are no longer supported. The value is always 0. They are part of the ESM_DATA variable (see image).

Have a look at this post: https://www.plcnext-community.net/en/discussions-2-offcanvas/tick-count-not-incrementing.html#reply-2531
Attachments (1)
gian.flores Accepted Answer Pending Moderation
0
Votes
Undo
Stefan Brinkmann could you please show how to create a tick counter using a timer.
Stefan Brinkmann Accepted Answer Pending Moderation
0
Votes
Undo
Hello Gian,
the simplest way is to create a cyclic task with e.g. 1 ms cycle time and increase a variable in each cycle. This variable is unfortunately not as precise as the PC Worx variable but this is as close as you can get in PLCnext Engineer.
The second option is to create a fast trigger signal via timers and increase the counter with a rising edge of that signal. With the TON_LTIME FBs, times below 1ms can be specified (see attached image).
Attachments (1)
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo
There is also an Environment.TickCount Property listed in the eCLR Programming Reference, that represents "the amount of time in milliseconds that has passed since the last time the computer was started."
Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.