設定例

VB.NET用

Dim hWnd As Integer

Dim wMsg As Short

Dim SrqOn, Ret As Integer

 

hWnd = Handle.ToInt32   ' Handle.ToInt32は現在実行中のプロシージャのハンドル

wMsg = WM_USER + &H30S   ' 0x400~0x7FFFの任意の番号

SrqOn = 1   ' SRQのイベント発生

Ret = GpSetEventSrq(hWnd, wMsg, SrqOn)

 

C言語用

HANDLE hWnd;

WORD wMsg;

DWORD SrqOn, Ret;

 

hWnd = hDlg;   /* hDlgは現在実行中のプロシージャのハンドル */

wMsg = WM_USER + 0x30;   /* 0x400~0x7FFFの任意の番号 */

SrqOn = 1;   /* SRQのイベント発生 */

Ret = GpSetEventSrq(hWnd, wMsg, SrqOn);

 

C#用

int hWnd;

ushort wMsg;

uint SrqOn, Ret;

 

hWnd = this.Handle.ToInt32();   /* this.Handleは現在実行中のプロシージャのハンドル */

wMsg = WM_USER + 0x30;   /* 0x400~0x7FFFの任意の番号 */

SrqOn = 1;   /* SRQのイベント発生 */

Ret = gpib.SetEventSrq(hWnd, wMsg, SrqOn);

 

Python用

wMsg = ctypes.c_ushort()

SrqOn, Ret = ctypes.c_ulong(), ctypes.c_ulong()

 

hWnd = ctypes.windll.user32.FindWindowW(0, "Name")    # "Name"は現在実行中のプロシージャのキャプション

wMsg.value = WM_USER + 0x30   # 0x400~0x7FFFの任意の番号

SrqOn.value = 1   # SRQのイベント発生

Ret.value = GpibPy.GpSetEventSrq(hWnd, wMsg, SrqOn)