LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issues writing SCPI commands unless in Highlight mode

Hello LabView folks! 

 

I have searched the forums and cant seem to find an answer to this.  I have a simple project that is initializing communication to a power supply, and then quickly pulses the output voltage from high to low repeatedly.  My problem is that I can not get it to work unless I am highlighting execution, thereby slowing it down a ton.  This may sound similar to other posts, but the difference is that I am not reading anything back from the power supply-  I am simply writing to it.  Another piece of detail is once I upset the power supply by running my application at full speed, the highlight mode will no longer work. This is fixed by me closing Labview and starting over. I must be tying up the VISA some how...

 

I have attached my code and a screen shot.  The problem must be occurring within the inner most for loop when the VISA writes occur.  Seems to me that the delays of 500ms should be plenty long between writings. Anyone have any ideas how I can improve on this?  

 

Thanks!

Download All
0 Kudos
Message 1 of 5
(2,647 Views)

Hi Jared,

I modified your code to send pulses when you click the "Pulse" button.  From what you've said, it sounds like your Power Supply simply can't handle the two VISA Writes with 0.5sec between Writes.  You might try varying the delay-duration, between writes, to see if you can determine what the working threshold is. Also, you might double-check that commands are terminated with \r\n.  It's a common terminator, though, some instruments just want \r or \n, but not both.

Do you have a scope so that you can see what the power-supply is doing?

I too have experienced a "hang" and have used Highlight Execution without being able to see anything running, but those little green run arrows can be hard to spot!

Cheers!  

 

 

Message 2 of 5
(2,609 Views)

@550nm wrote:

Hi Jared,

I modified your code to send pulses when you click the "Pulse" button.  From what you've said, it sounds like your Power Supply simply can't handle the two VISA Writes with 0.5sec between Writes.  You might try varying the delay-duration, between writes, to see if you can determine what the working threshold is. Also, you might double-check that commands are terminated with \r\n.  It's a common terminator, though, some instruments just want \r or \n, but not both.

Do you have a scope so that you can see what the power-supply is doing?

I too have experienced a "hang" and have used Highlight Execution without being able to see anything running, but those little green run arrows can be hard to spot!

Cheers!  

 

 


replied to the wrong post - sorry

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 5
(2,580 Views)

@Jaredguglielmo wrote:

Hello LabView folks! 

 

I have searched the forums and cant seem to find an answer to this.  I have a simple project that is initializing communication to a power supply, and then quickly pulses the output voltage from high to low repeatedly.  My problem is that I can not get it to work unless I am highlighting execution, thereby slowing it down a ton.  This may sound similar to other posts, but the difference is that I am not reading anything back from the power supply-  I am simply writing to it.  Another piece of detail is once I upset the power supply by running my application at full speed, the highlight mode will no longer work. This is fixed by me closing Labview and starting over. I must be tying up the VISA some how...

 

I have attached my code and a screen shot.  The problem must be occurring within the inner most for loop when the VISA writes occur.  Seems to me that the delays of 500ms should be plenty long between writings. Anyone have any ideas how I can improve on this?  

 

Thanks!


Most power supplies have some kind of slew rate when transitioning from one voltage to another.  It seems that it cannot reach the voltage you set it to before you order it to another voltage.  The simplest way to switch as fast as possible would be to change your command into a query by tacking ;*OPC onto the end of your command and then reading the result.  When the operation has completed, a "1" (or similar - refer to your manual to see exactly what your power supply outputs for *OPC?) will be placed in the read buffer.  Your VISA read will read this and then your code will continue.  You can keep track of time between loop iterations if you want to know how long it takes to transition.  Depending on the power supply, you might be able to adjust this slew rate so you can transition faster.  Just beware that the default settings are what the manufacturer deems optimal; increasing the slew rate may cause significant overshoot and/or ringing.

 
Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 4 of 5
(2,578 Views)

Thanks a bunch for your help Bill and 550nm! I am going to try the *OPC command.  I at one point thought that it must be a transition or slew rate issue but this power supply is supposed to be able to slew at ~.5V/us so I should be able to get to voltage in well under a single 60hz cycle.  The problem seems to improve when I lower the baud rate so perhaps this supply just has a small buffer that I am overflowing.  

0 Kudos
Message 5 of 5
(2,535 Views)