Copyright: Help by Jill Studholme for Windmill Software Ltd - Apr 04
Citation: Copyright Windmill Software, www.windmill.co.uk


LabIML Help Index
LabIML Help Contents

Overview

Determining the type of instrument

Adding a new instrument

Instrument settings

Channel settings

RS232 settings

Saving the configuration

Control string reference

Parsing messages from instruments

Which reading protocol?

Debugging options


Overview

LabIML reads data from instruments with RS232 ports which send messages in ASCII format. These instruments plug into the PC's COM port. Windmill can log, chart and display data. It can also pass information in real-time to other applications, like spreadsheets, for analysis and report generation.

LabIML can accept:

•	Instruments with a Request/Response interface. These instruments provide data on request. A message is sent to the instrument requesting data. The instrument responds by supplying a message containing data. The data is usually a value but could also be an error or status condition. This type of instrument is referred to as a Request/Response instrument.

•	Instruments which provide unsolicited data. These instruments transmit messages at a regular rate or when an external event occurs. This type of instrument is referred to as a Continuous Flow instrument.

The basic steps needed to configure an instrument are

1.	Determine what type of instrument you have

2.	Add a new instrument

3.	Define the instrument settings

4.	Define how to extract data items and allocate them to channels

5.	Define the RS232 settings

6.	Save the configuration


Determining the Type of Instrument

Before attempting to configure the LabIML driver to communicate with your instrument, you must determine what type of instrument it is and how it communicates. Read your instrument's manual and find out the:

1.	Baud rate (bits per second)

2.	Handshaking protocol

3.	Message formats

You can quickly check that your computer can communicate with the instrument using these settings by means of Windows HyperTerminal or our own, free, comDebug program. (We recommend using comDebug as it provides many more trouble-shooting features than Hyperterminal.)

LabIML supports ports COM1 to COM4 and baud rates of 300, 600, 1200, 2400, 4800, 9600, 19200, and 38400. You can use 8 bit data with no parity or 7 bit data with the following parity options - none, odd, even, mark, space. Flow control can be none, Xon/Xoff or hardware handshaking. If in doubt about your settings start with 8 data bits, no parity, 2 stop bits and no flow control.

To use comDebug

1.	Download comDebug from http://www.windmill.co.uk/serial.html/.

2.	Choose to use comDebug as a terminal utility.

3.	Fill in your COM port settings and if necessary instruct the instrument to send data

To use HyperTerminal

1.	Launch HyperTerminal.

2.	Type a name for your instrument and choose an icon.

3.	Press OK and a dialogue box appears.

4.	At the bottom of the dialogue, choose the appropriate COM port from the Connect Using drop-down list. (Initially the dialogue shows phone number settings - ignore these, they are greyed out when you select a COM port.)

5.	Press OK and fill in the port settings. You can now type the required prompt messages (if any) on the keyboard, and view the messages from the instrument on screen. This confirms the wiring, protocol and message formats are correct. If this doesn't work satisfactorily then the settings will not work in LabIML either.


Adding a New Instrument

The New Instrument dialogue appears when you press the Add button in ConfIML.

Choose a name for your instrument, or select a previously defined instrument from the list. The name can be up to eight characters long.

Enter the number of channels the instrument has. Each item of data is stored in a channel. For example, 1 channel might hold temperature values and another relative humidity values. A channel may also be a dummy channel - used to send extra configuration details to the instrument or to make channel numbering schemes consistent. If unsure about the number of channels, enter the maximum number you might need.

Type a description of the instrument into the Description box. This will subsequently be displayed by ConfIML.

When you've completed the dialogue press OK and the Instrument Settings dialogue appears.


Instrument settings dialogue box
Instrument Settings

The Instrument Settings box  appears when you select an instrument in ConfIML and press the Settings button, or when you press OK in the New Instrument dialogue.

Reading Protocol

Timeout

Instrument idle time

Data Persistence

Returned Message length

Instrument Initialisation String

Channels button

Non-printable button

Insert Delay button


Instrument settings
Instrument Settings Dialogue Box

The Instrument Settings box appears when you select an instrument in ConfIML and then press the Settings button, or when you press OK in the New Instrument dialogue box.

Reading Protocol

Timeout

Instrument idle time

Data Persistence

Returned Message length

Instrument Initialisation String

Channels button

Non-printable button

Insert Delay button


Which Reading Protocol?

1. 	Does your instrument automatically send data at regular intervals?

