Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

what is the difference between "query" and "write" in Ni4882 communicator ?

I use "Measurement & Automation" software Ver2.0 to test my gpib application programs.
At the NI-488.2 communicator window, my program can response "query" button well.
but my system (vxWorks) will reboot if click the "write" button only.
System works well if click the "read" button after the "write" button.
I wonder what is the difference between "query" and "write" bottons ?
How can my application program to know which button was click. ?
0 Kudos
Message 1 of 7
(6,085 Views)
Hi

Query means write a command and read back the answer
Write means just write a command
Read means only read back an answer

So in short Query is a combination of first write and then read.
greetings from the Netherlands
0 Kudos
Message 2 of 7
(6,077 Views)
A query is an automatic read after the write is issued. I'm not sure what you mean by your application program. Is this a program on an instrument?
0 Kudos
Message 3 of 7
(6,079 Views)
Here are a little detail information about this problem. The company I work with (in San Leandaro CA) has one embedded system with vxWork real time operation system and we use TNT4882 chip to build the gpib interface. I implemented the gpib device driver code and application code myself and used the "measurement&automation" from NI to verify my application code. My application code always send response (text message) to the GPIB controller. I have no problem with "query" button and "read" follows the "write" button immediately. When I click "write" button only I have problem with system reboot (my real time operation system). I adjust my timeout program it can delay the system reboot but system always reboot. I believe somewhere my code causes this problem but where ? and why ? best regards Simon Chang
0 Kudos
Message 4 of 7
(6,054 Views)
Yoi probably hang your system because it wants to send data that nobody reads.
greetings from the Netherlands
0 Kudos
Message 5 of 7
(6,033 Views)

But if my system send message to "GPIB server" who do not  want to read this message, why my system reboot itself ?

0 Kudos
Message 6 of 7
(6,023 Views)
I won't be able to help since I've not done any embedded coding but I suspect you will have to post some of the code you'e written so that the people who are experienced, can see what you've done. An instrument, even when one that doesn't always send data back, should not have a problem with holding data in it's buffer indefinitely until the controller issues a read. Nothing should be sent by your instrument until the read event. In fact, an instrument should be able to handle two consecutive writes without crashing. Instruments will generate an error in this case, very commonly a 'query interupted' error code that can be read when the controller does an ERR? query.
0 Kudos
Message 7 of 7
(6,014 Views)