VISA(虛擬儀器軟體結構)

VISA(虛擬儀器軟體結構)

本詞條是多義詞,共4個義項
更多義項 ▼ 收起列表 ▲

VISA(Virtual Instrument Software Architecture,簡稱為"Visa"),即虛擬儀器軟體結構,是VXI plug&play聯盟制定的I/O接口軟體標準及其規範的總稱。VISA提供用於儀器編程的標準I/O函式館,稱為VISA庫。VISA函式館駐留在計算機系統內,是計算機與儀器的標準軟體通信接口,計算機通過它來控制儀器。

基本介紹

  • 外文名:VISA
  • 全稱:Virtual Instrument Software
  • 簡稱:Visa
  • 類別虛擬儀器軟體結構
基本信息,詳細說明,

基本信息

VISA(Virtual Instrument Software Architecture,簡稱為"Visa"),即虛擬儀器軟體結構,是VXI plug&play聯盟制定的I/O接口軟體標準及其規範的總稱。VISA提供用於儀器編程的標準I/O函式館,稱為VISA庫。VISA函式館駐留在計算機系統內,是計算機與儀器的標準軟體通信接口,計算機通過它來控制儀器。
作為通用I/O標準,VISA提供了統一的設備資源管理、操作和使用機制,它獨立於硬體設備、接口、作業系統和程式語言,具有與硬體結構無關的特點。VISA的這一特性使之適用於各種儀器接口,無論儀器使用的串口還是其他任何一種匯流排,諸如GPIB、VXI、PXI和LXI等,都具有相同的操作函式,從而實現了控制操作上的統一。Visa基於自底向上的結構模型,創造了一個統一形式的I/O控制函式集。一方面,對初學者或是簡單任務的設計者來說,Visa提供了簡單易用的控制函式集,在套用形式上相當簡單;另一方面,對複雜系統的組建者來說,Visa提供了非常強大的儀器控制功能與資源管理。

詳細說明