Choose Continuous flow as your reading protocol.

2.	Does your instrument need a command before supplying data?
Choose Request/Response as your reading protocol. See points 3 and 4.

3.	Does your instrument supply several data items in one reply?
Choose either R/R Multi Channel (robust but slow method) or R/R Multi Background (faster method).

4.	Does your instrument supply only one data item in its reply?
Choose either R/R On Demand (robust but slow method) or R/R Background (faster method).

Related topics:

Instrument Settings

Request/Response on Demand

Request/Response in the Background

Request/Response Multi Channel

Request/Response Multi Background

Continuous Flow

Reading Protocol Summary


Timeout

The time in milliseconds LabIML waits for an answer from the instrument - not needed for instruments which continually send data. To avoid spurious errors, set the timeout to between five and ten times the normal response time. Don't know the response time? Try 5000 milliseconds.

Related topics:

Instrument Settings


Instrument Idle Time

The time in milliseconds that LabIML allows between messages sent to the instrument. This gives the instrument time to process a message. It may not be able to accept a second message while processing the first, so too low an Instrument idle time means the second message may be lost. Many instruments, however, do not require any idle time and you can set the time to zero.

Related topics:

Instrument Settings


Data Persistence

The time in milliseconds that a value is considered to be still valid. This only applies to background and continuous flow readings. It ensures each value received remains accessible for a suitable length of time, or until a new value arrives. The persistence time must be longer than your application's speed of sampling. For example, if you were logging data every 5 seconds, you might set the data persistence time to 10000 millisecond. If it were, say, only 2000 millisecond, the data would expire before Logger asked for it.

Related topics:

Which Reading Protocol?

Instrument Settings


Returned Message Length

The total number of characters in a message returned by the instrument. This includes carriage returns, line feeds and so on. For messages of variable length enter the longest length likely.

Related topics:

Instrument Settings


Instrument Initialisation String

This string of characters is sent to the instrument when the LabIML driver first loads. It can contain non-printable characters and delays. You can use it, for example, to reset or configure the instrument. You might only find the optimal values for some of these parameters by trial and error. Many instruments do not need initialising in which case you can leave this setting blank.

Related topics:

Instrument Settings


Channels Button

You need to tell the software how to extract the data from the message sent by the instrument. Each data item is allocated a channel. Press the Channels button to call up the Channel Settings box. This starts with the first channel, channel 0. To configure more channels, use the list at the top of the box to move to the next channel.

Related topics:

Instrument Settings


Non-printable
Non-Printable Button

Use this button to insert non-printable characters into the Instrument Initialisation String. It calls up a dialogue box that lets you enter the four most common characters, (carriage return, linefeed, space and escape), by simply pressing a button.

You can insert other characters into the string by typing their codes into the Character code box. The Format box lets you choose the format of the code: Decimal or Hexadecimal.

Related topics:

Instrument Settings


Insert delay
Insert Delay Button

Use this button to insert a delay control, corresponding to the Instrument idle time, into the Instrument Initialisation String. This gives the instrument time to process a command before it receives the next one. For longer delays simply insert several delay controls into the initialisation string. Many instruments don't need a delay, or indeed an initialisation string.

Related topics:

Instrument Settings


Channel Settings

The Channel Settings box lets you define how to extract data from your instrument's message, allocating each data item to a channel. You can also use it to set which channels can write data to the instrument. It appears when you press the Channels button in the Instrument Settings box.

Select the channel you wish to configure from the Channel box.

The dialogue has 8 buttons that insert commands into the various strings. If a command is unsuitable for the string currently selected, the button will be disabled. The Description box explains the selected setting and translates the strings into English.

Note: When extracting data, it is essential that you enter a Reply Parse String.

Channel attributes

Engineering Units, Maximum and Minimum value

Channel Initialisation string

Prompt string

Reply Parse string

Reply ACK string

Write string

Non-printable button

Insert Value button

Ignore until char button

Extract Until char button

String search button

Insert Delay button

Ignore next n button

Extract next n button

Copy and Paste buttons

Press OK when you've configured all the channels. You are returned to the Instrument Settings dialogue. Press OK again and you are returned to ConfIML main window. You should now set the RS232 protocol.


Channel settings dialogue box
 Channel Settings

The Channel Settings box lets you define how to extract data from your instrument's message, allocating each data item to a channel. You can also use it to set which channels can write data to the instrument. It appears when you press the Channels button in the Instrument Settings box.

