LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Acquisition and Control with different time rate - Structure Suggestions

Hi all,

 

I have to prepare a program that is capable of controlling and acquisition at the same time with different time rates. I need to control a compressor and acquire data from sensors. To control the system I have to generate analog signal 0-10 V continuously and take measurement once in a munite. To accomplish this task what kind of structure do I have to use?

 

I search a little on it and it is suggested to apply timed loops. I have never used that structure before and it seems too difficult to adapt to me for now. Could you suggest alternative structures? Or where could I find a good explanation of usage this timed loops? Because the writings about them I have read from help file is not explanatory enough for me.

Egemen
0 Kudos
Message 1 of 9
(2,973 Views)

I am also new in labview and not sure wether this helps or not

 

 

Labview user
0 Kudos
Message 2 of 9
(2,971 Views)

Thank you but it does not help in this stage.

 

I wonder that the frame around the png file that you attached. Did you capture this picture from Labview by Edit -> Import Picture to Clipboard... ? Or is it a screen capture which is taken programmatically? I used LV 2009 and there is no frame around captured files...

Egemen
0 Kudos
Message 3 of 9
(2,963 Views)

I created vi snippet from selection. its under edit tab.

Just out of curiosity could you br more specific about what are the problems with mine.

Labview user
0 Kudos
Message 4 of 9
(2,959 Views)

Which is the DAQ hardware used in the project? are you using PXI/PCI/cDAQ or cRIO or RT?

 

how time critical is the control of compressor? you will be better off using timed loops if you have a very time critical control and if you are using a real time or an FPGA (more suitable for timed loops) target.

 

if you are running your code on Windows, i do not personally see an advantage in using the timed loops.

 

for windows:

the basic architecture should be producer consumer loop, with producer handling the user events like start stop etc. you will need multiple consumers, one for acquiring data and for logging data if you wish to. these two loops can run once every minute.

the analog control of the compressor should be in another loop running at the about 10ms or 50ms time delay. start and stop commands should be passed from the producer using FGV

 

for RT/FPGA, have your user event handling on Windows PC and pass commands using TCP/IP to RT for acquisition. there you may use timed loops if you want to.

 

for loop delays of 1 minute, timed loop is not required. use a timer function to check the time elapsed and execute the function

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 5 of 9
(2,957 Views)

@Aojha wrote:

I created vi snippet from selection. its under edit tab.

Just out of curiosity could you br more specific about what are the problems with mine.


There is no problem with yours. I just wondered and recognised that there is no snippet vi function under edit in LV 2009. It must be a new in LV 2010 😄

Egemen
0 Kudos
Message 6 of 9
(2,951 Views)

@Freelance_LV wrote:

Which is the DAQ hardware used in the project? are you using PXI/PCI/cDAQ or cRIO or RT?

 

how time critical is the control of compressor? you will be better off using timed loops if you have a very time critical control and if you are using a real time or an FPGA (more suitable for timed loops) target.

 

if you are running your code on Windows, i do not personally see an advantage in using the timed loops.

 

for windows:

the basic architecture should be producer consumer loop, with producer handling the user events like start stop etc. you will need multiple consumers, one for acquiring data and for logging data if you wish to. these two loops can run once every minute.

the analog control of the compressor should be in another loop running at the about 10ms or 50ms time delay. start and stop commands should be passed from the producer using FGV

 

for RT/FPGA, have your user event handling on Windows PC and pass commands using TCP/IP to RT for acquisition. there you may use timed loops if you want to.

 

for loop delays of 1 minute, timed loop is not required. use a timer function to check the time elapsed and execute the function


I have cDAQ 9188, 2 x NI 9214, 1 x NI 9203, and 1 x NI 9263 (analog signal generation).

 

Compressor should be controlled continuously and can be set its rpm  immediately when the control is changed. Actually, this will be my first control project and do not have sufficient knowledge on it. I have never worked with RT and FPGA. So I do not know what they are exactly, structure, architecture, etc.

 

The user of mine just want to see analysis on the UI and they do not how to handle passing commands on both TCP/IP and RT. Hence, I prepared a execution of the VI to be used by the user easily.

Egemen
0 Kudos
Message 7 of 9
(2,949 Views)

Alright.

 

then proceed with producer consumer, where the producer is in turn a state machine. the consumer shall be your DAQmx code.

 

you can have the DAQmx code with both AI and AO in the same loop. just put the AI inside a case which is True when the timer function counts 1 minute. then reset the timer. your AO should not be disturbed untill the user clicks Stop.

 

if you have data logging, put that in another loop.

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 8 of 9
(2,938 Views)

@Freelance_LV wrote:

Alright.

 

then proceed with producer consumer, where the producer is in turn a state machine. the consumer shall be your DAQmx code.

 

you can have the DAQmx code with both AI and AO in the same loop. just put the AI inside a case which is True when the timer function counts 1 minute. then reset the timer. your AO should not be disturbed untill the user clicks Stop.

 

if you have data logging, put that in another loop.


Thank you Freelance_LV. I prepared a scheme guided by your suggestions and attached it below. Did I understand you right?

Egemen
0 Kudos
Message 9 of 9
(2,931 Views)