LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

boolean button control and GPIB communication

Hi group:
 
My project is to implement the communication between Labview and Agilent35670A analyzer by NI GPIB card.
Now the communication is ok and when I use normal string input box to write a command string to Agilent analyzer, everything is fine.
 
But the problem is:
 
When I want use some buttons to control the command string(eg: to input different command string by different button), that is not working during the running. such like "ok" button (eg: after I press the button to trig a input command "*IDN?" during the running process, there is no response and the button can't jump) .
 
It seems there is a confict between "GPIB Read" and these buttons. When I just use "GPIB write" without "Read",  it works.
 
does anybody has good idea abou it ??
Thanks a lot
 
Best regards

Wei
0 Kudos
Message 1 of 17
(4,490 Views)
Could you post your code? It's really hard to determine what you've done by just a brief description. I also don't know what you mean by 'the button can't jump'.
0 Kudos
Message 2 of 17
(4,486 Views)

Hi Wei,

I think you are missing on the simple fact that you have to do a write first to make a read. what i mean is that , you have to write the query to the instrument and then do a read.

Eg: if you want to measure voltage on the insturment.

you write MEAS:VOLT?

and then perform a read function, thus the instrument will return your query.

You dont get this problem when you do a write because you are not going to query anything further, instead you are just setting the device.

Hope it helps.

0 Kudos
Message 3 of 17
(4,483 Views)

Hi :

Thanks for your replying, I try to change the structure based on  your ideas, but it is still not working.

I attached a example to this meassage

1.  In this example,  when I used the normal string input box to manually input the command string to  "GPIB write",  it works. But after I change it to the boolean button. no response.

 



Dravi99 wrote:

Hi Wei,

I think you are missing on the simple fact that you have to do a write first to make a read. what i mean is that , you have to write the query to the instrument and then do a read.

Eg: if you want to measure voltage on the insturment.

you write MEAS:VOLT?

and then perform a read function, thus the instrument will return your query.

You dont get this problem when you do a write because you are not going to query anything further, instead you are just setting the device.

Hope it helps.




For your suggestion, sometimes, the commands of Analyzer are based on "query". for example: the command "calculate:data?" which is used for returning the datas sampled from Agilent Anlyzer.  So if I "write" it firstly without "read", I think there should be a error about it. 

 

Thanks a lot

Wei

 

0 Kudos
Message 4 of 17
(4,467 Views)

You are saying that if you enter "calculate1:data?" into the Characters to Write string, you will get a response but if you then change the wiring so that output of the concantenate to string is wired to Characters to Write and you change Characters to Write to an indicator (as shown below), it does not work?

Also, do you know that there is a driver for this instrument at the Instrument Driver Network?



Message Edited by Dennis Knutson on 11-26-2007 02:38 PM

Message Edited by Dennis Knutson on 11-26-2007 02:39 PM
0 Kudos
Message 5 of 17
(4,459 Views)
Hi Dennis:
 
Thanks for your replying.
 
I just directly connected "output of the concantenate" to input of "GPIB wirte".
I attached the example on this message. there is just such a little change to official GPIB's example, could you check it for me.
 
I guess, maybe there is a confict between the boolean buttons and the "GPIB writing and read"
 
Thanks again.
 
Wei
 
Ps:  where can find the Instrument Driver Network?, I suppose the driver is ok, because I could implement the basic communication between the Labview and Agilent 35670 Analyzer.  Just boolean control buttons do not work.
0 Kudos
Message 6 of 17
(4,446 Views)

This example is different than the last. The first example you were doing a query. The last one you are not and a read would not apply. What is the exact syntax per the manual. What is the exact syntax of the command you send without the Boolean. I'm also assuming that you run the VI only once and aren't doing something silly like run continuous mode.

And what do you mean where is the instrument driver network. I posted and you just reposted the link.

0 Kudos
Message 7 of 17
(4,439 Views)


hanwei wrote:
Hi Dennis:
 
Thanks for your replying.
 
I just directly connected "output of the concantenate" to input of "GPIB wirte".
I attached the example on this message. there is just such a little change to official GPIB's example, could you check it for me.
 
I guess, maybe there is a confict between the boolean buttons and the "GPIB writing and read"
 
Thanks again.
 
Wei
 
Ps:  where can find the Instrument Driver Network?, I suppose the driver is ok, because I could implement the basic communication between the Labview and Agilent 35670 Analyzer.  Just boolean control buttons do not work.


Looking at what you are doing, you are directly concatenating the strings and writing to gpib, i wonder if you are writing it correctly. check the syntax for the instrument. as you concatenate.
 

 
0 Kudos
Message 8 of 17
(4,432 Views)

I didn't give the information clearly enough, sorry about the confusion.

I am just a beginner for Labview, perhaps there are some silly problems on my project. sorry about that.

Actually, the real command that I want to input without boolean is "calculate1:data?" .  (it is a query)
But whatever I input a query or just a command (such like random commands), it does not work with Boolean. you know, I  try to make you clear what about my questions, so i just send the 2nd simple example (a little change based on the official example). sorry about confusion.
 
Besides, I  run my program based the continuous mode, it also does't work.
 
May I repeat my question here?
 
 How can I  implement the GPIB communication based on the boolean buttons (inputting the string command). If you can give me a simple example about it, I 'll really appreaciate.
 
 
 Ps: the driver of my instrument(Agilent 35670A) is on the instrument driver network  and I already download it. But it seems all projects are implemented based on the VISA, (not special GPIB vi).
 
sorry bother you again
 
rookie,  wei
0 Kudos
Message 9 of 17
(4,412 Views)

Let's just try to review exactly how you run the VI. You have the output of the concatanate string wired to the GPIB Write input. You make the command1 button true, command 2 button false, Operation to 'Write then Read', and then you click the run button on the LabVIEW toolbar. If this is exactly what you do, what happens? Do you get anything read, something read, an error code generated? If this does not work, disconnect the wire from the concatanate string and have a control wired to the GPIB Write input. This should be exactly like the first VI you posted. Copy the string from the true case and paste it into the control. Run the VI. You've implied that this works. Can you confirm that this does in fact work or not? If it does work, I am at a total loss to explain why.

Also, why don't you want to use VISA? There is nothing in your program that would make using the lower level GPIB commands necessary.

0 Kudos
Message 10 of 17
(4,408 Views)