Select the channel you wish to configure from the Channel box.

The dialogue has 8 buttons that insert commands into the various strings. If a command is unsuitable for the string currently selected, the button will be disabled. The Description box explains the selected setting and translates the strings into English.

Note: When extracting data, it is essential that you enter a Reply Parse String.

Channel attributes

Engineering Units, Maximum and Minimum value

Channel Initialisation string

Prompt string

Reply Parse string

Reply ACK string

Write string

Non-printable button

Insert Value button

Ignore until char button

Extract Until char button

String search button

Insert Delay button

Ignore next n button

Extract next n button

Copy and Paste buttons

Press OK when you've configured all the channels. You will be returned to the Instrument Settings dialogue. Press OK again and you are returned to ConfIML main window. You should now set the RS232 protocol.


Channel Attributes

Choose whether the channel is a read channel, a write channel or a dummy channel.

Read channel -	The channel provides data. Choose this item when you are extracting data from an instruments reply.

Write channel -	Data can be sent to the channel. Choose this item when you will be writing data to a channel on your instrument. For example, you may be able to use Windmill to switch a relay.

Dummy channel -	Not a real channel, a place filler to make numbering schemes consistent or used for additional setup data

Continuous Flow instruments only supply data to the computer and so you cannot select write channels for these instruments.

Only those options that are sensible for the type of channel will be available from the Channel Settings box. For instance if the Channel is a Read channel, the Write string box will not be shown.

Related topics:

Channel Settings dialogue box


Engineering Units, Maximum and Minimum Values

These reflect the data provided by, or sent to, the channel. These values do not impose any limits on the data. They are for information purposes only, being used to scale graphs and such like.

Related topics:

Channel Settings dialogue box


Channel Initialisation String

This string of characters is automatically sent to the channel when the LabIML driver first loads (but after the instrument initialisation string). It configures the channel as specified. It can contain embedded control sequences, which you can quickly insert by pressing the control buttons. You could use it, for example, to request different types of information from a continuous flow instrument. However, you can often leave the initialisation string blank.

Related topics:

Channel Settings dialogue box


Prompt String

For instruments which need a command before sending a data message, you enter the command in the Prompt String. It can contain embedded control sequences, which you can quickly insert by pressing the control buttons. You can send different prompt strings to each channel to request different data messages. Alternatively the prompt string may request a reply containing several values, and you can then use different parse strings on each channel to extract different values.

Although LabIML is designed to acquire data from RS232 instruments, it can also access RS485 instruments that have their own addresses. To do this simply include the address in the prompt string.

Related topics:

Channel Settings dialogue box


Reply Parse String

This string controls the way the LabIML driver interprets messages from the instrument. It tells the software which piece of the message is the actual data which you want to collect. For instruments that continuously send data, it is important that you fix a position in the message before telling LabIML to extract data. Use the String search, Ignore until, etc, buttons at the bottom of the Channels box. For a fuller explanation please read Parsing messages from instruments.

Note

It is essential that you enter a Reply Parse string for every channel that is reading data from the instrument. LabIML can extract data values up to 12 characters long.

Related topics:

Parsing messages from instruments

Channel Settings dialogue box


Reply Acknowledgement String

When some instruments send a message to LabIML they wait for an acknowledgement. If your instrument is of this type then type in the necessary acknowledgement, otherwise leave the box empty.

Related topics:

Channel Settings dialogue box


Write String

LabIML uses this string to send a value to a write channel. It must contain the control string \V. This determines where the value is inserted into the string and can be entered by pressing the Insert Value button.

Related topics:

Channel Settings dialogue box


Copy and Paste Buttons

Use the Copy and Paste buttons to speed up configuration of instruments with several channels. The Copy button copies all the settings of the current channel to the clipboard. The Paste button pastes the clipboard settings to the current channel. You can then edit the settings to suit the channel.

Related topics:

Channel Settings dialogue box


Non-Printable Button

Use this button to insert non-printable characters into the configuration strings. A dialogue box appears that lets you enter the four most common characters, (carriage return, linefeed, space and escape), by simply pressing a button.

You can insert other characters into the string by typing their codes into the Character code box. The Format box lets you choose the format of the code: Decimal or Hexadecimal.

Related topics:

Channel Settings dialogue box


Insert Value Button

This button inserts a control into the write string that will be replaced by an output value when LabIML sends the write string to the channel. The control is \V.

