Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Count digital inputs

Hi all,

I want to count the number of digital inputs I am getting.

I found the “Toggleincrement” function (see attatchement) that is counting inputs controlled by a Boolean Control using an Event Structure.

Now, when I change the Boolean Control for my digital input the Event Structure does not work anymore.

Could somebody help me please?

Thanks!

Carola

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

Hi Carola,

If I understand your problem you want to use the example you post with another type of boolean control?

I think your problem is that events are linked to a specific control, so if you try to change it the event looses this link. Have you try to right click on the control and choose "replace"?

I post an enhanced version of your example. But don't forget LabVIEW help if you have troubles with strucute event: http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/cfgevents/

I hope this can help you,

Regards

0 Kudos
Message 2 of 7
(6,375 Views)

Thank you everybody for your replies. I am new with that and I am a little bit lost...

 

Yes Audrey, it is exactly what it happens to me: if I try to change the specific control, the event looses the link..but what I want is to change the boolean of the example NOT with another type of boolean but I want to control it directly with my digital input (coming from a photodetector). Something like what I post.

Have tried to right click on the control and choose "replace" but I can only do so to change to other type of boolean or similar things...nothing happens when I try to replace the boolean with input.

 

Thank you!

 

Caroal

0 Kudos
Message 3 of 7
(6,365 Views)

Hi Carola,

 

Unfortunately, events can not be used in this case. Which PXI board are you using? does it have counters?

 

Because, what you want to do can be easily done using the count digital events LabVIEW/DAQmx example:

https://decibel.ni.com/content/docs/DOC-11412

 

Regards,

0 Kudos
Message 4 of 7
(6,348 Views)

Thanks for your answer Audrey.

My PXI board is a PXI-6254 M series. I tryed what you are proposing me but I could not find the right channel to use as a counter...

Carola

 

 

0 Kudos
Message 5 of 7
(6,343 Views)

Carola,

 

you just need to wire your digital signal on the counter source (PFI 8 for counter 0, see http://zone.ni.com/reference/en-XX/help/370466V-01/device_pinouts/6254_pinout/ ), and then choose the the rigth counter as input of your DAQmx create task VI (PXI1Slot2/ctr0 for counter 0).

 

You can find here a video tutorial about using counter:

http://www.ni.com/academic/students/learnlabview/digital.htm

 

Regards,

0 Kudos
Message 6 of 7
(6,338 Views)

Thank you reply Audrey!!! It is working now!

The thing is that I still cannot use it because it is counting the photodetection events way too fast. Alternatively I wrote something it is working more or less OK.

Thank you very much for your help!

Carola

0 Kudos
Message 7 of 7
(6,325 Views)