The error is FATAL RUN-TIME ERROR: "gpibrw.c", line 64, col 35, thread id 0x00000588: The program has caused a 'General Protection' fault at 001B:631431C4.
It was initially causing my own program to crash, but i've since copied those lines into the NI GPIB demo code. Same result.
Using LabWindows 8.0.1 (356) on Windows XP SP1 Visa drivers are installed - the manufacturer's program has no trouble communicating with the device. However with the code above (which works fine on older installations i'm assured), i can't open the visa session.
The last parameter of viOpen() is expecting an address into which the function can write - are you sure that your variable i_Session represents a valid address at this point in your program? How it is declared and initialised?
There is your problem, then. Simply casting to a pointer type is not enough - you need to tell the compiler to take the variable's address in the call to viOpen(). Without the address operator, the value 0 is passed to the function, resulting in the GPF when it tries to write to memory location 0. Unfortunately, the use of the cast probably prevented the compiler from giving you a warning about this. Try:
That makes sense, my mistake, thanks for the advice. The situation's now better, but i still get an error, though this time it's not fatal.
NON-FATAL RUN-TIME ERROR: "Flux Manager.c", line 4495, col 43, thread id 0x00000B2C: Function viOpen: (return value == -1073807343 [0xbfff0011]). Insufficient location information or the requested device or resource is not present in the system.
The program now knows where to write, but doesn't seem to like opening the visa session.