SETLED n, m, value

Purpose

To display the integer value on the PLC's built-in 7-segment LED displays, starting from the nth digit and occupying m number of digits. Leading zeros will be added to the left of the display if value occupies less digit than that specified by m.

However, if m is less than 1 (e.g. m = 0) then value is treated as a single 8-bit ASCII character to be displayed rather than as a numeric value. Special symbols may be displayed on the LED panel if the LED driver is able to display the corresponding ASCII character.

n must be between 1 to 16. The digit position is counted from left to right. i.e. the leftmost LED digit is digit #1. TRiLOGI supports up to 16 LED digits. The actual number of LED on the PLC may vary from 0 to 16, in this case only the available digits will be effective. Value may be a 16- or 32-bit integer number. Once set, the LED display will latch the set value until the next SETLED statement on the same digit is executed. On the TRiLOGI simulator, the result of the SETLED is displayed together with the Special Variables screen, which may be viewed by pressing the <V> key while in the simulation mode.

Examples SETLED 5,4,89
Comments: LED digit #5 to #8 (counting from left to right) displays 0089.

backbutton.gif (507 bytes)  Basic to TBASIC Reference Manual