VeriStand .NET API Reference

Content Type
Programming Language
Current manual
Table of Contents

ICustomDevice.SendMessage Method (String, String, UInt32, String)

Sends a message or command to a custom device in an NI VeriStand project, as well as data required by the case that handles the command. You can use this method with any custom device that registers to receive the command you specify.

This method sends string data to a custom device. You also can use the SendMessage method to send data as a byte array of 8-bit unsigned integer values.

Namespace: NationalInstruments.VeriStand.ClientAPI
Assembly: NationalInstruments.VeriStand.ClientAPI (in NationalInstruments.VeriStand.ClientAPI.dll) Version: 2013.0.0.0 (2013.0.0.0)

Syntax

Visual Basic (Declaration)
Function SendMessage ( _
	command As String, _
	data As String, _
	timeout As UInteger, _
	<OutAttribute> ByRef response As String _
) As Error
C#
Error SendMessage(
	string command,
	string data,
	uint timeout,
	out string response
)
Visual C++
Error^ SendMessage(
	String^ command, 
	String^ data, 
	unsigned int timeout, 
	[OutAttribute] String^% response
)

Parameters

command
Type: System.String
The message or command to send to the custom device.
data
Type: System.String
Data to send to the custom device. This input expects only human-readable string characters. If you send other string characters, such as a null character, this method might truncate the message during transmission to the custom device. If the data you want to send contains null characters, convert the string to a byte array and use the SendMessage method to send the data to the custom device.
timeout
Type: System.UInt32
Time in milliseconds to wait for a response from the custom device before returning an error.
response
Type: System.String %
Returns the response from the custom device to the command.

Return Value

Returns an Error object. If no error occurs, the Code property of the Error object is 0.

See Also

Was this information helpful?