From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Combinational robot

i have written a code using arduino for a robot and i am using Labview to send data so tat based on tat it does the required operations . My code is working properly but whenever i send data rx pin on arduino blinks but at d 1st click it never does the required job and i need to click it twice or thrice to make it work the way i want it to.Pls do help me out

Download All
0 Kudos
Message 1 of 4
(2,402 Views)

LabVIEW tip.  Don't open and configure the serial port on every iteration of the while loop.  Configure it before the loop.  There should be no need to flush the buffer.

 

Since you say that your code is working properly, but the robot is not doing what it needs to, then the problem must be in either the Arduino code or the robot.  Neither of those things can be solved on a LabVIEW forum.

0 Kudos
Message 2 of 4
(2,381 Views)
  • Configuring the COM pert should be before the loop.
  • You need an event for the stop button
  • What is the mechanical action of your buttons? (If these are latch action booleans, they belong inside the event structure. If they are "switch action", multiple buttons pressed at the same time are allowed and you need 256 cases. Do you have that?).
  • Why don't you consistently use error wires?
  • What is the event configuration? (The text is cutoff from view).
  • Why do you even need an event structure?

 

Please attach the actual VI. We cannot debug pictures. Thanks.

 

0 Kudos
Message 3 of 4
(2,377 Views)

@altenbach wrote:
  • What is the mechanical action of your buttons? (If these are latch action booleans, they belong inside the event structure.).

 

Please attach the actual VI. We cannot debug pictures. Thanks.

 


That is almost certainly the problem.  Because the boolean is read first in the loop, then the waits at the event structure until something happens.  So if you hit "W" at that point, the event case for "W" value change will occur, but since the "W" button was false prior to that, your "W" case in the inner case structure will not run. 

0 Kudos
Message 4 of 4
(2,373 Views)