LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delay between two operations within the same visa write buffer

Solved!
Go to solution

Hi

 

I am new to labview and have been trying to figure out a way to introduce a few milliseconds delay between two operations within the same write buffer of a single visa write block. Following is what I want it to be like:

 

CURR: LEV 1.5

wait for some 50 ms

CURR: LEV 2.0

wait again

 

Actually I have to apply an AC signal to a coil with a certain frequency through an Agilent e3631a power supply source. So if there's an another alternative to it, then please let me know.

 

Thanks

Regards

 

0 Kudos
Message 1 of 13
(4,118 Views)

Hi Sitank,

 

use a loop with a wait statement to output those commands with a certain delay…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 13
(4,112 Views)
Gerd is correct. You do NOT use a single buffer or a single write.
Message 3 of 13
(4,103 Views)
Solution
Accepted by topic author Sitank

Here's two approaches. First being the simplest, just put a time delay between VISA writes. The second being a more robust because it allows you to build a series of commands by simply adding them to the string array. You could forget the case in the loop if you do not mind the 50mS delay before th first command is sent.

 

Vdelay.PNG

========================
=== Engineer Ambiguously ===
========================
Message 4 of 13
(4,091 Views)
Skip the case statement and place the delay after the write.
0 Kudos
Message 5 of 13
(4,083 Views)

 

Hey, hi again

 

Thanks for the help last time, but this time am facing a little bit of problem in storing the read buffer's values in an array. I would be getting values of current which I need to store, so that later I can plot them with time.

Have tried the shift registers but couldn't get it done.

And also the read buffer shows me the value as 8.45112, while the real value is 0.845112. While it shows the other value of 1.71590 as correct. Any suggestion?

I've attached the vi file as well.

 

Thanks again

Regards

 

 

0 Kudos
Message 6 of 13
(4,016 Views)
Can you attach an image of the block diagram? I'm posting from my phone. Your chart should be inside the loop so there should be no need for any shift register or array. And explain how you are getting this ac signal with a dc supply.
0 Kudos
Message 7 of 13
(3,996 Views)

Are you trying to communicate with 1 instrument?  If so, then why are you using a second VISA Session?

 

If you are trying to talk to multiple instruments, then that VISA open should NOT be inside of your loop.

 

Other small notes:

1.  No need to wire up the 2 to the N of your FOR loop.  The autoindexing input tunnel will limit the number of times the loop runs.

2.  You need to close your VISA sessions.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 13
(3,985 Views)

 

Hi

 

Here's the image of the VI.

Am using two instruments, I apply a dc signal through one and then measure the corresponding current with a multimeter. I've put the multimeter in the same loop as I have to measure the current at every applied value. And AC signal is off the table, am applying DC pulses now.

it has to be like this.

I apply 1A of current and then measure at the other end.

2A of current and measure again.

Hence, in the loop. Outside the loop I was only able to measure the current of 2A only, and not 1A.

 

Thanks yet again.

 

Untitled.jpg

0 Kudos
Message 9 of 13
(3,980 Views)

You should only OPEN the DMM session outside of the loop.  It only needs to be opened once.  And your wait should be done AFTER the current is set.  You need to allow the supply to react before you take the measurement.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 10 of 13
(3,969 Views)