02-04-2025 08:06 AM
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
02-04-2025 08:09 AM
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???
02-04-2025 10:06 AM
@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 ...
02-04-2025 11:23 AM
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
02-04-2025 11:29 AM - edited 02-04-2025 11:30 AM
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.
02-04-2025 12:15 PM
@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?
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.
02-05-2025 01:44 AM
@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.
02-05-2025 01:50 AM
@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
02-05-2025 04:30 AM
Hi,
I aquire 0 values of Al Current, why?
Thanks
ALHABEEB
02-05-2025 10:29 AM
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_mA−4mA)/16mA.
Any way to organize it more?
Thanks
ALAHBEEB