TWedge Tutorial 4 Introduction Data Acquisition Scripts











>> YOUR LINK HERE: ___ http://youtube.com/watch?v=HTmHU5DLLww

https://tec-it.com - Data Acquisition Software TWedge • TWedge is a versatile software program for data acquisition. The basic device and data acquisition parameters are adjustable via the user interface of TWedge, no scripting or programming capabilities are required. • To provide maximum flexibility, the whole logic required for handling the device communication and data collection functionality is controlled by automatically generated script code. Usually the generated code is completely hidden from the user, but it can be customized to meet all thinkable requirements. • Due to this script-based approach the data collection software TWedge covers a wide range of data acquisition scenarios. The tool can be used as simple keyboard wedge software, as converter between different interfaces or protocols (e.g. COM to TCP) or as full-featured stock-taking system with database backend. • Script Lifetime: A script specifies the connection parameters and actions for a single device. It reflects all settings which were adjusted on the configuration dialogs. Furthermore it allows you to program custom functionality. • TWedge starts the script immediately after the Start button was pressed: • 1.Global Code • First, all of the global code (= the script code which is not encapsulated by a function) is executed. The global code usually contains connection initializations (e.g. sets the baud rate for a serial interface) and registers hotkey and timer events. • 2.onStart() event • After executing the global code the mandatory function onStart() is called. The onStart() function is responsible to open the connection and usually instructs TWedge to asynchronously receive incoming device data in the onData() event handler. Additionally, the onConnectionLost() handler function is registered (see also step 5). If the connection cannot be opened, an error is raised and TWedge continues with step 4. • 3.onData() • When TWedge receives a data packet it is forwarded to the onData() event handler. (For data packaging rules, please refer to the user manual.) However, onData() is only called if the connection is currently in listening mode (see class TConnection, function StartListen()). • 4.onStop() • TWedge calls this function when the script should be stopped (e.g., when a user presses the Stop button). onStop() is used to perform clean-up functions like closing the device connection. onStop() is also called if TWedge was not able to open a device connection in onStart(). • 5.onConnectionLost() • This function is called when an open connection is lost respectively closed by the peer. (Please note: Detecting a lost connection works only for Bluetooth and TCP/IP clients and for virtual COM ports.) The function is registered when opening the connection (see class TConnection, function Open()). The default implementation of the function tries to re-establish the connection. • 6.onHotkey() • A hotkey event handler function and the corresponding key combination are registered in the global section of the script (see class TInstance, function RegisterHotkey()). The assigned hotkey function is called when the user presses the key combination. Multiple hot-keys can be defined in a single script. • 7. onTimer() • A timer event handler function is used to implement timed code execution. Timers need to be registered in the global section of the script (see class TInstance, function RegisterTimer()) and are usually started when opening a device connection (see onStart). Multiple timers can be used in a single script. • • Script Features • ---------------------- • TWedge extends standard JavaScript with access-methods for files, ODBC databases and other applications. The generated JavaScript code encapsulates the data acquisition logic. If required, every aspect of device connectivity or the data acquisition logic can be customized. TWedge embeds the well-known V8 JavaScript engine (high-performance JavaScript engine as used in the Chrome browser) and even provides JavaScript debugger support (using Eclipse) for easy troubleshooting. • **** • Copyright: TEC-IT Datenverarbeitung GmbH, Steyr, Austria, • https://www.tec-it.com • Music: Track Mirteaux from the album Newborn Butterflies by StrangeZero - https://www.strangezero.gr - https://www.jamendo.com

#############################









Content Report
Youtor.org / YTube video Downloader © 2025

created by www.youtor.org