Related topics:

Channel Settings dialogue box


Ignore Until Char Button

You can use this button when you are creating a Prompt String to specify how to extract data from an instrument's message.

It lets you skip characters in the reply string until you find one you are looking for. When you press the button a dialogue box appears for you to specify the sought after characters. As soon as LabIML receives one of these it will continue with the next command in the parse string, which will act on the character that has been found. The control appears as \I"chars" in the reply parse string, where chars are the selected characters.

Related topics:

Channel Settings dialogue box


Extract Until Char Button

You can use this button when you are creating a Reply Parse String to specify how to extract data from an instrument's message.

The button inserts a command to extract characters from the reply string until a specified character is found. When you press the button a dialogue box appears for you to specify the sought after characters. LabIML will extract values until it finds any one of the characters specified. The next command in the parse string then acts on this character. The control appears as \E"chars" in the reply parse string, where chars are the selected characters.

Related topics:

Channel Settings dialogue box


String Search Button

You can use this button when you are creating a Reply Parse String to specify how to extract data from an instrument's message.

The button inserts a search command followed by the string of characters you want LabIML to search for. When you press the button a dialogue box appears for you to specify the string of characters. When found the next operation is on the first character in the message after the string of characters. The control appears as \S"string" in the reply parse string, where string are the selected characters.

Related topics:

Channel Settings dialogue box


Insert Delay Button

This button inserts a delay control, corresponding to the Instrument idle time, into the initialisation string. This gives the instrument time to process a command before it receives the next one. For longer delay periods simply insert several delays into the initialisation string.

Related topics:

Channel Settings dialogue box


Ignore Next n Button

You can use this button when you are creating a Reply Parse String to specify how to extract data from an instrument's message.

The button inserts a command to skip characters in the reply string. Enter a number between 1 and 12 inclusive into the dialogue box that appears. The control appears as \Inn in the reply parse string, where nn is the number of characters to ignore.

Related topics:

Channel Settings dialogue box


Extract Next n Button

You can use this button when you are creating a Reply Parse String to specify how to extract data from an instrument's message.

When you press the button a dialogue box appears for you to specify the number of characters to extract and use as a value. Enter between 1 and 12, inclusive. The control appears as \IEnn in the reply parse string, where nn is the number of characters to extract.

Related topics:

Channel Settings dialogue box


RS232 Settings

Select the Comms button from the ConfIML window. The serial communications dialogue box appears for you to set the RS232 protocol. Fill this in and select OK to return to the main window.

The LabIML driver supports ports COM1 to COM4 and baud rates of 300, 600, 1200, 2400, 4800, 9600, 19200, and 38400. You can use 8 bit data with no parity or 7 bit data with the following parity options - none, odd, even, mark, space. Flow control can be none, Xon/Xoff or hardware handshaking.

If you can select the baud rate of your instrument we recommend that you use a fast rate. This reduces the transmission times when sending and receiving messages. If the instrument is a long way from the computer and transmissions are unreliable, you may need to use a lower baud rate. Use Windmill comDebug check the communications link to your instrument.

If in doubt about the other settings start with 8 data bits, no parity, 2 stop bits and no flow control. If your instrument's Manual specifies software handshaking, choose Xon/Xoff flow control.

Note that you can only connect one instrument to each serial port on the computer unless the instruments have a communications protocol that allows them to share the serial port.


Baud Rates

The rate of data transmission - approximately equal to one bit per second.


Saving the Configuration

When you have defined the instrument, channel and RS232 settings press Save in the ConfIML window. The configuration settings you have chosen will be saved and the ConfIML program closed. You are now ready to use your ASCII instrument with Windmill measurement and control software.


Control String Reference

Control strings are used to control the operation of the LabIML driver. You can either type them into the relevant boxes of the Instrument or Channel Settings dialogue boxes, or insert them by pressing Control Buttons.

Non-printable button	\Cnnn

Inserts non-printable characters. nnn is the ASCII code of the character required. For instance \C013 is used to insert a carriage return; \C010 a linefeed; \C027 an escape. You can use this control string anywhere. The codes should have three digits. Use leading zeros for codes under 100.

String search button	\S"string"

Instructs the LabIML driver to search for string in the message received from the instrument. When found, the next operation is on the first character after the string. The string can contain \C's for non-printable characters.

Ignore until char button	\I"chars"

Instructs the LabIML driver to ignore characters in the message received from the instrument, until one of the characters in the chars string arrives. The next operation takes place at this character.

