Click or drag to resize

SetTrailingForWrites

Specifies the string that should be automatically appended to strings sent to the instrument.

virtual void SetTrailingForWrites(const CString& str) abstract;
Parameters
str

[in] String which should be automatically appended to device command strings.

Remarks

Many instruments require that command strings be terminated with a special character sequence. Rather than explicitly inserting these trailing characters into each command sent to the instrument, the SetTrailingForWrites function can be used to specify a set of characters that will automatically be appended to each command string sent to the device.

The default trailing string is the line feed character "\n".

Example

The following example demonstrates use of the SetTrailingForWrites function.

C++
// CoAcme4321.cpp
HRESULT Acme4321::OnFinalInitialize()
{
  HRESULT hr = S_OK;

  // Command strings will be automatically be appended with a CR/LF combination
  hr = io.SetTrailingForWrites(_T("\r\n"));

  return hr;
}
See Also

Download a complete CHM version of this documentation here.