01-30-2013 05:00 PM
Hi there!
New to LabView and looking for some help. I am learning this from a course, and we didn't get much introduction to the specifics when using Arduino. I am trying to have 3 toggle switches that each control their own separate LED on and off. I can run the program and it works fine, and when I hit the stop button (on the front panel) I get this error: "Error 5003 occurred at LabVIEW Interface for Arduino.lvlib:Set Digital Pin Mode.viLabVIEW Interface for Arduino.lvlib:Digital Write Pin.viLabVIEW Interface for Arduino.lvlib:Init.vi. A timeout occurred while trying to read form the Arduino." Below is what my VI looks like. Any help is greatly appreciated!
01-30-2013 11:07 PM
Make the array of 3 LEDs & give input as true. then shift the input
01-30-2013 11:09 PM
Can you post your VI & show the LEDs you want to glow simultanously (Hope so)
02-01-2013 01:18 PM
So I have fixed the problem and was hoping you could confirm something for me. Attached is the VI and I have also included a new picture of my block diagram. My question is for the write commands for each of the LEDs, are they supposed to be "parallel" as they are in the first picture, or in "series" as in the second one?
02-01-2013 01:38 PM
The error was outside of your loop (if I am reading the diagram correctly). You had one open but tried to close the resource three times. My guess is the first closed OK but then the 2nd and 3rd timed out...
02-01-2013 01:41 PM
That is true, I ended up figuring that out, but I removed 2 of them and still got the error. If, however, I left the one in the middle, I wouldn't get an error. Since I can't tie the 3 write commands outside of the loop to one close command, I think I must put them in series in order it to always close when I want it to. Otherwise, how will I know which write command to put the close command after?
02-01-2013 01:43 PM
You have a serial connection and you cannot send commands in parallel. You have a single connection and you would only close it once. Keep the sequential code.
02-01-2013 01:45 PM
Ok thanks Dennis, that's what I was thinking. Like I said, never really learned some of the specifics so took some trial and error to get there
02-01-2013 01:48 PM
Using data flow it might work once (or a lot) correctly in line 2 but it would not be a sure thing. It would be better to combine everything back into one and then close. In this case combine your error outs with a "merge errors" vi and after that close the resource -- feeding the merged error line into the close reference.