Ignore next n button	\Inn

Instructs the LabIML driver to ignore the next nn characters in the message. A two digit number is required - use leading zeros where necessary.

Extract Until char button	\E"chars"

Instructs the LabIML driver to extract characters from the message and use them as the value. It stops extracting when it finds a character in chars. The next command in the parse string then acts on this character.

Extract next n button	\Enn

Instructs the LabIML driver to take the next nn characters as the value. A two digit number is required - use leading zeros where necessary.

Insert Value button	\V

Instructs the LabIML driver to insert the write, or output value into the write string at this point, replacing the \V.

Insert Delay button	\W

Instructs the LabIML driver to insert a delay corresponding to the instrument idle time. This is useful in initialisation messages containing multiple commands. You can insert Delays between commands to give the instrument time to process a command before it receives the next one. For longer delays you can use several \W's.


Parsing Messages From Instruments

To parse a message it is essential to know where in the message you are. For request/response instruments this is easy because after a request is sent the only thing received is the reply. For continuous flow instruments this is not the case. The message can be considered as a continuous stream of data that has a recurring pattern. To be able to parse the messages there must be a unique sequence of characters that occurs once per message. You can use this to lock onto the message and provide a position fix. Once you know where you are in a message you can work out how to extract the value required. Exactly how LabIML finds and extracts the value depends on the format of the message. The following examples show how to extract the value from a message.

For request/response data LabIML goes back to the beginning of the string each time for each channel. For continuous flow data it proceeds along the string for each channel.

Example 1

The instrument returns the following message in response to a request from the LabIML driver:

'PRES = 12.345<R>'

where <R> is a carriage return.

You can parse this message by looking for the string "PRES =" then extracting characters until you hit the carriage return.

The parse string to do this is

\S"PRES = "\E"\C013"

The \S"PRES = " finds 'PRES = ' and the \E"\C013" extracts up to a carriage return.

Note that spaces are significant so only use them where they actually exist. The parse strings are case sensitive so make sure that you use the correct case.

Example 2

The instrument continually produces the following message every second. It contains values for channels 01 and 02. Both values are eight characters in length:

'*hh:mm:ss<R> <F>01:12345678<R> 02:12345678<R> CRC=231<R>'

where hh:mm:ss is a time stamp and <F> is a linefeed.

To parse this message and extract the value for channel 01 we need to find a sequence of characters we can use to obtain a position fix on the message.

On first inspection we can see that the sequence '01:' precedes the value. However, we have a time stamp at the start of the message which at 1 O'clock, or 1 minute past the hour will contain the sequence '01:' so we cannot use this. We can use the '*' at the start of the message or we could use the 'CRC=' (this is a check sum on the message) at the end. Having locked onto the message we can then start to parse it. If we use the '*' at the start we can ignore the next 13 characters of the time stamp and the 01: and extract the eight characters of the value we require. This gives us the following parse string - \S"*"\I13\E08.

Example 3

The instrument continually produces a message every two seconds. It consists of a time followed by four channels of data. If we wish to log the time as well as the data, we have to define 5 channels. (We set the number of channels when adding a new instrument.) Two data transmissions look like this.

<T>14:10:32<T>218<T>5<T>0<T>19<C>

<T>14:10:34<T>218<T>110<T>0<T>52<C>

where <T> is a tab and <C> a carriage return.

Here we have to use the carriage return as a position fix. Even though this means missing the first message, it is its only unique character. So we first search for a carriage return.

The next character is a tab - we don't want this so we use "Ignore next 1 character". We've now reached the time which we do want, so we "Extract until tab". After extracting the time, LabIML proceeds to the parsing instructions for the next channel. This is similarly "Ignore next 1 character" (the Tab) then "Extract until tab". All subsequent channels are the same so you can Copy and Paste the settings.

Related topics:

Control string reference

Channel Settings dialogue box


Which Reading Protocol?

1. 	Does your instrument automatically send data at regular intervals?

Choose Continuous flow as your reading protocol.

2.	Does your instrument need a command before supplying data?
Choose Request/Response as your reading protocol. See points 3 and 4 below.

3.	Does your instrument supply several data items in one reply?
Choose either R/R Multi Channel (robust but slow method) or R/R Multi Background (faster method).

4.	Does your instrument supply only one data item in its reply?
Choose either R/R On Demand (robust but slow method) or R/R Background (faster method).

