The brand-new PN400 Phase Noise Test System is available for purchase! →

Reply To: Error When Opening a Device (TG124A).

Forums › TG Series Discussions › Error When Opening a Device (TG124A). › Reply To: Error When Opening a Device (TG124A).

#159247
Nazar
Participant

Hello Andrew

With your information, i was able to fix the problem. I used the bb_api as a guide, so assumed the device id had to be a reference, which was the problem.

Bad:

[DllImport(“tg_api.dll”, CallingConvention = CallingConvention.Cdecl)]
public static extern tgStatus tgOpenDevice(ref int device);

Good:

[DllImport(“tg_api.dll”, CallingConvention = CallingConvention.Cdecl)]
public static extern tgStatus tgOpenDevice(int device);

Thank you very much
Nazar