LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert digital signal to analog

Hi..

I am using NI 9375 (DIO module) to read the output from flow sensor.

The output of the flow sensor is in the digital signal.(Boolean=True/False).

How can I convert the digital signal to the analog to get the reading of the flow sensor?

I had tried before to convert the digital signal to the frequency so that I can make the conversion from frequency to the flowsensor reading,

but it doesn't work.( I am referring to http://www.ni.com/white-paper/14549/en/ ).

dta.PNG

0 Kudos
Message 1 of 11
(4,471 Views)
What do you mean by "it doesn't work"? How fast is the pulsing? Are you sure you are getting a nice clean signal? What is the output level from the sensor?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 11
(4,464 Views)

@nhan91213 wrote:

Hi..

I am using NI 9375 (DIO module) to read the output from flow sensor.

The output of the flow sensor is in the digital signal.(Boolean=True/False).

How can I convert the digital signal to the analog to get the reading of the flow sensor?

I had tried before to convert the digital signal to the frequency so that I can make the conversion from frequency to the flowsensor reading,

but it doesn't work.( I am referring to http://www.ni.com/white-paper/14549/en/ ).

dta.PNG


FYI - If your flowmeter pulsing frequency is higher than 500Hz then you won't get reliable reading using your algorithm, and it will be very unreliable above 1kHz because fastest that loop runs is 1mS (1kHz).  In that case you could tie the timed loop  to a higher rate (hardware) clock source to go faster than 1mSec loop time.  If no hardware then I think you can use high resolution timer (in LV2014, not sure if it was also available in previous version) and a regular while loop with algorithm modification for a faster timing.

 

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


Message 3 of 11
(4,455 Views)

@mikeporter wrote:
What do you mean by "it doesn't work"? How fast is the pulsing? Are you sure you are getting a nice clean signal? What is the output level from the sensor?

Mike...

Mike,

when I run the vi and the flow sensor is on, the indicator for counter and period didn't give any value. 

The frequency range for output signal is 0.3Hz - 200Hz.

0 Kudos
Message 4 of 11
(4,435 Views)

@BTC_Admin wrote:

@nhan91213 wrote:

Hi..

I am using NI 9375 (DIO module) to read the output from flow sensor.

The output of the flow sensor is in the digital signal.(Boolean=True/False).

How can I convert the digital signal to the analog to get the reading of the flow sensor?

I had tried before to convert the digital signal to the frequency so that I can make the conversion from frequency to the flowsensor reading,

but it doesn't work.( I am referring to http://www.ni.com/white-paper/14549/en/ ).

dta.PNG


FYI - If your flowmeter pulsing frequency is higher than 500Hz then you won't get reliable reading using your algorithm, and it will be very unreliable above 1kHz because fastest that loop runs is 1mS (1kHz).  In that case you could tie the timed loop  to a higher rate (hardware) clock source to go faster than 1mSec loop time.  If no hardware then I think you can use high resolution timer (in LV2014, not sure if it was also available in previous version) and a regular while loop with algorithm modification for a faster timing.

 


The output signal are:

 

Frequency range : 0.3 Hz - 200 Hz

Output Pulse : 5 msec +/- 25%

0 Kudos
Message 5 of 11
(4,428 Views)

Hi nhan,

 

you count the pulse. Just get the difference of the pulse count each second to get your frequency…

 

Btw. I would do the counting in the FPGA. No need to have the RT part loaded with such a simple task…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 11
(4,415 Views)

GerdW wrote:

Btw. I would do the counting in the FPGA. No need to have the RT part loaded with such a simple task…


I usuallly use the FPGA to get the time between pulses and pass that value up to the RT.  The RT can then perform the math to get your flow rate.  The FPGA is a lot more accurate for counting the time than the RT since it is actual hardware timed instead of 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
Message 7 of 11
(4,395 Views)

@crossrulz wrote:

I usuallly use the FPGA to get the time between pulses and pass that value up to the RT.  The RT can then perform the math to get your flow rate.  The FPGA is a lot more accurate for counting the time than the RT since it is actual hardware timed instead of software timed.


I too recommend this method.  I do the same but with PWM measurement or PWM generation.  Have the RT calculate the frequency and duty cycle based on the value of the pulses from the FPGA.  RT can handle the floating point math much better.

Message 8 of 11
(4,384 Views)

@GerdW wrote:

Hi nhan,

 

you count the pulse. Just get the difference of the pulse count each second to get your frequency…

 

Btw. I would do the counting in the FPGA. No need to have the RT part loaded with such a simple task…


Hi GerdW,

tq for the reply.

I am new to labview,I have no idea on how to count the pulse. The ouput signal for the sensor is true/false.

If you don't mind, can you show me the example on how to count the pulse.

0 Kudos
Message 9 of 11
(4,340 Views)

@Hooovahh wrote:

@crossrulz wrote:

I usuallly use the FPGA to get the time between pulses and pass that value up to the RT.  The RT can then perform the math to get your flow rate.  The FPGA is a lot more accurate for counting the time than the RT since it is actual hardware timed instead of software timed.


I too recommend this method.  I do the same but with PWM measurement or PWM generation.  Have the RT calculate the frequency and duty cycle based on the value of the pulses from the FPGA.  RT can handle the floating point math much better.


Hi Hoovahh and crossrulz,

tq for the respons.

I appreciate if you can show me the examples on how to get the time between pulses or with PWM..

Below is what i've done but the count or period doesn't give any value.

fpga flow.PNG      <<<<<<----- fpga for flow sensor

 

host flow.PNG<<<<---- Main host for flow sensor

0 Kudos
Message 10 of 11
(4,339 Views)