Author Topic: can't use tbasic  (Read 14187 times)

sparks32

  • Newbie
  • Posts: 22
  • I'm a llama!
    • View Profile
can't use tbasic
« on: May 28, 2013, 10:37:21 AM »
hi guys i can't get my head around t basic', what is the t basic's closest relative popular programming language? just so i can get a step by step guide for dummy's then try to switch over to t basic's unique key words and stuff. i have no problem with ladder logic  

garysdickinson

  • Hero Member
  • Posts: 502
  • Old PLC Coder
    • View Profile
Re:can't use tbasic
« Reply #1 on: May 28, 2013, 05:32:06 PM »
If by "closet relative popular programing language" you mean "modern programming language" or a programming language that if you knew you could get hired as a programmer, then you are out of luck.

TBASIC is close to early integer BASIC that shipped with the the Apple II, TRS-80, the Commodore and the 4k Basic written by Bill Gates to run on 8080 based home built computers.

It is hard to find much documentation.  This is a link to the Commodore BASIC:

http://www.commodore.ca/manuals/pdfs/Commodore_Basic_4_Users_Reference%20Manual.pdf

Unfortunately there are big differences between these early integer BASIC languages and TBASIC.  The biggest differences that I see are:

  • TBASIC does not have an "immediate mode".  If you type in a TBASIC statement without a line number, it is not immediately executed. To test things you must compile the TBASIC program and either run it under the simulator or download the complied version to actual PLC hardware.
  • TBASIC only requires line numbers as a target of a GOTO. This behavior is closer to QBASIC that shipped with PCs running MSDOS.
  • TBASIC operates with 32 bit integers. The Commodore, Apple II, and 4K BASICs used 16 bit integers.  The QBASIC supported floating point arithmetic as well as integer arithmetic.
  • TBASIC has many odd quirks in behavior and like the ancient BASIC dialects is poorly documented.
  • TBASIC has a very small subroutine stack depth, so concepts like recursive programming is a very bad idea.  

Good luck,

Gary d

sparks32

  • Newbie
  • Posts: 22
  • I'm a llama!
    • View Profile
Re:can't use tbasic
« Reply #2 on: May 28, 2013, 08:21:26 PM »
thanks for that i used to program on The c64 as a kid. i saw the goto in a sample program and few lines were numbered, so that cleared some things up for me.

sparks32

  • Newbie
  • Posts: 22
  • I'm a llama!
    • View Profile
Re:can't use tbasic
« Reply #3 on: May 28, 2013, 08:53:13 PM »
so if i wanted to do structured programming with many subroutines IF THEN GOTO in custom fuctions are out of the question i guess. would you suggest perhaps t basic operating master control relays? Allen Bradley has different programming layers for subroutines. thanks for you imput    

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:can't use tbasic
« Reply #4 on: June 01, 2013, 08:25:12 AM »
The most effective way to learn the programming of the TBASIC is to open up some sample programs in the folder: C:\TRiLOGI\TL6\usr\samples and cross reference with the the i-TRiLOGI programmer's reference guide. Most of the statements and commands and also available in the help panel screen on the custom function editor window when you select the keyword with your mouse.

Most of these examples can run on the simulator and you can immediately view the variables used in the TBASIC program and under how the program flow. In i-TRiLOGI version 6.45 you can also put break points in the program so that you can pause at any location to view the variable contents.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS