Low cost solutions to Data Acquisition & Control.
Data Sheets and Application Notes Product Warranty Return Policy How to Order Company Profile


Click for the BBB Business Review of this Computer Software Publishers & Developers in Fort Walton Beach FL  

Weeder Technologies
90-A Beal Pkwy NW
Fort Walton Beach FL 32548

Established: 1989
DUNS: 969723154

How to input data from a peripheral

There are a multitude of third-party RS-232 peripherals that have made their home on the factory floor such as bar-code scanners, weight scales, force gauges, multi-meters and the like, which use a standard serial cable to send their data to a host PC. The Multi-Drop Peripheral Interface is a member of the Stackable Data Module's series and is designed specifically for these third-party devices, allowing them to be connected onto the same serial cable as the other Data Modules. In fact, up to 32 of them can share the same cable and a single port on a PC.

A lot of these third-party devices transmit data at random, rather than being polled by the host which is common among the Stackable Data Module's operations. Therefore, placing a Data Window on the screen and having it automatically poll for data will not work in this case. Fortunately with ModCom there is another option available which can be used to acquire data. This is all made possible by the accessibility of the global variables {recdata} and {rawdata}.

ModCom can use various user defined variables during run-time to take the place of many of the user-entered fields in the various setup boxes. One special variable called {rawdata} is reserved by ModCom to hold the last data packet (minus header character) which was received at the serial port and can be used anywhere within ModCom that variables are supported. Because of this, it is possible to set up a Conditional to watch for data from a certain Data Module, and when it comes in, use the {rawdata} variable to send it to a Screen Object for viewing and/or logging to file. In this case, the data module would be a Multi-Drop Peripheral Interface connected to a bar-code scanner or other third-party serial device.

Using a Conditional to capture serial data:

To capture data from a serial device which is transmitting at unknown or unpredictable times, create a Conditional statement and use the Multi-Drop Peripheral Interface's header character in the logical expression like this: {recdata} = A{rawdata} Because {recdata} will always contain the last received data packet, and {rawdata} will contain the data packet minus header character, this condition will evaluate to TRUE at any time there is data coming in from "Data Module A" and hence, trigger the Conditional. In order to pass this data on to a Screen Object, click on "Edit Script" and choose "Send Text Message" from the "Available Function" box and click on "Add Step". Then type in the variable {rawdata} as the message to send to a Screen Object which you enter in the box below. Now, anytime the serial device transmits data to the host via the Multi-Drop Peripheral Interface, that data will appear in the window of the Screen Object.