LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

having only one number

Hello all

I have a tachometer and I would like to have a simple counter but I have some problem on my programs. I used two ways:

 

1- I use  Daq assist (please see below picture).

 

Sml2010_0-1604773522924.png

 

I have number one when tachometer can see label but I have zero when it is normal and zero number

make the shift register zero again.

What should I do to have only number one and in off time having nothing?

 

02- I used  Daqmax in this program and you can see my program in attached picture :

I didn't have any counter. Would you please help me to know what is the problem in second program?

 

I check tachometer signal with NIMAX and it is ok.

 

Thank you

 

0 Kudos
Message 1 of 7
(1,340 Views)

Pictures of LabVIEW code are almost useless to many of us -- we need to see actual LabVIEW code, i.e. files that have the extension ".vi".  When dealing with DAQmx, it is extremely useful to know what NI hardware you are using.  You mention a "counter", but I can only see (again, in a "picture", so I can't learn much more) that you might be using an A/D converter (and if so, why?).  What is the nature of the device generating the signals you are trying to measure with your unknown DAQ device?

 

Bob Schor

0 Kudos
Message 2 of 7
(1,305 Views)

As a first step you should do some basic LabVIEW tutorials and look at the shipping examples. While as Bob already said we cannot tell much from a picture (express Vi configuration (DAQ assistant, from dynamic data) not visible).

 

There are some glaring issues with what we can see:

When you do a comparison with dynamic data, the result will be dynamic data containing only zeroes and ones. Why are you carrying everything as dynamic data and 1D array if all you are interested is a single scalar (i.e. he first element that can only have two possible values)? Why is the shift register not initialized?

0 Kudos
Message 3 of 7
(1,275 Views)

I am sorry, I know it is hard for professionals to work with amateurs like me.

I am using USB6009 

I attached files here.

 

Thank you

Download All
0 Kudos
Message 4 of 7
(1,236 Views)
  • Why are you attaching two different VIs without telling us why?
  • Why does one contain a gigantic breakpoint (red diagram outline)? Seems to be some example.
  • Seems that Num_Turns2 is similar to your code, but it still shows a complete lack of understanding (LabVIEW and logic). 
    • You are trying to do bitwise operations on a floating point number which gets coerced to an integer and since the value can only be 0 or 1, an "AND 1" will not really make a difference except act as glorified type conversion.
    • Why do you think you need to index the same array twice in parallel?
    • Your shift register is still not initialized. Do you know how that changes the behavior?
    • Why can't you change the data to a scalar of the correct representation right as it comes out of the acquisition?
    • Why all these coercion dots?
  • Sorry, I don't have drivers installed, so I cannot look at your assistant configuration. Can you tell us how it is configured? 

Can you step us through your though process. How does the signal look like? What are you actually trying to measure and how should it end up as a counter result? Please be specific.

0 Kudos
Message 5 of 7
(1,230 Views)

Hi to all

I brought this thread up again to make it end.

 

I finally programmed my request.

It is like this :

 

Sml2010_0-1606161453019.png

 

Thank you 

0 Kudos
Message 6 of 7
(1,164 Views)

Hi Sml,

 


@Sml2010 wrote:

I finally programmed my request.


  • Learn to use AutoCleanup - or follow StyleGuide on your own.
  • When you only need a scalar then why do you convert DDT to an array?
  • Why do you convert that DBL scalar into an U8?
  • Why do you compare this U8 with a DBL?
  • Why do you use a DBL indicator to show the result of that I32 (?) counter?
  • Why did you forgot to attach a VI/snippet instead of images?

 

Using SimulateSignal instead of DAQAssistent:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 7
(1,154 Views)