01-30-2014 04:06 PM
Hi,
I have used labview some but I am an arduino begineer.
I'm wokring on a project for college and I want to have Labview set a number of times for a LED to blink. (Later the LED will be replaced with a circuit). Basically what I want to do is be able to have the user input the desired number of blinks, and then the LED blinks accordingly.
I can get the LED to blink continuously with a while loop, so I changed it to a for loop with a control that sets the number of loops. This creates two block diagram errors. I have copied them below.
You have connected two terminals of different types.
These cannot be wired together because their data types (numeric, string, array, cluster, etc.) do not match. Show the Context Help window to see what data type is required.
The type of the source is 1D array of cluster of 3 elements.
The type of the sink is cluster of 3 elements.
So basically I don't know what the problem is, and I would really appreciate your help! If you have any alternate suggestions for how to do this, I appreciate all infromation. I attached my Labview vi as well. Thanks again.
- Brian
01-30-2014 10:27 PM
You are getting the broken wires becuase the for loop defaults to auto-indexing on it's boarders. This means that it outputs an array. You simply need change the tunnel mode to "Last Value" (since the value never changes in this case), simply right click on the tunnel and change it's mode.
02-03-2014 04:51 PM
Thanks for the help, it works now! I have another question.
I now need to read digital signals coming from the ardunio board and have labview recognize them. (I have attached my vi and a diagram showing how I connected my circuit.) I configure my I/O pin to pin 12, and I make sure I have a wire going to Digital pin 12. When I disconnect my circuit (by removing power) I expect the indicator on the vi to say that it is not recieving a voltage anymore, and the boolean LED to turn off, but this is not happening. I was reading online somewhere and it was mentioned that only pins 0 and 1 are used for labview communication, but I was able to communicate through pin 13 eariler, so I am alittle confused.
Thanks again for your help.
PS - Sorry for the bad image quality.
02-03-2014 05:43 PM
The state of a digital pin is not predictable when the input is floating. It may be High, low or bounce between high and low states. You need to add a pull down resistor at digital input pin 12. I suggest a resistor about 10 times the size of the resistor you show in red in your diagram.
See <http://arduino.cc/en/Tutorial/DigitalPins> for Digital pin background information.
How are you defining communicate through Pin 13?
hrh1818
02-03-2014 05:48 PM
I've not been able to look at your code yet (I don't have 2013 on this particular computer). But, it looks like you are shorting the digital pin to ground. This is not a good thing to do. You should only have two connections to the LED. One should be ground and the other should be the digital pin (make sure you hook up the LED correctly because they are direction specific devices).
02-03-2014 06:51 PM
I want to make sure I'm clear, this time I want Labview to be able to tell if the LED is on using Digital Read. When the switch is flipped the LED will turn on and the signal goes to the digitalread pin and to ground. (The LED is standing in for a proximity sensor)
If I am going to read signal from the digital pin, would'nt I need three wires? The red wire to power the LED from the 5V source, the blue goes to ground and the other blue goes to my digital pin that is sensing the voltage.
If I just connect the digital pin and the ground, I don't think I could sense the voltage because the digital pin would be both supplying and measuring. If I understand it correctly, I would need a voltage supply wire and a ground for current to flow properly. I would also need a wire going to the digital read pin to sense the signal.
I really appreciate your help. I have included an updated picture of my wiring situation.
02-03-2014 07:36 PM
I'm currently using a 1k ohm resistor for my LED, I'll try a 10k resistor. Do I need to use pin 13 for something? I was under the impression that pins 2 though 13 were identical except for the LED on 13 and the PNM on some of them.
02-03-2014 07:53 PM
You need to replace the blue wire that goes between the digital read pin and GND with a pull down resistor. Your diagram show the digital read pin is always connected to GND. Obviously this will not work. By replacing the blue wire that goes between the digital read pin and GND you will see the following.
1. When the switch is closed the digital read pin will be at a voltage approximately equal to the ratio of
pull down resistor / ( 1 k resistor + pull down resistor). The green LED will be dim.
2. When the switch is open the digital read pin is connected to ground. The voltage will be approximately 0 volts.
hrh1818
02-03-2014 08:02 PM
Thanks hrh1818, I see my error now. I really appreciate your help. Thanks again.