Related topics:

Instrument Settings

Request/Response on Demand

Request/Response in the Background

Request/Response Multi Channel

Request/Response Multi Background

Continuous Flow

Reading Protocol Summary


Request/Response on Demand

The most robust reading protocol is Request/Response on Demand. This requests readings from the instrument when they are required and waits for the answers. If an instrument has quite a slow response the computer will be tied up waiting for the instrument to provide the data. The response time limits the maximum rate at which readings can be taken. So although Request/Response on Demand is reliable it is inefficient, with processing time wasted while waiting for data from the instrument. It can also limit the rate at which data can be logged from other devices that are capable of higher throughput.

A request must be sent for each channel of data. For instruments with several channels, or where several data items are extracted from one string, Request/Response Multi Channel would be more suitable.

The timeout period should be set to some time longer than the expected response time. The timeout prevents the software from waiting forever, should the instrument or the serial link stop working. If it is shorter than the response time though, LabIML may give up before the instrument has had time to supply its data.

Related topics:

Which Reading Protocol?


Request/Response in the Background

Request/Response in the Background is more efficient than On Demand and improves performance of the system. This is useful if the instrument's response time is high, or you need to log data from other sources at higher rates. This protocol uses the same underlying mechanism as Request/Response on Demand - requests are sent to the instrument which replies with a message containing the required data. The difference with the background protocol is that the LabIML driver continually sends requests and parses the replies in the background. This means it uses some of the idle time, (the time when the computer is not normally doing anything other than waiting for input), to communicate with the instrument.

Each time a value is obtained, it is remembered. When a value is required the LabIML driver simply returns the remembered value - there are no delays waiting for the instrument to respond. This effective removal of the instrument response time means that the computer's processing time is used more efficiently and you can log data at a higher rate. However, there are periods when there is little or no idle time, e.g. when large amounts of data are written to or read from disk, or when the system is heavily loaded. As the LabIML driver uses the idle time to obtain data, it is possible, when idle time is short, for no data to be obtained for significant periods.

The data persistence time is used to determine how long after receipt a value is to be considered still valid. Before this time has elapsed the LabIML driver will return the value. After this it will return an error message.

A request must be sent for each channel of data. For instruments with several channels, or where several data items are extracted from one string, Request/Response Multi Background would be more suitable.

Note. With background data acquisition the LabIML driver interrogates the instrument all the time it is loaded, even when the logging software has stopped.

Related topics:

Which Reading Protocol?


Request/Response Multi Channel

Suitable for instruments with several channels, where data should not be lost and a slow response rate is acceptable. LabIML requests readings from the instrument when they are required and waits for a reply. It then stores the reply for the duration of the data persistence time. At this point there is a delay whilst the reply is received and processed, data for all the instrument's channels being extracted. When LabIML subsequently requests a reading from this instrument it gets an immediate reply from the stored data, until the persistence time has elapsed. At this time another reading will be taken.

This is a reliable protocol but has the disadvantage of tying up the system until the instrument responds, which may take some time.

The timeout period should be set to some time longer than the expected response time. The timeout prevents the software from waiting forever, should the instrument or the serial link stop working. If it is shorter than the response time though, LabIML may give up before the instrument has had time to supply its data.

Related topics:

Which Reading Protocol?


Request/Response Multi Background

Suitable for instruments with several channels where higher speeds are needed. When the computer is otherwise idle, LabIML sends requests and parses the replies in the background. This removes the delays when data is requested, but has the disadvantage of not always being able to produce data. It the system is heavily loaded then there may be insufficient idle time for the requests and responses to be processed, leaving LabIML unable to provide data when requested. This is similar to Request/Response in the Background, but extracts data from several channels at once.

Related topics:

Which Reading Protocol?


Continuous Flow

Continuous Flow is similar to background request/response, except that the remote instrument initiates data transfer rather than the software. This reduces the amount of processing required by the computer, but the instrument now determines the rate of data arrival. The data persistence time should be set to ensure each value received remains accessible for a suitable length of time, or until a new value arrives.

Related topics:

Which Reading Protocol?


Reading Protocol Summary

R/R on Demand	Instruments with only one channel

Low speed applications

No loss of data

R/R Background	Instruments with only one channel

Higher speed applications

Risk of loss of data

R/R Multi Channel	Instruments with several channels

Low speed applications

No loss of data

R/R Multi Background	Instruments with several channels

Higher speed applications

