Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

The "ibwrt32" GPIB command doesn't understand string commands

I want to drive a 450 gaussmeter from Lakeshore. The used language is Visual Basic by the way of excel.
A part of my program is:
Dev1=ibdev32(0,12,0,T10s,1,0) 'this line is OK'
call ibclr32(dev1) 'This line is OK'
call ibwrt32(dev1,"ZCAL",4) 'my problem is there'
"ZCAL" is a typical gaussmeter function which makes zero and coded on 4 bytes. If I write this line the zero is not made. However, if I used the NI program "Measurement and Automation" to communicate with my instrument, when I write ZCAL the command is executed and the buffer indicated in "NI Spy" software is 5A 43 41 4C corresponding to z c a and l hexadecimal codes.
Now if I return in my program and write the following command:
call ibwrt32(
dev1, &H4C41435A ,4) the ZCAL command is executed on the gaussmeter. The command is also executed if I write the decimal code of "ZCAL"
So, my first question is :
Why my program doesn't understand the command in the string form "ZCAL"
My second problem is to execute commands coded with more than 4 bytes. For example, I use a comand named "MAX 1" coded on 5 bytes. On Visual Basic, I don't have a data type coded on 8 bytes which could permit to resolve the problem. So, I can just execute command with less than 4 bytes.
0 Kudos
Message 1 of 3
(3,995 Views)
Hello,
What shows up in NI-Spy when your ibwrt32 call fails? Try running an example program. Example programs are installed with the driver and are located at:
c:\Program Files\National Instruments\NI-488.2\Languages\Visual Basic

Excel is probably causing the problem. Ibwrt accepts any string and it does not matter how many bytes it has so I am not sure what 4 and 8 byte restrictions you are referring to. Try using the example program DMMsimple located in the directory listed above.
0 Kudos
Message 2 of 3
(3,995 Views)
Hello,
Thank you for your advices. I've tried to run Example program and these programs can't be executed with excel. So, I obtained the MSVisual Basic software and the problem is resolved.
Best regards
0 Kudos
Message 3 of 3
(3,995 Views)