Viewing System Variables
TBASIC has many internal numeric and string data which can be easily examined by clicking the . button on the Simulation or Monitoring screen. When you are in On-Line Monitoring mode, the data shown are the "real-time" data captured from the PLC (of course, subject to some communication and network delay) and will be updated periodically.
These variables are organized into 4 screens which can be scrolled by by clicking on the buttons or by pressing the left/right cursor keys. On some screens that span more than one page, you can scroll from page to page by clicking on the buttons or by pressing the <PgUp><PgDn> keys.
Numerical data can be viewed either in Decimal or Hexadecimal format. You can switch to the Hexadecimal format by clicking on the button or by pressing the <H> key.
Finally, the button (or the <E> key) allows you to make changes to any internal variables. When you are in On-Line Monitoring mode, the changes are written into the PLC. This may be useful if you need to make temporary changes to some of the PLC's data (e.g. set some parameters) without altering the program. It also helps in debugging your PLC software by allowing you to force some value to see the effect on the program. When you click on the button, a window will open to prompt you to enter the desired changes:
You must enter the values for the
variables in an assignment format as follow:
|
1. View Integer Variables A to Z and ADC/DAC/PWM, RTC etc
Note:
2. View Float-point Variables
This is the second view variable screen which displays the floating-point variables A# to Z# as well as the 1000 floating-point array FP[1] to FP[1000]
You can click on the "PgUp" or "PgDn" button on the screen or use the "PgUp" and "PgDn" keys on your keyboard to scroll through all the pages to view all 1000 FP[ ] variables.
The third button: "IEEE" - let you switch the view of the values of these floating-point variables between human readable decimal format and their actual IEEE 32-bit single precision format. In IEEE mode these values are displayed as 8 characters of hexadecimal digits. IEEE defines some bits as mantissa and some as exponent in order to use 32-bit number to represent a wide range of float values.
If you are interested in seeing how the floating-point values are represented in IEEE format you can use the following online calculator to verify the data you observe on the screen:
Note: "Local Variables" as described in the "Floating-point Constants Variables and Operators" cannot be viewed from the View Variable screen as they are not global variables and hence their data changes from one custom function to another during program execution. The only way to view the local variables is to put a break point in a custom function and when the program stops at the break point with the custom function opened, the local variables can then be viewed from within the custom function editor. Please click here to view more details.
3. View Data Memory DM[1] to DM[4000]
4. View String Variables A$ to Z$
Note:
5. View System Variables (Input[n], Output[n], Relay[n], Timer[n], Ctr[n], emInt[n], emEvent[n], emLint[n])
Note: