01-22-2016 09:52 PM
It is Point by Point. The subVI has the abbreviations pt by pt in its title.
Use the search function on the block diagram palette to find it.
01-23-2016 04:41 AM
You can try the following code. It is reading from the array of booleans and incrementing the counter, if rising edge was detected.
Thanks,
Arev
CTO | RAFA Solutions
01-23-2016 06:04 AM
01-23-2016 06:35 AM
Hi GerdW
No any special logic. Just to better represent the idea of rising edge detection. The XOR logic detects the change, and AND logic makes sure to take only changes from False to True state (Rising edge).
Thanks,
Arev
CTO | RAFA Solutions
01-23-2016 06:47 AM
01-23-2016 11:08 AM - edited 01-23-2016 11:13 AM
Instead of a complicated compound node, it is easier to just place a simple comparison.
Here is code that counts false->true transitions.
(if the program starts while the signal is already true it will not count that because the transition occurred before the program start. If you want to treat that as a first transition, initialize the feedback node with a FALSE diagram constant instead. Modify as needed)
01-23-2016 11:42 AM - edited 01-23-2016 11:43 AM
One of the nice things in LabVIEW is the fact that you can easily make the code scalable to count several channels by using arrays.
Here's basically the same code that keeps count of 8 boolean transitions.
01-23-2016 04:55 PM - edited 01-23-2016 04:57 PM
Hi Altenbach,
Thanks for the sample code. It shows and works the way way I need it, however, I try to connect my USB-6501 to it and as you can see in the picture, the data does not match.
I had tried multiple ways to corrected. I am a bit slow learning this things. I appreciate your assistance.
01-23-2016 05:09 PM
You have an array of booleans, so use "index array" to get one one specific element.
01-23-2016 06:42 PM
Hi Altenbach, your sugestion worked, thanks a lot.
I have one last question before closing this discussion. I attempted to add a secondary switch, however, both signals (LEDs) and counter behave in the exact same way.
How can I have the counters be independant from each other? I also tried to add a png to this message, however, for some reason I am not able to, so I attached the code.