SerialSession Members

NI-VisaNS .NET Class Library Help for Visual Studio 2010

Edition Date: August 2012

Part Number: 370627F-01

»View Product Info
Download Help (Windows Only)

SerialSession Class Constructors Methods Properties Events See Also


The SerialSession type exposes the following members.

Constructors

NameDescription
SerialSession

Overloaded. Initializes a new instance of the SerialSession object from the specified resource name.

Methods

NameDescription
AssertTrigger Asserts a software or hardware trigger. (Inherited from MessageBasedSession.)
BeginRead

Overloaded. Initiates an asynchronous read from a device.

BeginWrite

Overloaded. Initiates an asynchronous write with ASCII-encoded string data to a device.

Clear Clears a device. (Inherited from MessageBasedSession.)
CreateObjRefCreates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
DisableEvent

Overloaded. Disables notification of the specified event type on the specified event-handling mechanism.

DiscardEvent

Overloaded. Discards event occurrences for the specified event type on the queuing mechanism for a session.

Dispose

Overloaded. Releases all resources used by Session.

EnableEvent

Overloaded. Enables notification of an event.

EndReadByteArray Handles the end of an asynchronous read and returns the read byte array. (Inherited from MessageBasedSession.)
EndReadString Handles the end of an asynchronous read and returns the ASCII-encoded read string. (Inherited from MessageBasedSession.)
EndWrite Handles the end of an asynchronous write. (Inherited from MessageBasedSession.)
EqualsDetermines whether the specified Object is equal to the current Object. (Inherited from Object.)
Finalize Finalizes the instance of the Session class. (Inherited from Session.)
Flush Manually clears the specified buffers associated with serial communication and causes the buffer data to be written to the device.
GetAttributeBoolean Provides direct read access to the NI-VISA driver-level attributes of Boolean data type. (Inherited from Session.)
GetAttributeByte Provides direct read access to the NI-VISA driver-level attributes of Byte data type. (Inherited from Session.)
GetAttributeInt16 Provides direct read access to the NI-VISA driver-level attributes of Int16 data type. (Inherited from Session.)
GetAttributeInt32 Provides direct read access to the NI-VISA driver-level attributes of Int32 data type. (Inherited from Session.)
GetAttributeInt64 Provides direct read access to the NI-VISA driver-level attributes of Int64 data type. (Inherited from Session.)
GetAttributeString Provides direct read access to the NI-VISA driver-level attributes of String data type. (Inherited from Session.)
GetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
GetLifetimeServiceRetrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
GetService Returns an object that represents a service provided by the MessageBasedSession. (Inherited from MessageBasedSession.)
GetTypeGets the Type of the current instance. (Inherited from Object.)
InitializeLifetimeServiceObtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
InstallCustomEventHandler Installs a handler for a nonstandard or new event type. (Inherited from Session.)
LockResource

Overloaded. Establishes an exclusive lock to the specified resource using the Timeout property.

MemberwiseClone

Overloaded. Creates a shallow copy of the current Object.

OnAnyCharacterReceived Raises the AnyCharacterReceived event of the SerialSession object.
OnBreak Raises the Break event of the SerialSession object.
OnClearToSend Raises the ClearToSend event of the SerialSession object.
OnDataCarrierDetect Raises the DataCarrierDetect event of the SerialSession object.
OnDataSetReady Raises the DataSetReady event of the SerialSession object.
OnRingIndicator Raises the RingIndicator event of the SerialSession object.
OnServiceRequest Raises the ServiceRequest event of the MessageBasedSession object. (Inherited from MessageBasedSession.)
OnTerminationCharacterReceived Raises the TerminationCharacterReceived event of the SerialSession object.
Query

Overloaded. Performs a synchronous write of byte array data, followed by a synchronous read.

ReadByteArray

Overloaded. Synchronously reads byte array data from a device or interface.

ReadStatusByte Reads the status byte of a service request. (Inherited from MessageBasedSession.)
ReadString

Overloaded. Synchronously reads ASCII-encoded string data from a device or interface.

ReadToFile

Overloaded. Synchronously reads data and stores the transferred data in a file.

SetAttributeBoolean Provides direct write access to the NI-VISA driver-level attributes of Boolean data type. (Inherited from Session.)
SetAttributeByte Provides direct write access to the NI-VISA driver-level attributes of Byte data type. (Inherited from Session.)
SetAttributeInt16 Provides direct write access to the NI-VISA driver-level attributes of Int16 data type. (Inherited from Session.)
SetAttributeInt32 Provides direct write access to the NI-VISA driver-level attributes of Int32 data type. (Inherited from Session.)
SetAttributeInt64 Provides direct write access to the NI-VISA driver-level attributes of Int64 data type. (Inherited from Session.)
SetAttributeString Provides direct write access to the NI-VISA driver-level attributes of String data type. (Inherited from Session.)
SetBufferSize Sets the size of the low-level I/O communication buffer.
Terminate

Overloaded. Aborts all in-progress asynchronous read and write operations.

ToString Overrides ToString. (Inherited from Session.)
UninstallCustomEventHandler Uninstalls a handler for a nonstandard or new event type that was installed with InstallCustomEventHandler. (Inherited from Session.)
UnlockResource Relinquishes a lock for the specified resource. (Inherited from Session.)
WaitOnEvent

Overloaded. Waits infinitely long for an occurrence of the specified event for a session.

Write

Overloaded. Synchronously writes an array of bytes to the device or interface.

