12.2.1         What's Different in WebAccess vs. other Tcl

WebAccess is based on Tcl version 8.4 Built-in Commands.   There are some differences from other implementations of Tcl found in schools, universities and other systems.

No Command Line

WebAccess uses only scripts files placed in the program queue and executed.  There is no command line for entering one command at a time.

No standard IO (stdio)

To enter data and display the results of scripts, most users will use the ACTION commands, GETVAL and SETVAL, display the results of scripts and send data to Controllers, IO and Automation equipment or retrieve the value of WebAccess Tags.

WebAccess tags can be IO tags, internal tags or local screen tags. IO tags are connected to PLCs and controllers. The globally available internal tags are Constant, Calculation and Accumulation tags.

Users can use the "open" command to define IO. This includes COM ports, TCP sockets, a command pipeline channel and files. This would be for sophisticated programs, like the email program downloaded from the Internet.

Note-  stdio is the most common item that must be replaced when porting Tcl Programs to WebAccess.

To replace the stdio

gets and puts require user defined IO

GETVAL and SETVAL essentially replace gets and puts.  Since there is no standard IO (stdio), if you use puts or gets, you have to create the IO channel.  This will affect many Tcl Scripts that you copy from freeware and Internet sites.  Tcl Scripts from other applications will work in WebAccess if you review the script for gets and puts, especially looking for gets and puts to stdio.  Defining a text or analog type tag, and replacing the gets and puts with GETVAL and SETVAL will enable these scripts to work in WebAccess (with appropriate halts in logic to allow data entry).   The gets and puts to IO defined by the program should work unchanged in WebAccess (assuming they are developed for the Windows platform and not UNIX or Mac). We have tested many Tcl scripts from the Internet (e.g. email client) and they have worked with modifications to stdio and command line instructions.

ACTION Commands augment Tcl

WebAccess has added command functions to enable users to more easily interface with their control system.  In fact, most users will only need to use WebAccess ACTION commands with just a few if-then commands to meet all their needs.

Many ACTION commands will download a file to the client then perform the Tcl command it replaces.  Examples include:

SCREXEC replaces source

SCRLOOP replaces source and looping logic


The $variable notation is still used for script variables.  But to evaluate a WebAccess tag, the @tag notation is used. For more information see Command substitution@

Scripts use *.SCR extension

Traditionally Tcl scripts use the *.TCL extension.  WebAccess uses the *.scr extension