User`s guide

114 Agilent VISA User’s Guide
4 Programming via GPIB and VXI
Sample: Determining Window Mapping
ViAddr address;
Vi UInt16 access;
ViUInt16 value;
.
.
.
viMapAddress(vi, VI_A16_SPACE, 0x00, 0x04,
VI_FALSE,
VI_NULL, &address);
viGetAttribute(vi, VI_ATTR_WIN_ACCESS, &access);
.
.
If(access==VI_USE_OPERS) {
viPeek16(vi, (ViAddr)(((ViUInt16 *)address) +
4/sizeof(ViUInt16)), &value)
}else if (access==VI_DEREF_ADDR){
value=*((ViUInt16
*)address+4/sizeof(ViUInt16));
}else if (access==VI_NMAPPED){
return error;
}
.
.
Setting the VXI Trigger Line
The VI_ATTR_TRIG_ID attribute is used to set the VXI trigger line.
This attribute is listed under generic attributes and defaults to
VI_TRIG_SW (software trigger). To set one of the VXI trigger lines, set
the VI_ATTR_TRIG_ID attribute as follows:
viSetAttribute(vi, VI_ATTR_TRIG_ID,
VI_TRIG_TTL0);