Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

controlling Xantrex

You are not using the XanXT Initialize that I sent you. Without that, you don't have a VISA Resource Name and no way to set which port you connect to. And please, get rid of the sequence structure and local variables. Just wire error out to error in of the next function and the same with the VISA Sessions. Your program should look like the attached picture.
 

Message Edited by Dennis Knutson on 10-30-2006 08:36 AM

0 Kudos
Message 11 of 26
(1,942 Views)

I missed to set the current to, unless it will not work.

My new VI works.

Thank you for your help.

 

0 Kudos
Message 12 of 26
(1,936 Views)
I'm glad it works but  it's still ugly code with the sequence structure and the local variables. You really need to learn how to use dataflow in LabVIEW. It is the basis for the language. Your trying to do the set current and set voltage in parallel, really doesn't work that way and you've just made the program much harder to debug and maintain. Your main VI can be converted to what I have in the picture. You should notice that it is much simpler to read because nothing is hidden in a unnecessary sequence structure. You should also make another change. In your VI and the modified, the while loop runs as fast as possible and will continue to sent commands over the bus until you press the stop button. This really creates a lot of bus traffic. You only want to send a command when the value of either the current or voltage changes. This is easy with the event structure in 6.1 or greater. With 6.0, you should wire the voltage and current to a shift register and with each loop iteration, compare the value in the shift register to the current control value. Only is there is a difference should you write to the instrument bus. You also have to have a small wait in the while loop. Without it, the while loop runs to fast for the OS to do anything and your VI can appear to be hung because you can't click the stop button.
0 Kudos
Message 13 of 26
(1,934 Views)

Here's what I mean by using a shift register to check to see if the value has changed.

Message Edited by Dennis Knutson on 10-30-2006 10:58 AM

0 Kudos
Message 14 of 26
(1,930 Views)

Hi,

I'm using you VI, but I'm also experiencing troubles.

In the part where you Query the Instrument ID I receive a time out error. I think it has something to do with the delay and read VI.

Does someone have an IDEA?

 

Thanks so far,

physics2007

0 Kudos
Message 15 of 26
(1,766 Views)
Is this with a serial connection? If so, there are a number of reasons that you might be getting no response from the instrument. The com port settings (baud rate, parity, etc.) may be not match between the VI and the instrument. You could have the wrong type of serial cable. If you have a straight through, switch to a null modem type and vice versa. If it is serial, you should first try to communicate with a program like Hyperterminal. Get it working there and LabVIEW will be a piece of cake.
0 Kudos
Message 16 of 26
(1,757 Views)
Hi,
 
thanks for your really quick answer.
 
I checked the Baud-Rate and so on.
 
I'll try hyperterminal on monday 'cause I'm fed up with it today.
 
I'll response therefore on monday.
 
Thanks for your help,
 
physics2007
0 Kudos
Message 17 of 26
(1,754 Views)
Good morning,
 
I think I have a conection because I can send data to the instrument. However I can't read it, I get a time out bug.
 
I suppose that the readout-part makes problems. Therefore I localized the bug in a visa-modul.
 
To make my problem understandable I attached a picture. The modul, marked red, causes the problem.
 
Thanks so much for your help.
 
Physics2007
0 Kudos
Message 18 of 26
(1,729 Views)
physics2007,
  1. Can you post a screenshot of the error message?
  2. Also, is the VISA Read returning any data at all?  
  3. What about the return count?
  4. What byte count is being sent to the VISA Read?  Try reducing it and see if the Read still times out.
  5. Try increasing the amount of delay time in Delay & Read VI.
Let us know how that goes,

NathanT
0 Kudos
Message 19 of 26
(1,716 Views)
Hi,
 
1) I put a several screenshots in the attachement, which can be downloaded The Visa-modul marked red, causes the error. Messages marked red like (Fehler...) means (error...)
2) VISA does not return any data at all. The error occurs only by reading out something. The VISA-Write function seems to work properly
3) The return count is empty. However, I worked with the Measurement and Automation Explorer. There I receive different byte counts.
4) The byte count beeing send is 50. I reduced it to 20, but that did not solve the problem.
5) I increased the delay-time to 2000ms, but that did also not solve the problem.
 
Any other ideas?
 
I'm really glad about any help and I really appreciate that.
 
Thanks a lot.
 
physics2007
0 Kudos
Message 20 of 26
(1,714 Views)