Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

timer

Solved!
Go to solution

Hello everyone, I'm working on automating the capture of voltage, temperature, current and irradiation in a photovoltaic panel. The program design is done, where enters the four values ​​to obtain the IV characteristic curve of a photovoltaic panel, also the power and efficiency is calculated.
The circuit design is in the program, the system: must have two states, the resting and active, all in function of time, the active state is given only every 10 minutes for a period of one minute, and the resting it's during the 10 minutes.
Let's start by resting state, in this state that it's during 10 minutes the entire period, writes in PWM port 11 an output  of  logic 0 (or volts), which connects the panel to the charge controller, also verified temperature, if the temperature in the panel exceeds 30 ° C activated a logic 1 in the PWM port 12, that's it all for the resting state.
As for the active state is once they finish 10 minutes, is activated for 1 minute, in this period, the PWM 11 outputs a logical 1 (5 volts), the program captures all values of the analog ports every 10 seconds (voltage, temperature, current, irradiation as already mentioned) which are stored in a excel file and calculates all equations, graphs and display their outputs once concluded starts again counting 10 minutes in an infinite loop.
But it is not  synchronizated of time, try by all means, anyone can help me with that?.  the active state (Automatizacion curvsa I-V) and the rest (Automatizacion parte2), I regret my ignorance.

Download All
0 Kudos
Message 1 of 3
(5,215 Views)

To synchronize the two VIs I suggest that you create a new main VI and use both of these (with some modifications) as subVIs. The main VI would monitor the time and call the appropriate subVI.  A better approach would be to use a state machine but you may not want to go through the learning curve right now.

 

To use the existing VIs as subVIs you need to change them so that they do not need the user to press a stop button. They should run for a short time and then stop automatically. If needed the main VI can call them repeatedly.

 

For Automatizacion parte2.vi:

1. Separate this into 3 different VIs. Remove Initialize.vi and Close.vi. Place those outside the loop which will be in the Main VI. The parts which are inside the loop become the third VI. This will set the duty cycle and read the analog data. It will not have a loop of its own. It will do one Set/Read/Set cycle each time the Main VI calls it.

2. Check the calculation of the temperature. Make a subVI of this part: 

Temperature conversion.png

Put a control on the lower input of the <= comparison and an indicator on the output of the to U8. When I do this I get only values of 0 or 255.

 

For Automatizacion curva I-V.vi:

1. Same as for the other VI.

2. Remove the event structure. The Main VI will call the code to read and convert the results once every ten seconds. This VI will run in a few milliseconds.

3. Put the charts on the main VI.

 

 

For both VIs: Create input controls and output indicators as needed for the data. Assign then to the connector pane so they will work as subVIs.

 

Lynn

 

 

 

0 Kudos
Message 2 of 3
(5,179 Views)
Solution
Accepted by GonchiNavía

Hello GonchiNavía,

 

I post an answer on your other post:

Manejar delays y tiempos

 

I really hope this helps you, best regards!

David P.
National Instruments
Applications Engineer
www.ni.com/soporte
0 Kudos
Message 3 of 3
(5,170 Views)