LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA read problem

Hello

 

I'm writing .vi for power supply, connected via USB on PC. Inside power supply (hammeg) is also USB to RS232. I can read, write in LabView, but my problem is that when I write some command to VISA(like set voltage and current) and then use property "bytest at port"->READ VISA, I only get previous data from VISA and not current one. I also add some short delay between write and read but it's same. Also try to Clear VISA before all, but it's same. Anyone know where could be a problem?

 

Thanks

_________________________
Rookie; LV 2011 on WIN 7
0 Kudos
Message 1 of 4
(2,071 Views)

Hi hlod,

 

Can you post a copy of your VI?

 

-CC 

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


0 Kudos
Message 2 of 4
(2,058 Views)

Sure, in attachment

_________________________
Rookie; LV 2011 on WIN 7
0 Kudos
Message 3 of 4
(2,054 Views)

A few pointers just quickly looking at your program:

 

1. You need to close the VISA session by adding the VISA close VI to the end of your code (see the basic serial read example to see where to put it correctly)

 

2. You don't need all of the Sequence structures you've put in, read the tutorials etc. to see when/where to best use sequence structures.

 

3. OP 0 will never be sent as a command because your serial code does not run when your boolean button is false.

 

4. Also, how are you running this program? I hope you aren't using the Run Continously button! That is a debugging tool only. Put a while loop around your VISA read/write section of code.

 

Try these changes to your code (especially the one about closing the VISA session) and see if they help your program execution.

 

There are also some free tutorials covering the basics of LabVIEW (http://www.ni.com/gettingstarted/labviewbasics) and the examples that ship with LabVIEW are always a good place for a beginner to start.

 

 -CC 

 

p.s. Feel free to post your code again when you've made those changes and if your problem isn't fixed 

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


0 Kudos
Message 4 of 4
(2,031 Views)