I've been trying to get my head wrapped around traditional board-level commands lately and I think I'm 98% there, just need a Guru or two to clear up a little confusion on my last item.
I'm sending the following to a Fluke 45 over a USB GPIB adaptor
*RST;*CLS;
*SRE 112;*ESE 61;
VDC;RANGE 1;TRIGGER 1;
*TRG;VAL1?
The data goes out and I get back an expected measurement from the Fluke. I have taken my communication methods by studying nispy traces of various programs out there but I'm a little uncertain with one aspect of what I've done and would appreciate any insight into what I should be doing to make this right.
This is the complete command stream as shown through NiSpy...
ibfind(GPIB0)
ibonl(GPIB0, 1)
ibconfig(GPIB0, IbcAUTOPOLL (0x0007), 0 (0x0))
ibpad(GPIB0, 0)
ibtmo(GPIB0, T3s (12))
ibsre(GPIB0, 1)
ibeot(GPIB0, 0)
ibeos(GPIB0, 0x0000)
ibsic(GPIB0)
ibgts(GPIB0, 0)
ibtmo(GPIB0, T3s (12))
ibcmd(GPIB0, "?@!", 3 (0x3))
ibwrt(GPIB0, "*RST;*CLS;.", 11 (0xB))
ibwrt(GPIB0, "*SRE 112;*ESE...", 18 (0x12))
ibwrt(GPIB0, "VDC;RANGE 1;T...", 23 (0x17))
ibwrt(GPIB0, "*TRG;VAL1?.", 11 (0xB))
ibcmd(GPIB0, "_?", 2 (0x2))
ibgts(GPIB0, 0)
ibcmd(GPIB0, "?_ .", 4 (0x4))
ibcmd(GPIB0, "A", 1 (0x1))
ibrd(GPIB0, ".", 1 (0x1))
ibcmd(GPIB0, "._?", 3 (0x3))
ibgts(GPIB0, 0)
ibcmd(GPIB0, "? A", 3 (0x3))
ibrd(GPIB0, "+0.381E-3.", 1024 (0x400))
ibloc(GPIB0)
ibonl(GPIB0, 0)
with these two from above (ASCII unprintables not shown of course) I'm doing UNL, UNT, MLA0, SPE then setting MTA1 (my UUT)
ibcmd(GPIB0, "?_ .", 4 (0x4))
ibcmd(GPIB0, "A", 1 (0x1))
I then attempt to take a reading. At this point it's all assumption as I'm not quite sure what I'm doing for the next command. I see in the comparable spy traces items like P or ` which I understand to equate to 01110000 (RQS,ESB,MAV) and 01100000 (RQS,ESB). This leads me to believe that sending anibcmd with SPE also generates a *STB? command internally and places the status byte register in the buffer.
However, I get very sporatic results from my reads and they are most often x20 (0). Sometimes a 16, sometimes a 48.. but ibsta is always 356 and I always get a valid response from the device.
Am I incorrectly reading the results of the serial poll enable (SPE) from my ibcmd? Am I not setting it up right to populate the buffer with the STB after starting SPE?
Thanks,
CT