LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Taking measurments and use them for controling devices with Prod./cons. Loops? (basic question)

Solved!
Go to solution

Hello everyone,

 

as part of the build up of an solarthermal system I need to control devices and take measurments. I already programmed the VI for taking the measurments and saving the data. But my problem that I don't know how to combine the control and measure part.

 

I thought about to use the classical "Producer/ Consumer-Loop" for taking the measurments and saving them. That works fine.

But, in addition to that, I need to control valves and a Pumpe by using the measured values. So shoud I run a second Producer/Consumer Loop in parallel or is there a other and better possibility to handel that?

 

I know, it's a realy basic question, but unfortunately this topic was not included in the NI Core 1 or 2 Cours. So I would be glade, if someone could give me a hint 🙂

0 Kudos
Message 1 of 8
(2,684 Views)

It depends ...
Are measurements fast in comparison to the regulation speed? How fast must the system react?

Depending on such factors you could control the system in a timeout on the consumer, or have a small loop queue up control signals at a steady rate (like 20Hz) (or in the producer loop), or have a free running control loop that simply uses the latest read data.

 

I often find the regulator need the measured values and need to react to the latest data. It's often easy enough to just queue up a Regulate after the measure, and possibly a timeout on the consumer.

 

Do that make sense?

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 8
(2,661 Views)

What update rate do you need?  Is there anything safety critical (pumps typically fall into that category)?

 

Control systems typically do not use a Producer/Consumer setup since you need to react to the latest data, not all of the data.  Depending on a few factors, I would usually put the measurement and the control code in the same loop.  Use shift registers to keep any system state needed for the control.


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 3 of 8
(2,659 Views)

So here are a little bit more information about the requirements:

The measurement rate is about 3 s an I have about 30 voltage Signals to measure by using a multiplexing card.
With two of the measured values I have to switch a pump on or off. The other values should be displayed in diagramms on the Front Panel  and saved to a file.
For the change of the operating state of the pumpe, I'm just using tow of the Temperature values. If the build temperature difference is greater or equal than 10 Kelvin, the pumpe should switch on. If the temperature difference is less than 2 Kelvin, the Pumpe should switch off (VI already existing). So we are tallking about a very slow process and a maximum of the temperatur changings about 1 Kelvin per minute. In addition there is a over temperature protection using the same type of hysteresis.

The on/off switching is done by using a relay card.

 

So yeas, the measurement is fast in comparison to the regulation speed.
The reaction time should be in the worst case one second after taking the mesaurement values.

0 Kudos
Message 4 of 8
(2,629 Views)

So you recommand to put the measurement and the control in on loop, and the process of saving data in a nother loop by using a Que to conect both loops? Did I get this right so fare?

0 Kudos
Message 5 of 8
(2,623 Views)

If it's that slow (basically anything <100Hz) it'd handle it in the consumer loop in the timeout case, queue up a control command after each sample-command. If for some reason the rate drifts due to slow states you can have an external loop queue up sample+control-commands.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 8
(2,621 Views)
Solution
Accepted by topic author Laudst

@Laudst wrote:

So you recommend to put the measurement and the control in one loop, and the process of saving data in another loop by using a Queue to connect both loops?


That is exactly what I would do.


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 7 of 8
(2,604 Views)

Thank a lot for your help!

 

0 Kudos
Message 8 of 8
(2,586 Views)