LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Starting a timer based off voltage difference

Hello!

 

I am very new to LabView and I am struggling to get started on a project. My project is to build a ramp and run a car down the ramp. While the car goes down the ramp I will have lasers and photo resistors to measure the car's time stamps. From there I will get velocity, acceleration, and position. 

 

The problem is I have yet to find a LabView function that will start recording the time the moment my first photo resistor's resistance drops due to the car blocking the laser. 

 

Someone in person recommended Elapse Time in Express Via, but I am trying to collect as much information as I can on the subject. I am open to different approaches to this problem if anyone has a different method. 

 

Thank you

0 Kudos
Message 1 of 11
(2,972 Views)

Not knowing what hardware you are using... and assuming you have all of the sensors running into multiple channels of a DAQ device...

 

Just start a continuous acquisition before the car starts and then analyze the acquired data to locate the first sample of the sensor in question is blocked and use the time of that sample as "t0".

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 11
(2,947 Views)

Assume all hardware is working correctly. 

0 Kudos
Message 3 of 11
(2,933 Views)

@JSteakIII wrote:

Assume all hardware is working correctly. 


That is assumed.  What is not known is how you are getting the voltage reading into LabVIEW.

 

If you are using DAQmx you can probably use a triggered acquisition (Depends on what DAQ device is used)

If you are using something else you may be able to switch states from "Idle" to "Recording" based on the input.

 

Since we don't know what the hardware is we can't give you more specific advice.  Glad to hear its working though!


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 11
(2,923 Views)

Oh! I understand, I am using a DAQmx, model number I don't know I am no longer in the lab. I can get that information later.

0 Kudos
Message 5 of 11
(2,893 Views)

So far we have used the 5 volts our DAQ has given us to power our circuit.

 

*We do not know yet if that is sufficient enough for our project. 

0 Kudos
Message 6 of 11
(2,865 Views)

Hi JS,

 

We do not know yet if that is sufficient enough for our project. 

As we don't know your DAQ hardware nor your circuit nor your project we also cannot tell you!

But I can tell you: read the manual/specsheet of your DAQ hardware, it will specify how much power you can drain from the 5V output… (RTFM! :D)

Best regards,
GerdW


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

I understand you guys need the specific hardware. But I am only able to go into the lab 1 a week on Wednesdays so I cannot get the information yet. Thank you for the help so far though. 

0 Kudos
Message 8 of 11
(2,840 Views)

OK, So we should tag this as "Homework?"

 

Don't get me wrong! I love helping learners learn-  But, there are some provisos-  I will advise a student but, not do the homework for them.  Sometimes I'll just give a vi to a poster that needs it.  Usually, they ask for advice and reasoning.

 

(You really didn't want the A you didn't earn did you?)  Well, if you did want that A for anyway.. I may have just ruined that.  Advice is available.


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 11
(2,833 Views)

Here is the general approach (coding left to you since its homework).  As this task is basic, we don't need to consider architecture.

 

1) Code contained within a while loop; stop button to end execution of program

     1a) boolean logic can be used to also end the loop once the measurements are complete.

2) monitor the signal at the DAQ input at each iteration of the loop

3) When the value exceeds a threshold (greater than, less than, etc) record the current time.

   3a)  "Tick Count.vi" will give you the time in ms (keep this value)

4) Monitor second DAQ signal

5) When second DAQ signal crosses its threshold, record that time

 

 After this, you have two time values (apply arithmetic).

 

If you have specific questions regarding the DAQ and your circuit's power requirements, provide as much information as you can when you are able.  Note:  photo-resistors are generally slow (response on the order of 100 ms; which will add uncertainty to your calculations). If you have the option, use photo-diodes.

Message 10 of 11
(2,778 Views)