Risk of loss of data

Continuous Flow	Instruments that can initiate data transfer

Reduces amount of processing needed by computer

Instrument determines speed

No loss of data

Related topics:

Which Reading Protocol?


Debugging Options

LabIML has several debugging options which are useful when your instrument fails to respond as you expect. The Debug dialogue appears when you select Debug from the system menu of LabIML. (Right-click the LabIML icon and select Debug.)This lets you display transmission information, to help you locate the problem.

You can list:

•	all data received by the instrument by checking the Output Receive strings box,

•	all data transmitted by the instrument by checking the Output Transmit strings box,

•	the parsing progress by checking the Output Parsing progress box.

You can select and copy the information in the Debug window to the Clipboard. Select some text and then press the Ctrl and Ins keys together. You can now paste the selection into a program such as Notepad, and save it for future reference.

When the computer is a long way from the instrument transmissions may be unreliable. In this case try a lower baud rate. If you haven't already used Windmill comDebug to confirm that the wiring, protocol and message formats are correct, you might like to do so.

Related topics:

Trouble Shooting


Trouble Shooting

What do I do if my laptop has no RS232 serial ports?

If your laptop is without COM ports, you can add them either by installing a serial card in the computer's PCMCIA slot, or purchasing a USB to Serial RS232 adaptor.

Can I monitor traffic signals to and from the modem?

No. As the software is designed to acquire data from measurement instruments it needs sole control of the serial device. Other applications cannot therefore access the modem whilst you're using LabIML.

Will LabIML work with my instrument?

LabIML has been successfully used with instruments from A&D, Ashtec, B&B Electronics, Bruël & Kjær, Campbell Scientific, Datel, Ecom, Funaro, Garmin, Horiba, Linkcom, Magellan, Maxim, Mettler Toledo, Mecmessin, Motorola, Molytek, Newmar, Omron, Orion, Parallax, Quantum Logic, Remontec, Sartorius, Siemens, Telegan, Varian SenTorr, World Precision Instruments and many other manufacturers. More help on the settings for many of these instruments is on our web site http://www.windmill.co.uk/.

Can I use LabIML to control valves or other instruments over RS485?

As long as each device on an RS485 cable has its own address you can. To do this simply include the address in your prompt string.

What are the settings for instruments following the NMEA standard?

