12.07.2015 Views

こちらから - インタフェース

こちらから - インタフェース

こちらから - インタフェース

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

GPC-MA001 Help for Windows4.5.3 割 り 込 みコールバックDiSetEventMask 関 数 にて 発 生 させる 割 り 込 み 要 因 を 設 定 します。IN1IN2IN3IN4IN1 のエッジ 割 り 込 み 検 出IN2 のエッジ 割 り 込 み 検 出IN3 のエッジ 割 り 込 み 検 出IN4 のエッジ 割 り 込 み 検 出DiSetEvent 関 数 で 割 り 込 みが 発 生 した 際 に 呼 び 出 されるコールバック 関 数 を 登 録 します。発 生 させる 要 因 が 発 生 するとコールバック 関 数 が 呼 び 出 される 状 態 となります。このコールバック 関 数 内 に 処 理 を 記 述 することで、 割 り 込 みを 通 知 することができます。コールバック 関 数 を 解 除 する 際 は、DiKillEvent 関 数 を 実 行 します。DiKillEvent 関 数 で 要 因 を 全 て 無 効 にすると 要 因 は 発 生 しなくなります。void CALLBACK EventProc(DWORD EventStatus, PVOID dwUser){printf("Callback(EventStatus:%lxh)\n", EventStatus);}HANDLE DeviceHandle;INT Ret;// IFMA1 をオープンDeviceHandle = MaOpen (“IFMA1”, 0);// エッジの 設 定Ret = DiSetTrgEdge(hDeviceHandle, 0x01);// マスクの 設 定 (IN1)Ret = DiSetEventMask(hDeviceHandle, 0x01);// コールバック 関 数 の 登 録Ret = DiSetEvent (DeviceHandle, NULL, EventProc, 0);// コールバック 関 数 の 解 除Ret = DiKillEvent (DeviceHandle);// デバイスをクローズRet = MaClose(DeviceHandle);© 2012, 2014 Interface Corporation. All rights reserved.49

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!