LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Counting on sensors

I am trying to write a code that will count the amount of times something runs through a set of sensors. I have a set of sensors that will be counting the times that things run through it, connected to a usb-6001 DAQ, and would like some help.

0 Kudos
Message 1 of 27
(1,732 Views)

Its always better to share the exact issue what you are facing and sharing the module which you developed also will be beneficial.

Also be specific in your queries to expect precise response.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 27
(1,707 Views)

image.jpg

image.jpgThere will be a blade running through these 2 pnp sensors. I am trying to write a labview program that will be able to record the ammount of times the blade passes through the sensors. I first cannot get the DAQ to read the sensors even though the sensors are clearly picking up movement through them. Then I have absolutely no idea how to run the DAQ assistant and get it to read them.

0 Kudos
Message 3 of 27
(1,694 Views)

Hi collin,

 


@collin_g_10 wrote:

I first cannot get the DAQ to read the sensors even though the sensors are clearly picking up movement through them.


I would start with using some Wago clamps (or similar) to provide a good electrical connection for all those wires…

 

Then you should read the manual of your sensors to make sure you correctly connect all the wires! ("pnp" sounds familiar and related to "open collector", so you may need some additional resistors.)

In the next step you use a simple handheld DMM to verify the output signal of your sensor.

And in the 3rd step you connect the signals to your USB DAQ device and start a testpanel in MAX to check the signals…

 


@collin_g_10 wrote:

Then I have absolutely no idea how to run the DAQ assistant and get it to read them.


Why do you think you need the DAQAssistent?

Did you try to follow the example VIs found in the example finder explaining all the DAQmx features?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 27
(1,683 Views)

I have figured out how to get the sensors running and reading. In the top picture, you can see that on Labview Daq Assist, it is showing that there is a sine wave that is being produced. When I pass my hand through it, the sine wave just jumps from 0 to 1.5 like the picture is showing, whereas the sine wave is not getting bigger and is staying the same. In the bottom picture, you can see how when using the NI device monitor application, I am able to get some sort of signal, right where the highlighted spot is, is where I swiped my hand through the sensors. Am I not doing something right in the labview DAQ assist?

.Labview test where the amplitude starts at 0, then when I pass my hand through it, it jumps up to 1.5Labview test where the amplitude starts at 0, then when I pass my hand through it, it jumps up to 1.5When testing the data through NI Device monitor I get clearer data.When testing the data through NI Device monitor I get clearer data.

0 Kudos
Message 5 of 27
(1,630 Views)

Hi collin,

 

ohh, what noise do you measure here?

 

3 sine waves in 50ms gives 60 Hz: are your wires next to some power supply/cords?

Why don't you try to avoid (power supply) noise by shielding to yield better measurements?

Can you provide a manual/datasheet for your sensors?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 27
(1,619 Views)

https://www.automationdirect.com/adc/shopping/catalog/sensors_-z-_encoders/photoelectric_sensors/gen... 

 

This website provided is the sensors that we are using. I was able to shield the power cord, which did help and allow for labview to actually pick up the signal. When I put my hand through the sensors the amplitude jumps to around 10.6, the gradually regresses. Since I will be measuring a drone motor pass through it and try to count its RPMs. Is there a way that I would be able to count the amount of times that the DAQ/sensors hit that 10.6amps? or am I still doing something wrong?

collin_g_10_0-1679515739028.jpeg

This picture shows the sensor when my hand is between them.

collin_g_10_1-1679515832449.jpeg

This is what it looks like immediately after removing my hand. Then after I take my hand out it takes several seconds to get back to 0.

 

0 Kudos
Message 7 of 27
(1,610 Views)

Based on the slow response it sounds like you may need a load resistor.

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 8 of 27
(1,604 Views)

Hi collin,

 


@collin_g_10 wrote:

When I put my hand through the sensors the amplitude jumps to around 10.6, the gradually regresses.


This doesn't sound right.

  • Instead I guess your USB6001 gets a voltage higher than its measurement range of ±10V and so you read 10.6V! Did you think about protecting your DAQ device? Did you read the specs of the USB6001?
  • Which power supply do you use for your sensor?
  • Did you read the datasheet of those sensors? As you state "pnp type" you should have noticed "diagram 2"! Did you wire your sensor as is shown in that diagram?
  • What about connecting a shunt resistor between pin 3 & 4? Something like 500 Ohms?
  • Can you provide an electronic schematic of your whole setup?

@collin_g_10 wrote:

Then after I take my hand out it takes several seconds to get back to 0.


Because of missing shunt resistor. After all its a PNP output!!!

 

Is there anybody in your lab you can ask about basic electrics/electronics issues?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 27
(1,600 Views)

So when the sensors read at the top at 10.6 volts. I am okay with. But what it the best way to count the ammount of times that the blade will pass through. Because I am trying to make a program allowing it to count the blades and calculate the rpms. But I have no idea how to do that.

0 Kudos
Message 10 of 27
(1,535 Views)