Instruments following the NMEA standard will generally work with these settings: baud rate - 4800; bits - 8; parity - none; stop bits - 1; flow control - Xon/Xoff or hardware (you may have to try both: consult your instrument's Manual), reading protocol - continuous flow, data persistence - 2 seconds. For more details see our website - http://www.windmill.co.uk/.

LabIML handles analogue data - how do I switch digital outputs?

LabIML works by sending and receiving ASCII strings of characters; it does not expect digital data. When our hardware set-up program, SetupIML, sees an instrument being handled by LabIML - it therefore assumes all its channels are analogue. You can circumvent this by editing the hardware setup file (*.ims) by hand.

1.	Use Windows Notepad to open the file.

2.	Find the appropriate channel (to find a channel's number open the ims setup file in SetupIML, select your channel and look at the status bar).

3.	Change the channel letter to a T (T signifies a digital input and output channel).

4.	Save and close the file. (Be careful not to make any other changes, and save a backup before editing.) If you use SetupIML again, it will reset the file and you will have to edit manually again.

For example: an analogue output channel called Channel 00002, configured by SetupIML, might have the following settings in its ims file.

V 00002 N= E=1 M=A O=0 S=1 U=

To change this to a digital output channel replace the V with a T

T 00002 N= E=1 M=A O=0 S=1 U=

Related topics:

Debugging Options


Search string dialogue box
Search String

This lets you specify a string of characters that you want LabIML to search for when parsing reply strings. You can include non-printable characters in the list, such as carriage returns or line feeds, by pressing the Non-printable character button. When LabIML finds the search string the next operation is on the first character after the string.


Insert non-printable character dialogue box
Insert Non-Printable Character

This lets you specify the four most common non-printable characters, (carriage return, linefeed, space and escape), by simply pressing a button.

You can insert other characters into the string by typing their codes into the Character code box. The Format box lets you choose the format of the code: Decimal or Hexadecimal. ASCII codes must have 3 digits. Use leading zeroes for codes less than 100.


Ignore characters until dialogue box
Ignore Characters Until

Instructs LabIML to ignore all characters in a reply string until it receives one of those you specify here. You can include characters such as carriage returns or line feeds by pressing the Non-printable character button.

When LabIML receives one of the characters you have specified it will continue with the next command in the parse string, which will act on that character. The Ignore Characters Until control appears as \I"chars", where chars are the selected characters.


Extract characters until dialogue box
Extract Characters Until

This instructs LabIML to extract characters from a reply string until it receives one of those you specify here. You can include characters such as carriage returns or line feeds by pressing the Non-printable character button.

When LabIML receives one of the characters you have specified it will continue with the next command in the parse string, which will act upon that character. The extracted characters will be used as the value.

The Extract Characters Until control appears as \E"chars", where chars are the selected characters.


Ignore characters dialogue box
Ignore Characters

Type a 2 digit number to tell LabIML how many characters to skip in a reply string, Use leading zeroes if necessary.

The Ignore Characters control appears as \Inn, where nn is the number of characters to ignore.


Extract characters dialogue box
Extract Characters

This lets you specify the number of characters to extract from the reply string. Enter a 2 digit number, using leading zeroes if necessary.

The Extract Characters control appears as \Enn, where nn is the number of characters to extract.


Serial communications protocol dialogue box
Serial Communications Protocol

Fill in this dialogue with the appropriate settings for your instrument.

The LabIML driver supports ports COM1 to COM4 and baud rates of 300, 600, 1200, 2400, 4800, 9600, 19200, and 38400. You can use 8 bit data with no parity or 7 bit data with the following parity options - none, odd, even, mark, space. Flow control can be none, Xon/Xoff or hardware handshaking.

If you can select the baud rate of your instrument we recommend that you use a fast rate. This reduces the transmission times when sending and receiving messages. If the instrument is a long way from the computer and transmissions are unreliable, you may need to use a lower baud rate. Use Windmill comDebug to check the communications link to your instrument.

If in doubt about the other settings start with 8 data bits, no parity, 2 stop bits and no flow control. If your instrument's Manual specifies software handshaking, choose Xon/Xoff flow control.

Note that you can only connect one instrument to each serial port on the computer unless the instruments have a communications protocol that allows them to share the serial port.


New LabIML instrument dialogue box
New LabIML Instrument

This dialogue lets you add a new instrument to the list of hardware used by Windmill. You can also use it to rename, or redefine, existing instruments.

Choose a name for your instrument, or select a previously defined instrument from the list. The name can be up to eight characters long.

Enter the number of channels the instrument has. Each item of data is stored in a channel. For example, 1 channel might hold temperature values and another relative humidity values. A channel may also be a dummy channel - used to send extra configuration details to the instrument or to make channel numbering schemes consistent. If unsure about the number of channels, enter the maximum number you might need.

Type a description of the instrument into the Description box. This will subsequently be displayed by ConfIML.

When you've completed the dialogue press OK and the Instrument Settings Dialogue box will appear.


Continuous Flow Instruments

Instruments that provide unsolicited data. These instruments transmit messages at a regular rate or when an external event occurs.


Request/Response Instruments

Instruments that provide data on request. LabIML sends a message to the instrument requesting data. The instrument responds by supplying a message containing the data. The data is usually a value but could also be an error or status condition.


Instrument Idle Time

The time in milliseconds LabIML allows between messages sent to the instrument, giving the instrument enough time to process the message. This is set in the Instrument Settings dialogue box of ConfIML.


Timeout Period

The time in milliseconds LabIML waits for an answer from the instrument. This is set in the Instrument Settings dialogue box.


Reply String

The message the instrument sends to LabIML. The message contains data which is usually a value but could also be an error or status condition.


Your Comments

Please send me your comments on this Help file. How easy was it to find the information you needed? How could the Help be improved? E-mail: jill@studholme.net.


World Wide Web

You can find more information about Windmill Software on the World Wide Web at http://www.windmill.co.uk/.

Every month we publish a free newsletter - Monitor ((ISSN 1472-0221), delivered by e-mail. This gives tips on using Windmill and articles on data acquisition and control. To subscribe visit http://www.windmill.co.uk/newsletter.html.

Updates of this Help file will be posted at
http://www.windmill.co.uk/help.html.

For easy purchase of extra software modules please visit our on-line catalogue at http://www.windmillsoft.com/.


Modbus

For Modbus instruments you need our new COMIML driver. See our internet catalogue for more details.


Windmill LabIML Help
designed and written
by Jill Studholme