06-22-2018 06:03 PM
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!
06-22-2018 09:19 PM
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!
06-23-2018 07:40 AM - edited 06-23-2018 07:41 AM
@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
06-23-2018 07:42 AM - edited 06-23-2018 07:43 AM
@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.
06-25-2018 10:16 AM - edited 06-25-2018 10:18 AM
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.