The iPortAI Event Reader VI monitors the iPortAI device serial port
for device responses. With each Event Reader call, any available serial
port receive characters are read and assembled into a string until the
input stream is exhausted, or a terminating character (CR, or *) is received
and a minimum (4 character) response is present. See the iPortAI device
User's Guide for details.
Operation:
1. Read next available character from the iPorAI serial port.
2. Add new character to global string buffer.
3. Test string buffer for iPortAI device response termination (CR,
or *).
4. Return Event Code/String.
Terminals - Input:
VISA resource name - Serial Port used by iPortAI device (COMn).
error in (no error) - Entry error condition. Standard Functionality.
Terminals - Output:
VISA resource name - Serial Port used by iPortAI device (COMn).
Event Code - 4-character iPortAI device response code.
Event String - iPortAI device response string.
error out - Exit error condition. Standard Functionality.
Notes:
1. Event String
The Event String may contain:
a. The complete response string received from the iPortAI device.
b. An "/NDA" if no input stream data is available.
c. A null string ("") if no complete iPortAI device response is present.
d. An Event Reader error string .
2. Event Code
The Event Code contains the first 4 characters on the Event String,
and can be used as input to a LabVIEW case structure to identify the specific
iPortAI event. The complete list of iPortAI Event Code strings include:
"/NDA" No Data Available
The serial port input stream data is empty.
"/SRC" Slave Receive Complete
Slave data has been received at the iPortAI device Slave Address. The
data is in the Event String.
"/GRC" General Call Receive Complete
Slave data has been received at the I2C Bus General Call
address (0x00). The data is in the Event String.
"/STC" Slave Transmit Complete
The previous Slave Transmit operation has been completed. See the Slave
Transmit Command (Scmd) VI.
"/SNA" Slave Not Acknowledging
A slave device has not acknowledged the slave address in the last Master
Transmit or Master Receive message.
"/I81" iPortAI Device Busy
The iPortAI device is busy. It may be performing a Master or Slave
operation. You may need to repeat the previous command.
"/I83" Bus Arbitration Loss
The iPortAI device has lost bus arbitration to another master during
the previous Master Transmit or Master Receive command. You may need to
repeat the previous command.
"/I84" I2C Bus Error Detected.
The iPortAI device has detected an illegal signal condition on the
bus. You may need to repeat the precious command, or Close, Open, or Reset
the iPortAI device to free the bus.
"/I85" I2C Bus Time-Out Detected
The iPortAI device has detected 1 second of bus inactivity within a
message in which it is participating as a master or a slave. This is a
warning. This may not be a problem, but it could be caused by a slave device
stuck holding the SCL line low. This is a report only, the iPortAI device
does not take any corrective action. You may need to repeat the precious
command, or Close, Open, or Reset the iPortAI device to free the bus.
"/I88" iPortAI Device Connection Closed
An attempt has been made to issue a master or slave command to the
iPortAI device when the communication link is closed.
"/I89" Invalid Command Argument
The iPortAI device has detected an invalid command argument.
"/I8A" Slave Tx Request Not Active
The iPortAI device has received a Slave Transmit command when a Slave
Transmit Request is not pending.
"/I8F" Invalid iPortAI Command
The iPortAI device has received an unsupported, invalid, unrecognized,
or incomplete command.
"I90" iPortAI Receive Buffer Overflow
The iPortAI device has lost receive data arriving on its serial port.
This normally indicates the host computer serial port flow control is not
working. The host computer may not be using flow control (required), the
internal host computer UART Transmit FIFO buffer may need adjustment, the
host computer and the iPortAI device may be using different flow control
methods (hardware or software), or the hardware flow control wire may be
missing in the RS-232 interconnecting cable.
"/IA1" Serial Port Error
The iPortAI Event Reader VI has received a serial port communications
error notification from the LabVIEW serial port driver VI.
"/IA2" Serial Port Read Error
The iPortAI Event Reader VI has received a serial port communications
error notification from the LabVIEW serial port driver VI.
"/STR" Slave Transmit Request
The iPortAI device has received a slave transmit message from a master
on the bus. The iPortAI device will hold the bus (clock stretch) until
it receives a Slave Transmit command from the host computer. See the Slave
Transmit Command (Scmd) VI.
"/MTC" Master Transmit Complete
The iPortAI device has completed the previous Master Transmit command.
See the Master Transmit Command (Tcmd) VI.
"/CCC" Close Connection Complete
The iPortAI device has completed the previous Close Connection command.
See the Close Command (Ccmd) VI.
"" No Event Available
The iPortAI Event Reader VI is collecting data from the serial port,
but a complete event response from the iPortAI device is not available.
"/MRC" Master Receive Complete
The iPortAI device has completed a Master Receive command (Rcmd). The
data is in the Event String.
"/OCC" Open Connection Complete
The iPortAI device has completed the previous Open Connection command.
See the Open Command (Ocmd) VI.
"RDY" iPortAI Device Ready
The iPortAI device has output an "*" to the host computer indicating
it is ready for additional commands. This iPortAI response can occur in
addition to other responses to the same command. |