LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While loops

Hi,

I have to read and write data. Is it possible to put them in one while loop or I need to separate them?

Thanks

0 Kudos
Message 1 of 34
(504 Views)

Hi alhabeeb,

 


@alhabeeb wrote:

I have to read and write data. Is it possible to put them in one while loop or I need to separate them?


You can put anything inside a (while) loop…

 

How you organize your VI (aka which algorithm you need to implement) should be dictated by your requirements!

So what are your requirements???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 34
(503 Views)

@alhabeeb wrote:

Hi,

I have to read and write data. Is it possible to put them in one while loop or I need to separate them?

Thanks


The depends on whether you expect a Write/Resonse or the target publishes automatically all the time ...

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 34
(461 Views)

Hi,

I have two heaters that need to be controlled (on/off) by using ni-9475 which generate voltage (digital signals)  according to set temperature point and measured temperature, as shown in the lower part of the while loop in my attached VI. Is my code good like this or need to be improved?

Thanks 

0 Kudos
Message 4 of 34
(438 Views)

For a DAQ system, I have the Analog Input be its own loop. It can then use a queue to send the data to another loop for processing and logging.

 

Also, the Digital Output tasks do not need the timing. You can just remove the DAQmx Timing VI from those tasks and they will be static/software timed.


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 5 of 34
(434 Views)

@alhabeeb wrote:

Is my code good like this or need to be improved?


While you have implemented many of my earlier suggestions, you still have completely unnecessary complications, for example your small case structures are equivalent to a wire, right?

 

altenbach_0-1738692406588.png

 

Also, the total time does not need to go through the case structure because it is just wired across in both cases (Yes, the compiler will simplify it behind the scenes, but code should be clear and things that don't depend on the case, should not go through the case structure for code readability!)

 

Why do both heater physical channels have the same default value? Why are most other channels blank by default?

Why is the front panel so disorganized? etc.

 

0 Kudos
Message 6 of 34
(416 Views)

@crossrulz  a écrit :

For a DAQ system, I have the Analog Input be its own loop. It can then use a queue to send the data to another loop for processing and logging.

 

Also, the Digital Output tasks do not need the timing. You can just remove the DAQmx Timing VI from those tasks and they will be static/software timed.


Thanks! It is done.

0 Kudos
Message 7 of 34
(368 Views)

@altenbach  a écrit :


While you have implemented many of my earlier suggestions, you still have completely unnecessary complications, for example your small case structures are equivalent to a wire, right?

 

 


Hi,

Yes, you are absolutely right.


@altenbach  a écrit :

Also, the total time does not need to go through the case structure because it is just wired across in both cases (Yes, the compiler will simplify it behind the scenes, but code should be clear and things that don't depend on the case, should not go through the case structure for code readability!)

 

 


Yes. it is done!


@altenbach  a écrit :

 

Why do both heater physical channels have the same default value? Why are most other channels blank by default?

 


Yes, it has been modified.


@altenbach  a écrit :


Why is the front panel so disorganized? etc.

 


Yes, I agree. I will organized it more when I finish all other improvements.

 

Is there any other suggestions? 

Thanks 

0 Kudos
Message 8 of 34
(366 Views)

Hi,

I aquire 0 values of Al Current, why?

Thanks

 

ALHABEEB

0 Kudos
Message 9 of 34
(347 Views)

I figured it out but it kind of a mess because I need to convert the current to mass flow rate by this formula

 

Flow Rate=(Measured Current_mA4mA)/16mA.

Any way to organize it more?

Thanks

 

ALAHBEEB​   

0 Kudos
Message 10 of 34
(317 Views)