WriteFromFile

Overloaded. Synchronously reads data from a file and writes it to the device or interface.

Properties

NameDescription
AllowTransmit Gets or sets a value indicating whether to allow data transmission.
AvailableNumber Gets the number of bytes available in the global receive buffer.
BaudRate Gets or sets the baud rate of the interface.
BreakLength Gets or sets the duration of the break signal asserted when WriteTermination is set to Break.
BreakState Gets or sets the state of the break line.
ClearToSendState Gets the current state of the Clear To Send (CTS) input signal.
Connected Indicates whether the port is properly connected to another port or device. This property is valid only with serial drivers developed by National Instruments and documented to support this feature with the corresponding National Instruments hardware.
DataBits Gets or sets the number of data bits (from 5 to 8) contained in each frame. The data bits for each frame are located in the low-order bits of every byte stored in memory.
DataCarrierDetectState Gets the current state of the Data Carrier Detect (DCD) input signal.
DataSetReadyState Gets the current state of the Data Set Ready (DSR) input signal.
DataTerminalReadyState Gets or sets the current state of the Data Terminal Ready (DTR) input signal.
DefaultBufferSize Gets or sets the default size of read or write buffers when they are not explicitly defined as a parameter on read or write operations. (Inherited from MessageBasedSession.)
DiscardNull Gets or sets if NUL characters are discarded for transfers.
FlowControl Gets or sets the type of flow control the transfer mechanism uses.
Handle Gets access to the NI-VISA driver session handle that NI-VISA driver operations use internally. (Inherited from Session.)
HardwareInterfaceName Gets human-readable text that describes the current hardware interface. (Inherited from Session.)
HardwareInterfaceNumber Gets the board number for the current hardware interface. (Inherited from Session.)
HardwareInterfaceType Gets the hardware interface type of this session. (Inherited from Session.)
IOProtocol Gets or sets which I/O protocol to use for the current hardware interface. (Inherited from MessageBasedSession.)
LastStatus Gets the last NI-VISA driver status code that was received when this API called a NI-VISA driver method. (Inherited from Session.)
Parity Gets or sets the parity used with every frame transmitted and received.
ReadTermination Gets or sets the method that terminates read operations.
ReadToFileAppends Gets or sets a value indicating whether the ReadToFile method overwrites or appends data when opening a file. (Inherited from MessageBasedSession.)
ReplaceCharacter Gets or sets the character that replaces incoming characters that arrive with errors, such as a parity error.
RequestToSendState Gets or sets the state of the Request To Send (RTS) output signal.
ResourceClass Gets the resource class (for example, "INSTR") as defined by the canonical resource name. (Inherited from Session.)
ResourceImplementationVersion Gets the resource version that uniquely identifies each revision or implementation of a resource. (Inherited from Session.)
ResourceLockState Gets the current locking state of the resource. (Inherited from Session.)
ResourceManufacturerID Gets a value that corresponds to the VXI manufacturer ID of the vendor that implemented the VISA library. (Inherited from Session.)
ResourceManufacturerName Gets a string that corresponds to the manufacturer name of the vendor that implemented the VISA library. (Inherited from Session.)
ResourceName Gets the unique identifier for a resource. (Inherited from Session.)
ResourceSpecificationVersion Gets the resource version that uniquely identifies the VISA specification version to which the implementation is compliant. (Inherited from Session.)
RingIndicatorState Gets the current state of the Ring Indicator (RI) input signal.
SendEndEnabled Gets or sets a value indicating whether to assert END during the transfer of the last byte of the buffer. (Inherited from MessageBasedSession.)
StopBits Gets or sets the number of stop bits that indicate the end of a frame.
SynchronizeCallbacks Specifies how events and callback delegates are invoked. (Inherited from Session.)
SynchronizingObject Obsolete. Gets or sets the object that marshals event-handler and callback calls. (Inherited from Session.)
TerminationCharacter Gets or sets the termination character. (Inherited from MessageBasedSession.)
TerminationCharacterEnabled Gets or sets a value indicating whether the read operation terminates when a termination character is received. (Inherited from MessageBasedSession.)
Timeout Gets or sets the minimum timeout value to use in milliseconds when accessing the device associated with the session. (Inherited from Session.)
VisaEventQueueLength Gets or sets the maximum number of events that can be queued at any time on the session. (Inherited from Session.)
WireMode Gets or sets the transceiver mode.
WriteTermination Gets or sets the method that terminates write operations.
XOffCharacter Gets or sets the value of the XOFF character used for XON/XOFF flow control (both input and output).
XOnCharacter Gets or sets the value of the XON character used for XON/XOFF flow control (both input and output).

Events

NameDescription
AnyCharacterReceived Occurs when at least one data byte is received.
Break Occurs when a break signal is received.
ClearToSend Occurs when the Clear To Send (CTS) line changes state.
DataCarrierDetect Occurs when the Data Carrier Detect (DCD) line changed state.
DataSetReady Occurs when the Data Set Ready (DSR) line changes state.
RingIndicator Occurs when the Ring Indicator (RI) input signal is asserted.
ServiceRequest Occurs when the device associated with the session receives a service request. (Inherited from MessageBasedSession.)
TerminationCharacterReceived Occurs when the termination character is received.

See Also

Reference

SerialSession Class

NationalInstruments.VisaNS Namespace

WAS THIS ARTICLE HELPFUL?

Not Helpful