Author Topic: High Speed Counter Variable access?  (Read 9973 times)

skj1402

  • Newbie
  • Posts: 28
  • The Innovator!
    • View Profile
High Speed Counter Variable access?
« on: November 27, 2005, 12:21:48 PM »
From within the simulators 'View Variables' table, you can view the incrementing count of a HSC input (say #1). But how do you gain access to that variable count from within TBasic?

What I would like to do is display the contents of the HSC1 output to the LCD display in a dynamic real time fashion (as seen from within the above table). Can you please advise how I can do this? ???


support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:High Speed Counter Variable access?
« Reply #1 on: November 27, 2005, 01:13:38 PM »
The HSC present value is available to TBASIC as a variable: HSCPV[1] to HSCPV[2].

To display its value on LCD, you can do the following:

   SETLCD 1,1, STR$(HSCPV[1],8)  ' display 8 digits of HSCPV
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

plc_user

  • Guest
Re:High Speed Counter Variable access?
« Reply #2 on: November 30, 2005, 08:03:49 PM »
Don't forget in the simulator to adjust the high speed counter variable to see a value other than 0.

From the view variable table there is a place to edit variables.
Type HSCPV[1]=199,20, etc.

You will be able to see how it looks after using the information that support left you from the previous post.