Using serial port communication, Defining data polling – QuickLabel NiceWatch User Manual

Page 61

Advertising
background image

Working with Triggers

61

NiceWatch User Guide

Using Serial Port Communication

Defining Data Polling

This option data polling enables constant communication with the serial device. In
specified time intervals the defined data characters are sent to the device. The device
understands the sequence of characters as command to send the data to the PC computer.

There are two methods of defining the data for polling:

1. The characters you want to send to the device can be entered in the memo box

below. Use the button with arrow on the right to enter special characters.

2. If your serial device can return the information of its status, you can use the built-in

Visual Basic functionality and write a script that will communicate with the device.
Visual Basic Script functionality lets you manipulate the incoming data. Two
functions are pre-defined and must existing in your script. DataAvailable and
ReceiveData both return Boolean values.

DataAvailable

This function is used to acquire data from the serial device
and validates the incoming data for consistency.

You can use internal functions Comport.Send and
Comport.Receive to communicate with the device. Learn
more about them in the topic

Defining Initialization Data

.

If you set the function to return 1, the ReceiveData function is
then executed. If you set it to return 0, no incoming data is
available and action is not triggered.

The focus is returned to the next polling interval.

ReceiveData

You can pass the incoming data from the serial device
acquired in DataAvailable function to this function.
ReceiveData function can then be used to manipulate
incoming stream of data to suit your needs. You can re-
arange data fields, add or remove text and make any other
data operations.

If you set the function to return 1, the trigger action is then
started. If you set it to return 0, it will be a signal for the
trigger not to start the actions.

The focus is returned to the next polling interval.

ClearBuffer

This command clears input and output buffers of the serial
port on the PC computer.

Advertising