LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to send a basic string to Lock In amplifier?

I am trying to send a basic string command to the Signal Recovery 7265 Gpib device using Labwindows. Here is my following code for LabWindows 9.1 : I have also attached the file.

#include <ansi_c.h> 
#include <formatio.h>  
#include <stdio.h>
#include <string.h>
#include <utility.h>
#include <gpib.h>


int main (int argc, char *argv[]) {   

int gpibdevice;
char sendString [11];
int data;

sprintf (sendString, "ID %d\n", 300);

//Open and write in LockInAmp

gpibdevice= OpenDev("LOCKIN", "");
data =ibwrt(gpibdevice, sendString, strlen(sendString));
data= CloseDev(gpibdevice);


return (0);
}

After Debugging the code and building/running it I am receiving Function ibwrt(iberr== 2[) X2]) NON FATAL error and the code is simply not sending the string ID to my instrument. Please let me know how to fix this issue and how to send basic string commands to my instrument.

I realize this is a elementary question but I just transferred from using LabView so my programming skills in LW is not very good. Thank You.

0 Kudos
Message 1 of 3
(3,104 Views)

did you check here ?

0 Kudos
Message 2 of 3
(3,101 Views)

I can directly talk to the instrument but the problem is my supervisor wants me to use LabWindows to communicate to the instrument since we will moving to LabWindows from LabView. Is there a way to make the Lock In Amplifier the GPIB device to act as the bus controller? Thank you for your input.

Sincerely,

0 Kudos
Message 3 of 3
(3,077 Views)