1、viOpen (Sesn1 ,rsrcName,acessMode,timeout,Sesn2)
用途: 打開與指定儀器的通話。
參數說明
Sesn1 輸入 資源管理器通話(總應是由viOpenDefaultRM( )返回的VISA默資源理器)。
rsrcName 輸入 資源的唯一符號名稱
acessMode 輸入 指定資源的訪問模式。不用,應置0。
timeout 輸入 定時時間。默認值為10秒。
Sesn2 輸出 通話的唯一邏輯標識符。
返回值: 0表示成功,其餘值均表示失敗。
注意: rsrcName的格式為:GPIB::Address::INSTR
其中:GPIB:表示GPIB設備。 address:表示GPIB設備地址。
INSTR表示是VISA資源。例如“GPIB::5::INSTR”
各種語言調用說明:
Delph:
Function viOpen(sesn1:Longint;rsrcName:PChar;acessMode:Longint
timeout:Longint;sesn2:PLongint):Longint;
C:
Long viOpen (long sesn1,char *rsrcName, long acessMode, long timeout,long *sesn2)
VB:
Function viOpen (ByVal sesn1 As Long, ByVal rsrcName As String,
ByVal acessMode As Long, ByVal timeout As Long,
sesn2 As Long) As Long
2viClose(sesn)
用途:
關閉指定的通話。
參數說明
Sesn 輸入 通話的唯一邏輯標識符。
返回值:
0表示成功,其餘值均表示失敗。
各種語言調用說明:
Delphi: Function viClose(sesn:Longint):Longint;
C: Long viClose (long sesn);
VB: Function viClose (ByVal sesn As Long) As Long
3、viOpenDefaultRM (sesn)
用途:
返回與默認資源管理器的通話。
參數說明:
Sesn 輸出 與默認資源管理器通話的唯一邏輯標識符。
返回值:
0表示成功,其餘值均表示失敗。
各種語言調用說明:
Delphi: Function viOpenDefaultRM(sesn1:PLongint):Longint;
C: Long viOpenDefaultRM (long *sesn1);
VB: Function viOpenDefaultRM (sesn1 As Long) As Long
4、viWriteSesn ,CommStr ,Count ,retCount
用途: 向儀器寫數據
參數說明
Sesn 輸入 通話的唯一邏輯標識符。
CommStr 輸入 表示向儀器傳送數據塊存儲單元
Count 輸入 指定被寫的位元組數。
retCount 輸出 表示設定實際傳輸的整數位元組數存儲單元。
返回值:0表示成功,其餘值均表示失敗。
各種語言調用說明:
Delphi: Function viWrite(sesn:Longint;CommStr:PChar;Count:Longint;
retCount:PLongint):Longint;
C: Long viWrite (long sesn, char *CommStr, long Count,
long *retCount)
VB: Function viWrite (ByVal sesn As Long, ByVal CommStr As String,
ByVal Count As Long, lretCount As Long) As Long
5、viRead(Sesn , CommStr , Count , retCount)
用途: 從儀器讀數據。
參數說明:
Sesn 輸入 通話的唯一邏輯標識符。
CommStr 輸入 表示將接收數據的儀器緩衝區的存儲單元
Count 輸入 將讀取的位元組數。
retCount 輸出 表示一整數的存儲地址,該整數表示實際傳輸的位元組數。
返回值:
0表示成功,其餘值均表示失敗。
各種語言調用說明:
Delphi:
Function viRead(sesn:Longint;ReadData:PChar;Count:Longint;
retCount:PLongint):Longint;
C:
Long viRead (long sesn, char *ReadData, long Count, long *retCount)
VB:
Function viRead (ByVal sesn As Long, ByVal ReadData As String,
ByVal Count As Long, lretCount As Long) As Long
6、viClear(Sesn)
用途: 使一個儀器清零。
參數說明: Sesn 輸入 通話的唯一邏輯標識符。
返回值: 0表示成功,其餘值均表示失敗。
各種語言調用說明:
Delphi:
Function viClear(sesn:Longint):Longint;
C:
Long viClear (long sesn)
VB:
Function viClear (ByVal sesn As Long) As Long
7、viReadSTB(Sesn)
用途: 讀服務請求的狀態位元組。
參數說明
Sesn 輸入 通話的唯一邏輯標識符。
Status 輸出 服務請求的狀態位元組。
返回值:
0表示成功,其餘值均表示失敗。
各種語言調用說明:
Delphi:
Function ReadSTB(sesn:Longint;status:PSmallint):Longint
C:
Long viReadSTB (long sesn, short *status)
VB:
Function viReadSTB (ByVal sesn As Long,status As Integer) As Long
8viAssertTrigger(Sesn)
用途: 設定群觸發。
參數說明:
Sesn 輸入 通話的唯一邏輯標識符。
protocal 輸入 斷定所用觸發協定。不用置0。
返回值:
0表示成功,其餘值均表示失敗。
各種語言調用說明:
Delphi:
Function viAssertTrigger(sesn:Longint;protocal:Integer):Longint;
C:
Long viAssertTrigger (long sesn, int protocal)
VB:
Function vAssertTrigger (ByVal sesn As Long,ByVal protocal As Integer) As Long
9、viLock(Sesn)
用途: 建立對指定資源的訪問模式,本函式是本地封鎖。
參數說明:
Sesn 輸入 通話的唯一邏輯標識符。
lockType 輸入 表示請求得鎖定類型。不用,置0。
timeout 輸入 定時時間,默認識是10秒。
requestedKey 輸入 不用,置0。
accessKey 輸入 不用,置0。
返回值:
0表示成功,其餘值均表示失敗。
各種語言調用說明:
Delphi:
Function viLock(sesn,lockType,timeout:Longint;requestedKey,
accessKey:PChar):Longint;
C: Long viLock (long sesn, long lockType, long timeout, char *requestedKey, char *accessKey)
VB: Function viLock (ByVal sesn As Long, ByVal lockType As Long,
ByVal timeout As Long, ByVal requestedKey As String,ByVal accessKey As String) As Long
10、viUnlock (Sesn)
用途: 取消對指定資源的封鎖,返回本地。
參數說明:
Sesn 輸入 通話的唯一邏輯標識符。
返回值:
0表示成功,其餘值均表示失敗。
各種語言調用說明:
Delphi: Function viUnlock(sesn:Longint):Longint;
C: Long viUnlock (long sesn)
VB: Function viUnlock (ByVal sesn As Long) As Long
GPIB函式詳細說明:
1Send(Board_Index,evice_Address,Data_Buffer,Byte_Count,EOT_Mode)
用途:
向儀器寫數據。
參數說明:
Board_Index 輸入 不用,置0。
Device_Address 輸入 儀器地址。
Data_Buffer 輸入 向儀器傳送數據塊存儲單元
Byte_Count 輸入 指定被寫的位元組數。
EOT_Mode 輸入 0表示沒有數據傳輸結束標誌;
1表示數據串用回車換行結束;
2表示數據用最後一個字元結束。
各種語言調用說明:
Delphi:
Procedure Send(Board_Index:Longint; Device_Address:SmallInt;
Data_Buffer:Pchar;Byte_Count:Longint;
EOT_Mode:Longint);
C:
Void Send(long int Board_Index, short Device_Address, char *Data_Buffer,long int Byte_Count,
long int EOT_Mode);
VB:
Sub Send(ByVal Board_Index As Long, ByVal Device_Address As Short, ByVal Data_Buffer As String,ByVal Byte_Count As Long, ByVal EOT_Mode As Long);
2Receive(Board_Index,_Address,Buffer,Byte_Count,Terminatin )
用途:
從儀器讀數據。
參數說明:
Board_Index 輸入 不用,置0。
Device_Address 輸入 儀器地址。
Data_Buffer 輸出 將接收數據的儀器緩衝區的存儲單元
Byte_Count 輸入 將讀取的位元組數。
Termination 輸入 不用,置0。
各種語言調用說明:
Delphi:
ProcedureReceive(Board_Index:Longint; Device_Address:SmallInt;Data_Buffer:Pchar; Byte_Count:Longint; Termination:Longint);
C:
Void Receive(long int Board_Index, short Device_Address, char *Data_Buffer,long int Byte_Count, long int Termination);
VB:
Sub Receive(ByVal Board_Index As Long, ByVal Device_Address As Short,ByVal Data_Buffer As String,ByVal Byte_Count As Long,
ByVal Termination As Long);
3、DevClear(Board_Index, Device_Address)
用途:
使一個儀器清零。
參數說明:
Board_Index 輸入 不用,置0。
Device_Address 輸入 儀器地址。
各種語言調用說明:
Delphi:
ProcedureDevClear(Board_Index:Longint;Device_Address:SmallInt);
C:
Void DevClear(long int Board_Index, short Device_Address);
VB:
Sub DevClear(ByVal Board_Index As Long, ByVal Device_Address As Short);
4、Trigger (Board_Index, Device_Address)
用途:
設定群觸發。
參數說明:
Board_Index 輸入 不用,置0。
Device_Address 輸入 儀器地址。
各種語言調用說明:
Delphi:
Procedure
Trigger(Board_Index:Longint;Device_Address:SmallInt);
C:
Void Trigger(long int Board_Index, short Device_Address);
VB:
Sub Trigger(ByVal Board_Index As Long, ByVal Device_Address As Short);
5、WaitSRQ (Board_Index, SRQ_Occurred)
用途:
等待服務請求。
參數說明:
Board_Index 輸入 不用,置0。
SRQ_Occurred 輸出 0系統默認的timeout時間內無服務請求,
1系統默認的timeout時間有服務請求。
各種語言調用說明:
Delphi:
Procedure WaitSRQ(Board_Index:Longint; SRQ_Occurred:PSmallInt);
C:
Void WaitSRQ(long int Board_Index, short *SRQ_Occurred);
VB:
Sub WaitSRQ(ByVal Board_Index As Long, SRQ_Occurred As Short);
6、ReadStatusByte(Board_Index, Address, Status_Byte )
用途:
讀服務請求的狀態位元組。
參數說明
Board_Index 輸入 不用,置0。
Device_Address 輸入 儀器地址。
Status_Byte 輸出 服務請求的狀態位元組。
各種語言調用說明:
a00
Delphi:
ProcedureReadStatusByte(Board_Index:Longint; Device_Address:SmallInt;
Status_Byte:PSmallInt);
C:
Void ReadStatusByte(long int Board_Index, short Device_Address,
short *Status_Byte);
VB:
Sub ReadStatusByte(ByVal Board_Index As Long, ByVal Device_Address As Short, Status_Byte As Short);
7、SendIFC (Board_Index)
用途:
接口清除。
參數說明:
Board_Index 輸入 不用,置0。
各種語言調用說明:a00
Delphi: Procedure SendIFC(Board_Index:Longint);
C: Void SendIFC(long int Board_Index);
VB: Sub SendIFC(ByVal Board_Index As Long);
8ReceBlock(Board_Index,_Address,Data_Buffer,Byte_Count,Termination)
用途:
從儀器讀數據塊
參數:
名 稱 方 向 說 明
Board_Index 輸入 不用,置0。
Device_Address輸入 儀器地址。
Data_Buffer 輸出 表示將接收數據的儀器緩衝區的存儲單元
Byte_Count 輸入 將讀取的位元組數。
返回值:
0表示成功,- 1表示失敗。
各種語言調用說明:
Delphi: Function ReceBlock(Board_Index:Longint; Device_Address:SmallInt;
Block_Size:Longint;Data_Buffer:PChar);
C: int ReceBlock(long int Board_Index, short Device_Address,
int Block_Size, char *Data_Buffer);
VB: Function ReceBlock(ByVal Board_Index As Integer, ByVal evice_Address As Integer,ByVal Byte_Count As Integer, ByVal Data_Buffer As String);
9、ReceEOI (Board_Index, _Address, Data_Buffer, Byte_Count, Termination)
用途: 以EOI結束方式讀儀器數據塊
參數:
名 稱 方 向 說 明
Board_Index 輸入 不用,置0。
Device_Address輸入 儀器地址。
Data_Buffer 輸出 表示將接收數據的儀器緩衝區的存儲單元
Byte_Count 輸入 將讀取的位元組數。
Termination 輸入 不用,置0。
返回值:
0表示成功,- 1表示失敗。
各種語言調用說明:
Delphi: Function ReceEOI(Board_Index:Longint; Device_Address:SmallInt;
Data_Buffer:PChar;Byte_Count:PLongint;Termination:Longint
C: int ReceEOI(long int Board_Index, short Device_Address,
char *Data_Buffer,long int *Byte_Count,lng int Termination);
VB: Function ReceEOI(ByVal Board_Index As Integer, ByVal Device_Address As Integer,ByVal Data_Buffer As String, ByRef Byte_Count As Integer,ByVal Termination As Integer);

相關詞條

熱門詞條

聯絡我們