AnsweredAssumed Answered

E4438C programming SCPI Ethernet (labwindows)

Question asked by r.t on Apr 15, 2015
Hi,


I try to cummincate with an Agilent e4438c with labwindows using SCPI language through an ethernet cable. I configured my system and it communicate well with other utilities like MAX.

But, when i try to run my labwindows program, with SICL language, it doesn't work, it seems to communicate but not to follow the other instruction.

 
my little test program :

 
char* instOpenString ="lan[My IP Adress);     (like that for no link)
 
INST id=iopen(instOpenString);
if (!id)
{
fprintf(stderr, "iopen failed (%s)\n", instOpenString);
return -1;
}
iwrite (id , "*IDN?\n" , 6 , NULL , NULL );
itimeout(id, 2000);
iread ( id , buf , 200 , NULL , &actual );
 
iclose(id);


I have no return reponse like "iopen failed" so I think the connection works well, but buf and actual never change, it's like if it didn't read anything from the e4438c.


*I solve this problem and now find an other. When I try to download IQ Data to the Agilent, loading stay at 0% and never progress. So it receives well my command but not the data i think. I try like this :*

sprintf(cmd, ":MEM:DATA \"WFM1:FILE1\", #%d%d", strlen(s), bytesToSend);

iwrite(id, cmd, strlen(cmd), 0, 0);
iwrite(id, iqbuffer, bytesToSend, 0, 0);
iwrite(id, "\n", 1, 1, 0);


Cause i didn't see how use the command :

:MEM:DATA <"file_name">,#ABC with C the file data in bytes. ( Must be ASCII characters ?)

THANKS for your help.  

Outcomes