Internet PLC Forum

General => Technical support => Topic started by: skj1402 on November 27, 2005, 12:21:48 PM

Title: High Speed Counter Variable access?
Post by: skj1402 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? ???

Title: Re:High Speed Counter Variable access?
Post by: support 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
Title: Re:High Speed Counter Variable access?
Post by: plc_user 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.