VeriStand .NET API Reference

ICustomDevice.SendMessage Method (String, Byte[], UInt32, Byte[])

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 data as a byte array of 8-bit unsigned integer values. You also can use the SendMessage method to send data as a string of human-readable characters.

Namespace: NationalInstruments.VeriStand.ClientAPI
Assembly: NationalInstruments.VeriStand.ClientAPI (in NationalInstruments.VeriStand.ClientAPI.dll) Version: 2013.0.0.0 (2013.0.0.0)
Visual Basic (Declaration)
Function SendMessage ( _
	command As String, _
	data As Byte(), _
	timeout As UInteger, _
	<OutAttribute> ByRef response As Byte() _
) As Error
C#
Error SendMessage(
	string command,
	byte[] data,
	uint timeout,
	out byte[] response
)
Visual C++
Error^ SendMessage(
	String^ command, 
	array<unsigned char>^ data, 
	unsigned int timeout, 
	[OutAttribute] array<unsigned char>^% response
)

Parameters

command
Type: System.String
The message or command to send to the custom device.
data
Type: System.Byte
Data to send 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.Byte %
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