LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with labview model

Hi, everyone.
I ran into a problem and I would be happy to help , I built the module shown in Figure 1, the goal is to measure time on the exit of the Hall sensor

(ie whenever the voltage is large a certain value then approach a magnet sensor)

The timer in picture 1 works fine, but as soon as I connect the part of the sample the timer gets stuck on value 3.6 ... and does not move even though the value at the timer entry is FALSE (as seen in picture 2)

I would love if you could help me, how can I connect the modules to work as in fig 1fig1.png

0 Kudos
Message 1 of 6
(2,898 Views)

So, two issues:

 

The 3.6 is because your numeric indicator is too narrow on the front panel. So actually, if you make it wider, you'll see it says 3.64898e+9 (at least right now, probably it was a bit lower when you tried). This is the number of seconds since January 1st, 1904. See here for more details: LabVIEW Timestamp.

 

Second issue: Your code is much more complicated than it needs to be to do the operation you're trying to do. I'd strongly suggest taking some of the tutorials and looking through the learning materials at the top of this forum, but as a simple example, this will probably do what you want:

Example_VI.png

The image above is a snippet, you should be able to save it to your computer then drag and drop it into LabVIEW to recreate the code.

 


GCentral
0 Kudos
Message 2 of 6
(2,834 Views)

Hey
Thanks a lot for the help, the problem was that I needed my model to continuously calculate the engine RPM with the sensor.
In the end I managed to get by.
I have another small problem, how can I save the value created from the switch - case structre
I mean that I want to put were the red highlighted circule  when the switch - case structre is false it will save some value (currently the value is saved)
And when the allowance is changed to true the value will not change.
 After that this value should enter the graph that will show me the rotation speed as a function of the torque.


Download All
0 Kudos
Message 3 of 6
(2,753 Views)

gdfgfd.PNG

0 Kudos
Message 4 of 6
(2,750 Views)

Hi ada,

 

after using AutoCleanup and removing some glaring Rube-Goldbergs your VI is reduced to this:

check.png

As I don't understand what you want to achieve in this VI I could not recommend any more changes…

Best regards,
GerdW


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

@adadadadm wrote:

Thanks a lot for the help, the problem was that I needed my model to continuously calculate the engine RPM with the sensor.
In the end I managed to get by.
I have another small problem, how can I save the value created from the switch - case structre
I mean that I want to put were the red highlighted circule  when the switch - case structre is false it will save some value (currently the value is saved)


OK, please take a step back and not show us convoluted code that makes no sense (even though Gerd was able to somewhat clean it up :D).

 

Tell us what you want to do, not how you want to do it!

 

What is the VI supposed to do, exactly? You talk about calculating RPM, but none of your indicators is labeled RPM!

Shouldn't some of your shift registers be initialized? What's the point of the loop inside the sequence frame all the way to the left?

All loops stopping after one iteration serve no purpose (you use them to anchor shift registers, but these belong on the outer loop).

 

Assuming you simply want to measure the elapsed time between two successive true conditions on the comparison, you can do that with much lesscode.

0 Kudos
Message 6 of 6
(2,704 Views)