LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

time-variable input

Solved!
Go to solution

Hey,

 

i'm a student in a lab and we have a DC power supply "Agilent E3646A". I have install driver for this. From front panel i can change the voltage but what i need is to simulate the power from a Satellite Photovoltaic Panel.

 

So, i need to have as input an array with different value of voltage which change every one minute.

Im new in labview and i don't know it well.

 

I have attached the  VI of our supply.

 

Thank you in advance.!

0 Kudos
Message 1 of 7
(4,348 Views)
Solution
Accepted by sarri

Hello sarri,

The code I am giving you is bit advanced but hope you will understand.

It has two parts.

 

First use a another while loop as in the figure.

The loop has two shift registers

1) time loop 

2) index of the voltage value array.

In the timer part check if 60 seconds has elapsed. When 60 seconds has passed, increase the index of array to select new voltage value. Also replace the timer shift register to new value.

Screen Shot 2014-06-11 at 20.42.37.png

 

 

157+ CLDs & 9 CLA Trained
LabVIEW Training resources
Message 2 of 7
(4,335 Views)

As I understand your question, you want to "do something" once a minute.  LabVIEW, unlike many other programming languages, treats Time as a Very Important Player -- there is a Timing palette on the Block Diagram that will allow you to "Wait 60000 milliseconds" (or 1 minute).  Since LabVIEW uses data flow, putting such a function inside a While loop will cause the loop to run once a minute, with no extra work!  No need to read the time, do computations, keep checking the time, etc.

 

It was unclear how you were generating the voltages you want to output.  if you have a pre-generated set of voltages, you can save them in an Array and "feed" the Array into the While loop.  Even better, replace the While loop with a For loop, which will (by default) automatically index through your Array.  You put the same "Wait" function inside the For loop (so it loops once a minute), and when all the Array elements have been output, the loop exits (and you clean up after yourself).

 

Alternatively, you could put a random number generator (from the Numerics palette) inside the While loop to have random values output to your device.

 

Bob Schor

0 Kudos
Message 3 of 7
(4,324 Views)

Hey, thank you so much.

 

It works.!

I created a sample example with a little changes and it worked right.
Monday, when i will return to my lab i will test it with our Aginlent DC supply.!

Thanks again!

0 Kudos
Message 4 of 7
(4,300 Views)

Hey Bob,

 

thanks for your reply.
I would not to domethnig once a minute, but contineously !
I want every one minute the output voltage take the next value of the array and keep it for one minute.And after one minute to take the next.

0 Kudos
Message 5 of 7
(4,296 Views)
You only have to write once to the instrument. It will not change so there is no need for continuously writing the same value so Bob's suggestion is the correct method.
0 Kudos
Message 6 of 7
(4,280 Views)

Sir, 

I am so grateful that you could provide us, beginners, with this solution. But the problem is as we are beginners we weren't exactly able to implement it properly. Sir, would you be kind enough to share this small project file with us? We would be eternally grateful.

I hope you will consider our request.

0 Kudos
Message 7 of 7
(2,108 Views)