07-08-2013 12:03 AM
Hi,
I have a proximity ultrasonic sensor used to control a weeding device. I am using the sensor to detect the differences of plant heights. Plants are weeds and crops, I want basically to kill weeds and avoid damaging to crops by the device. The crops are higher that weeds, so I am using LabVIEW with USB DAQ 1208FS to compare the different heights. My sensor is located in front of the device in about 20 inches. When it starts reading the first plant (weed) the device will act immediately and kill it. When it gets to the second plant (crop), the device will act on the first plant which means skip some weeds as the sensor read crop. This way I might kill crops along with weeds or skip weeds. Is it possible to store or delay the sensor data till the weeding device get to the required target? Thanks!
Solved! Go to Solution.
07-08-2013 03:58 PM
Hi Mazin,
LabVIEW allow us to store data in some many different ways. Additionally there are different options to implement a delay depending on how you are implementing the solution. However if you give more details on how you are programming the solution right now or which driver or API version you are using, that would allow me to come back to you with a more precise reply.
Regards
Frank R.
07-08-2013 09:11 PM
Hi Frank R,
Thanks for your reply. I am using LabVIEW to acquire analog signal from the ultrasonic sensor and convert it to digital to operate a hydraulic solenoid valve (ON-OFF) which will move the weeding device up and down depending on the height differences of plants. I am using a time delay to control the timing of the device, but its not working for me. The time it takes the device to move up or down is about 2 seconds, and the distant from the sensor to the weeding device is 20 inches. I am using ULx as the DAQ is 1208FS from measurement computing. Attached is the VI that I am working with. Thanks!
Mazin
07-09-2013
02:58 PM
- last edited on
10-02-2024
05:50 PM
by
Content Cleaner
Hi Mazin,
You could take into account the Elapsed Time Express VI to count time and take decisions with it, since we have a Boolean in the output. (small change in the code)
Now, if you want to implement more changes but following an scalable solution and LabVIEW good programming practices, you could implement a state machine. With this pattern, it is easier to introduce changes and delays in the code.
You could check the example below just as a reference to understand the idea.
DAQmx Acquire and Digital Out State Machine
Regards
Frank R.
07-09-2013 03:36 PM
Thanks Frank, I will try your suggestions!
07-09-2013 08:51 PM
Hi Frank,
I tried different ways to modify some examples to use the elapsed time, but it messed up the VI. I am still a beginner in LabVIEW, so I would appreciate it if you could help me modify my VI using the elapsed time. Thanks!
Mazin
07-10-2013 07:24 PM
Mazin,
Are you trying to introduce the delay here?
Do you need to delay the data flow for 2 seconds there?
Regards
Frank R.
07-10-2013 07:50 PM
Hi Frank,
I believe you are correct. The delay will introduced to the digital out. I attached a snippet of the VI. Thanks!
Mazin
07-11-2013 08:36 AM
Mazin,
In that case, you could include a "time delay VI" instead. To ensure the proper data flow, you should cut there the error wires, and connect them in the input and output of the time delay VI (series connection). That way you could include a delay exactly there.
Regards
Frank R.
07-29-2013 08:55 PM
Hi Frank,
Thanks for your help. Do you know how to use arrays to store data (voltage) from ultrasonic sensor for some amount of time then release it later. Thanks!
Mazin