! Logical negation (NOT) () Parenthesis expr := regularExpr ['{' attrExpr '}'] attrExpr := attrTerm | attrExpr '||' attrTerm attrTerm := attrFactor | attrTerm '&&' attrFactor attrFactor := '(' attrExpr ')' | '!' attrFactor | relationExpr relationExpr := attributeId compareOp numValue | attributeId equalityOp stringValue compareOp := '==' | '!=' | '>' | '<' | '>=' | '<=' equalityOp := '==' | '!=' attributeId := character (character|digit|underscore)* numValue := digit+ | '-' digit+ | '0x' hex_digit+ | '0X' hex_digit+ stringValue := '"' character* '"' regularExpr is defined in Section 4.4.1, Resource Regular Expressions. RULE 4.4.4 The grouping operator () in a logical expression SHALL have the highest precedence. RULE 4.4.5 The not operator ! in a logical expression SHALL have the next highest precedence after the grouping operator. RULE 4.4.6 The or operator || in a logical expression SHALL have the lowest precedence. Table 4.4.8 Examples
RULE 5.2.8 A MEMACC resource implementation for a PXI system SHALL support the operations viMemAlloc(), viMemFree(), viMemAllocEx(), and viMemFreeEx().
Event Attribute Descriptions VI_ATTR_EVENT_TYPE Unique logical identifier of the event. VI_ATTR_STATUS This field contains the return code of the asynchronous I/O operation that has completed. VI_ATTR_JOB_ID This field contains the job ID of the asynchronous operation that has completed. VI_ATTR_BUFFER This field contains the address of a buffer that was used in an asynchronous operation. VI_ATTR_RET_COUNT This field contains the actual number of elements that were VI_ATTR_RET_COUNT_32 asynchronously transferred. VI_ATTR_RET_COUNT_64 VI_ATTR_OPER_NAME The name of the operation generating the event. For more information on VI_ATTR_OPER_NAME, see its definition in Section 3.7.2.3, VI_EVENT_EXCEPTION. RULE 5.3.3 All INTFC resource implementations SHALL support the generation of the events VI_EVENT_GPIB_CIC, VI_EVENT_GPIB_TALK, VI_EVENT_GPIB_LISTEN, VI_EVENT_CLEAR, VI_EVENT_TRIG, VI_EVENT_SERVICE_REQ, and VI_EVENT_IO_COMPLETION.
Since the operation viReadSTB() for USB INSTR must retain knowledge of service request notifications, a vendor MAY implement either a queue of status bytes from previous notifications or a single cached status byte, where each received status byte is bit-ORed into the single cached status byte. 6.1.9 viClear(vi) Purpose Clear a device. Parameters Name Direction Type Description vi IN ViSession Unique logical identifier to a session. Return Values Type ViStatus This is the operational return status. It returns either a completion code or an error code as follows. Completion Code Description VI_SUCCESS Operation completed successfully. Error Codes Description VI_ERROR_INV_SESSION VI_ERROR_INV_OBJECT The given session or object reference is invalid (both are the same value). VI_ERROR_NSUP_OPER The given vi does not support this operation. VI_ERROR_RSRC_LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access. VI_ERROR_TMO Timeout expired before operation completed. VI_ERROR_RAW_WR_PROT_VIOL Violation of raw write protocol occurred during transfer. VI_ERROR_RAW_RD_PROT_VIOL Violation of raw read protocol occurred during transfer. VI_ERROR_BERR Bus error occurred during transfer. VI_ERROR_NCIC The interface associated with the given vi is not currently the controller in charge. VI_ERROR_NLISTENERS No Listeners condition is detected (both NRFD and NDAC are deasserted). VI_ERROR_INV_SETUP Unable to start operation because setup is invalid (due to attributes being set to an inconsistent state). VI_ERROR_CONN_LOST The I/O connection for the given session has been lost. Description This operation performs an IEEE 488.1-style clear of the device. For VXI INSTR sessions, VISA must use the Word Serial Clear command. For GPIB INSTR sessions, VISA must use the Selected Device Clear command. For Serial INSTR sessions, VISA must flush (discard) the I/O output buffer, send a break, and
An integer specifying field width. d, f, s format codes This specifies the minimum field width of the converted argument. If an argument is shorter than the field width, it will be padded on the left (or on the right if the - flag is present). Special case: For the @H, @Q, and @B flags, the field width includes the #H, #!, and #B strings, respectively. A * may be present in lieu of a field width modifier, in which case an extra arg is used. This arg must be an integer representing the field width. (continues) Modifier Supported with Format Code Description An integer specifying precision. d, f, s format codes The precision string consists of a string of decimal digits. A . (decimal point) must prefix the precision string. The precision string specifies the following: a. The minimum number of digits to appear for the @1, @H, @Q, and @B flags and the i, o, u, x, and X format codes. b. The exact number of digits after the decimal point in case of f format codes. c. The maximum numbers of characters for the string (s) specifier. d. Maximum number of significant digits for g format code. An asterisk (*) may be present in lieu of a precision modifier, in which case an extra arg is used. This arg must be an integer representing the precision of a numeric field. An argument length modifier. h, l, ll, L, z, and Z are legal values. (z and Z are not ANSI C standard flags.) h (d, b, B format codes) l (d, f, b, B format codes) L (f format code) z, Z (b, B format codes) The argument length modifiers specify one of the following: a. The h modifier promotes the argument to a short or unsigned short, depending on the format code type. b. The l modifier promotes the argument to a long or unsigned long. c. The ll modifier promotes the argument to a long long or unsigned long long. d. The L modifier promotes the argument to a long double parameter. e. The z modifier promotes the argument to an array of floats. f. The Z modifier promotes the argument to an array of doubles. Enhanced Modifiers to ANSI C Standards Modifier Supported with Format Code Description
Perform a formatted write and read through a single operation invocation. Parameters Name Direction Type Description vi IN ViSession Unique logical identifier to a session. writeFmt IN ViConstString The format string is applied to write parameters in ViVAList. readFmt IN ViConstString The format string to applied to read parameters in ViVAList. params IN OUT ViVAList A list containing the variable number of write and read parameters. The write parameters are formatted and written to the specified device. The read parameters store the data read from the device after the format string is applied to the data. Return Values Type ViStatus This is the operational return status. It returns either a completion code or an error code as follows. Completion Code Description VI_SUCCESS Successfully completed the Query operation. Error Codes Description VI_ERROR_INV_SESSION VI_ERROR_INV_OBJECT The given session or object reference is invalid (both are the same value). VI_ERROR_RSRC_LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access. VI_ERROR_IO Could not perform read/write operation because of I/O error. VI_ERROR_TMO Timeout occurred before read/write operation completed. VI_ERROR_INV_FMT A format specifier in the writeFmt or readFmt string is invalid. VI_ERROR_NSUP_FMT The format specifier is not supported for current argument type. VI_ERROR_ALLOC The system could not allocate a formatted I/O buffer because of insufficient system resources. Description This operation is similar to ViQueryf(), except that the ViVAList parameters list provides the parameters rather than the separate arg parameter list. Related Items
6.4 Shared Memory Services 6.4.1 viMemAlloc(vi, size, offset) 6.4.2 viMemAllocEx(vi, size, offset64) Purpose Allocate memory from a device’s memory region. Parameters Name Direction Type Description vi IN ViSession Unique logical identifier to a session. size IN ViBusSize Specifies the size of the allocation. offset or offset64 OUT ViBusAddress or ViBusAddress64 Returns the offset of the allocated device memory. Return Values Type ViStatus This is the operational return status. It returns either a completion code or an error code as follows. Completion Code Description VI_SUCCESS Operation completed successfully. Error Codes Description VI_ERROR_INV_SESSION VI_ERROR_INV_OBJECT The given session or object reference is invalid (both are the same value). VI_ERROR_NSUP_OPER The given vi does not support this operation. VI_ERROR_RSRC_LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access. VI_ERROR_INV_SIZE Invalid size specified. VI_ERROR_ALLOC Unable to allocate shared memory block of the requested size. VI_ERROR_MEM_NSHARED The device does not export any memory. Description This operation returns an offset into a device’s memory region that has been allocated for use by this session. If the device to which the given vi refers is located on the local interface card, the memory can be allocated either on the device itself or on the computer’s system memory. Related Items See the INSTR resource description. Also see viMemFree() and viMemFreeEx(). Implementation Requirements OBSERVATION 6.4.1
Purpose Write GPIB command bytes on the bus. Parameters Name Direction Type Description vi IN ViSession Unique logical identifier to a session. buf IN ViConstBuf Buffer containing valid GPIB commands. count IN ViUInt32 Number of bytes to be written. retCount OUT ViUInt32 Number of bytes actually transferred. Return Values Type ViStatus This is the operational return status. It returns either a completion code or an error code as follows. Completion Code Description VI_SUCCESS Operation completed successfully. Error Codes Description VI_ERROR_INV_SESSION VI_ERROR_INV_OBJECT The given session or object reference is invalid (both are the same value). VI_ERROR_NSUP_OPER The given vi does not support this operation. VI_ERROR_RSRC_LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access. VI_ERROR_TMO Timeout expired before operation completed. VI_ERROR_INV_SETUP Unable to start write operation because setup is invalid (due to attributes being set to an inconsistent state). VI_ERROR_NCIC The interface associated with the given vi is not currently the controller in charge. VI_ERROR_NLISTENERS No Listeners condition is detected (both NRFD and NDAC are deasserted). VI_ERROR_IO An unknown I/O error occurred during transfer. Description This operation attempts to write count number of bytes of GPIB commands to the interface bus specified by vi. This operation is valid only on GPIB INTFC (interface) sessions. This operation returns only when the transfer terminates. Table 6.5.3 Special Values for retCount Parameter Value Action Description VI_NULL Do not return the number of bytes transferred.
VI_ATTR_SUPPRESS_END_EN VI_TRUE VI_FALSE VI_FALSE VI_ATTR_TERMCHAR 0 to FFh 0Ah (linefeed) VI_ATTR_TERMCHAR_EN VI_TRUE VI_FALSE VI_FALSE VI_ATTR_FILE_APPEND_EN VI_TRUE VI_FALSE VI_FALSE INSTR Resource Attributes (GPIB and GPIB-VXI Specific) Symbolic Name Range Default VI_ATTR_GPIB_PRIMARY_ADDR 0 to 30 N/A VI_ATTR_GPIB_SECONDARY_ADDR 0 to 31, VI_NO_SEC_ADDR N/A VI_ATTR_GPIB_READDR_EN VI_TRUE VI_FALSE VI_TRUE VI_ATTR_GPIB_UNADDR_EN VI_TRUE VI_FALSE VI_FALSE VI_ATTR_GPIB_REN_STATE VI_STATE_ASSERTED VI_STATE_UNASSERTED VI_STATE_UNKNOWN N/A INSTR Resource Attributes (VXI, GPIB-VXI, and PXI Specific) Symbolic Name Range Default VI_ATTR_Slot N/A N/A VI_ATTR_WIN_ACCESS VI_TRUE VI_FALSE N/A INSTR Resource Attributes (VXI and GPIB-VXI Specific) Symbolic Name Range Default VI_ATTR_Slot 0 to 7 N/A VI_ATTR_MEM_Base_32 VI_ATTR_MEM_Base_64 N/A N/A VI_ATTR_MEM_Size_32 VI_ATTR_MEM_Size_64 N/A N/A VI_ATTR_MEM_Space VI_NMAPPED VI_A24_SPACE VI_DEREF_ADDR VI_NMAPPED VI_ATTR_SRC_INCREMENT 0 to 1 1 VI_ATTR_DEST_INCREMENT 0 to 1 1
VI_ATTR_PXI_SLOTPATH N/A N/A VI_ATTR_PXI_SLOT_LBUS_LEFT 0 to 32767 VI_UNKNOWN_SLOT N/A VI_ATTR_PXI_SLOT_LBUS_RIGHT 0 to 32767 VI_UNKNOWN_SLOT N/A VI_ATTR_PXI_TRIG_BUS 0 to 32767 VI_UNKNOWN_TRIG N/A VI_ATTR_PXI_STAR_TRIG_BUS 0 to 32767 VI_UNKNOWN_TRIG N/A VI_ATTR_PXI_STAR_TRIG_LINE 0 to 32767 VI_UNKNOWN_TRIG N/A VI_ATTR_PXI_MEM_TYPE_BARn (where n is 0,1,2,3,4,5) VI_PXI_ADDR_MEM, VI_PXI_ADDR_IO, VI_PXI_ADDR_NONE N/A VI_ATTR_PXI_MEM_BASE_BARn _32 VI_ATTR_PXI_MEM_BASE_BARn _64 (where n is 0,1,2,3,4,5) N/A N/A VI_ATTR_PXI_MEM_SIZE_BARn _32 VI_ATTR_PXI_MEM_SIZE_BARn _64 (where n is 0,1,2,3,4,5) N/A N/A MEMACC Resource Attributes (Generic) Symbolic Name Range Default VI_ATTR_INTF_NUM 0 to FFFFh 0 VI_ATTR_INTF_TYPE VI_INTF_VXI VI_INTF_GPIB_VXI N/A VI_ATTR_INTF_INST_NAME N/A N/A VI_ATTR_TMO_VALUE VI_TMO_IMMEDIATE 1 to FFFFFFFEh VI_TMO_INFINITE 2000 VI_ATTR_DMA_ALLOW_EN VI_TRUE VI_FALSE N/A MEMACC Resource Attributes (VXI, GPIB-VXI, and PXI Specific)
VI_ATTR_GPIB_CIC_STATE VI_TRUE VI_FALSE N/A VI_ATTR_GPIB_SYS_CNTRL_STATE VI_TRUE VI_FALSE N/A VI_ATTR_GPIB_HS488_CBL_LEN 1 to 15 VI_GPIB_HS488_DISABLED VI_GPIB_HS488_NIMPL N/A BACKPLANE Resource Attributes (Generic) Symbolic Name Range Default VI_ATTR_INTF_NUM 0 to FFFFh 0 VI_ATTR_INTF_TYPE VI_INTF_VXI VI_INTF_GPIB_VXI N/A VI_ATTR_INTF_INST_NAME N/A N/A VI_ATTR_TMO_VALUE VI_TMO_IMMEDIATE 1 to FFFFFFFEh VI_TMO_INFINITE 2000 BACKPLANE Resource Attributes (VXI and GPIB-VXI Specific) Symbolic Name Range Default VI_ATTR_TRIG_ID VI_TRIG_SW; VI_TRIG_TTL0 to VI_TRIG_TTL7; VI_TRIG_ECL0 to VI_TRIG_ECL5; VI_TRIG_STAR_SLOT1 to VI_TRIG_STAR_SLOT12; VI_TRIG_STAR_VXI0 to VI_TRIG_STAR_VXI2; VI_TRIG_PANEL_IN; VI_TRIG_PANEL_OUT N/A VI_ATTR_MAINFRAME_LA 0 to 255 VI_UNKNOWN_LA N/A VI_ATTR_VXI_VME_SYSFAIL_STATE VI_STATE_ASSERTED VI_STATE_UNASSERTED VI_STATE_UNKNOWN N/A VI_ATTR_VXI_VME_INTR_STATUS N/A N/A VI_ATTR_VXI_TRIG_STATUS N/A N/A VI_ATTR_VXI_TRIG_SUPPORT N/A N/A SERVANT Resource Attributes (Generic) Symbolic Name Range Default VI_ATTR_INTF_NUM 0 to FFFFh 0