Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Attempting to command NI Instrument Simulator to assert SRQ

Solved!
Go to solution
Hi there,

I am communicating with the NI instrument simulator v2.0 using the NI-488 DDK API on a non-Windows platform.

I haven't been able to get the simulator to assert SRQ with the sequence of commands as shown in the NI Instrument Simulator manual (*ESE 01;*SRE 20;*OPC)

I am able to send the '**IDN?" query to each of the 3 primary addresses and receive an identification message from each of the simulated devices.

I am trying to get the DMM to assert SRQ, although any of the simulated GPIB devices will do.

Af first I tried to query the various register settings but then I would see the SRQ light on the simulator go on and off and the ibsta variable would show the SRQI bit being set and later cleared when I sent a query command. So I eventually commented these queries out of my test code after an initial verification that the registers were set as commanded.

I was given the NI instrument simulator without the Wizard software so I believe the box is in its default mode. It has no dip-switches on it except for a toggle switch set to NRML.

I am able to printf() the ibsta, iberr, and return result values from the ibcmd(), ibwrt(), and ibrd() calls that I make in my test code so any suggestions regarding what else in the NI-488 DDK API, in the simulator commands, or from the simulator indicator lights that could provide me more info to debug this problem would be appreciated.

Thanks,
  Paul 


0 Kudos
Message 1 of 2
(3,396 Views)
Solution
Accepted by topic author S.D. Plissken

Hi there,

 

After further experimentation I determined what the problem was. I had previously removed the '0x' prefix from the register values when setting the ESE and SRE registers otherwise I would get a 'Command Error' in the ESR. Although I was still thinking of these values as hex the instrument simulator was interpreting them as decimal. So now when I send '*SRE 32' the instrument simulator does what I expect it to.

 

That still begs the (minor) question of why I was having problems with the '0x' prefix. I tried 'FORM:SREG HEX' to see if that command, which causes the query results to be returned in hex format, also influenced the simulator's parsing of the register value in the command but still no joy. However, since I have a workaround, I'm moving on.

 

Paul

 

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