03-02-2012 01:06 PM - edited 03-02-2012 01:09 PM
hello, I am trying to count pulses of the encoder connected on Arduino UNO digital pin 3 with Labview 2011.
I am able to see 0 and 1 status changing in 'Value' indicator, and display the waveform chart correctly,
but I do not know how to count the total number of pulses (rising or falling edges).
This test with shift register is not working. Should it be an event structure, looking at the changing of status HIGH-LOW on digital pin 3?
Thank you
George
03-05-2012 02:13 PM
Hi,
There might be a problem in your code due to an uninitialized shift register. Every time you run your code the shift register would store a value from previous executions of the VI and pass it to the while loop. To avoid that right click on the input terminal of the left shift register and select Create » Constant and set the constant to zero. That way every time you run your code your count will start from zero and not the previous value of the count.
When you run the code do you see the "Numeric" indicator change value?
For future reference, please post Arduino related questions to the LabVIEW Interface for Arduino community page.
03-06-2012 03:40 AM
Hello, thank you for the suggestion, I added it. This is also a general Labview question, even if I am using an Arduino HW platform now for testing.
I know there are counters on specific pins of DAQ boards, but I am trying to do the same 'via software' on a standard digital IO pin. Is there any function detecting a change of state HIGH-LOW and sending the output to an indicator? I could not find it in the relevant palette.
03-07-2012 11:47 AM
Hi,
You can use an event structure to detect a value change on an indicator connected to your digital read function. Every time that value changes an "event" will be triggered. You add specific code inside the event structure that will be executed every time this event occurs. Have a look at this tutorial for more details. Also, you might find this example helpful as well.
11-12-2012 03:52 PM
Dear all
I am starting wok with arduino uno and labview.
Now I'm trying to work with an encoder http://www.dfrobot.com/index.php?route=product/product&path=47_110&product_id=634#.UKFvEuTtRgg
Now I can control the motor with http://www.dfrobot.com/index.php?route=product/product&product_id=69#.UKFv1-TtRgg.
My problem now is the encoder, I can read the pulses, but seems something is rong. When motor turns on and with a very slow speed the pules are not constants, seems the arduino don have speed enought to get the pules in right time (or the connection between the pc and arduino).
Can some one help me? I put in attach my first program to control a Dc motor with encoder.
Best regards
CPalha
11-12-2012 09:39 PM
Dear all
I move this question for the arduino forum.
Best regards
CPalha
03-14-2013 09:12 PM
Hello my friend.
Have you solved this problem about the late of the sing reading betwen Labview and arduino?
I`m trying to do exactaly the same projet, so, I'm having the same problem.
Please, help me anyway!
thansk a lot.
lincolnfox@gmail.com
03-15-2013 01:28 AM
Hi
Please see this post
https://decibel.ni.com/content/thread/15442?start=15&tstart=0
I give up from the encoder, I use a magnetic switch and 2 magnetic pieces attached to the moter axle. So I have 2 pulses per revolution.
CPalha
11-14-2013 05:19 PM
hello such, any consultation with arduino is better than consult in the next group, also find, documentation, examples
https://decibel.ni.com/content/groups/labview-interface-for-arduino
11-14-2013 05:20 PM
add other useful links, greetings
http://sine.ni.com/nips/cds/view/p/nid/209835
http://vishots.com/getting-started-with-the-labview-interface-for-arduino/