LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

arduino switch

Hi everyone. So I have a limit switch hooked into a digital read pin of my Arduino. I am trying to get the Arduino to output a 1 when the switch is closed and output a message and output 0 when the switch is open and clear the message. The trouble I am having is that the Arduino will output a 1 when the switch is closed but if the switch is opened, the reading will not immediately turn to 0. The indicator in my Labview code will say that value of the digital read is switching from 1 to 0 very quickly and will end up at 0 after a few seconds or the reading will stay at 1 and then after a few seconds switch to 0. I was just wondering if anyone knew of a way to get a definite 1 and 0 without the quick change between the two when the switch goes from closed to open. I am pretty sure it is something to with the Arduino board itself and not the switch

0 Kudos
Message 1 of 3
(2,520 Views)

Hello Jon,

 

It sounds like the action of your Boolean might be to blame.  You want your switch to go from 0 to 1 and stay there - correct?  The value can either switch once or switch until it is read; these actions are Switch and Latch, respectively.  It is possible that changing the Boolean action of your indicator in LabVIEW will be able to give you the behavior you are looking for.  See this help page for more information.

 

If LabVIEW is properly reading and displaying the value, then you are correct in stating that the problem is with the Arduino board itself.  What model of Arduino and what switch are you using?  It might be useful to check the documentation of the Arduino device and see if there are instructions for controlling whether the digital outputs lock or reset their values.

 

Additionally, there are pages specific to the use of Arduino with LabVIEW.  This forum is more about LabVIEW, but if your problem is on the Arduino side, you should check out the Arduino community at the following link:  https://decibel.ni.com/content/groups/labview-interface-for-arduino/.

 

Good luck with your application!

Patrick
CLA
0 Kudos
Message 2 of 3
(2,466 Views)

 

 

reviewing your program does not appear that this timing parameters programmed routine to avoid saturation the processor, if any delay occurs you may be able to observe changes in state, add other useful links, greetings

 

NI LabVIEW Interface for Arduino Toolkit - 

http://sine.ni.com/nips/cds/view/p/nid/209835

 

 

Getting Started With the LabVIEW Interface for Arduino

http://vishots.com/getting-started-with-the-labview-interface-for-arduino/

 

 

Ready to get started?

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

0 Kudos
Message 3 of 3
(2,402 Views)