LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

need yours advise...(problem on my program)

hi..
i build program with that contain 2 frames of "Sequence Structures"
in the first frame: i read status of the motor ("1"-work   "0"-idle)
in the second frame: i read speed of the motor.
 
when i run the program in "continues mode" ,sometimes, the "motor speed indicator" show me the status of motor value
and the  "status of motor indicator" show me the motor speed value.
i comunicate with sirial RS-232 cable.
 
 
why this happen ? (i always think that Sequence Structures, do the first frame,finish to do it,and only after that, the second frame is execute)
 
 
thanking you in advance.
 
0 Kudos
Message 1 of 4
(2,799 Views)

Can you attach your Vi ??

 

Regards

CLAD
Using Labview 5.1,6.1,7.1.8.0
0 Kudos
Message 2 of 4
(2,792 Views)
First, you should never run a program in the continuous run mode, except as a brief test. The program should contain a loop which repeats the parts which need repeating. Similarly, the front panel should have a "Stop" button so that the user never needs to use the Abort button on the tool bar. That is for use by the developer in case of a program error.

From your brief description you should probably initialize the serial port outside the loop. Then read the status and update the indicator on the "Status" case of a state machine and get the speed in the "Speed" case. Look at numerous examples of state machines in the examples which come with LV and which have been posted to the Forum. With a state machine you have much more flexibility and do not need sequence structures.

Lynn
0 Kudos
Message 3 of 4
(2,782 Views)
thanks all.  🙂
0 Kudos
Message 4 of 4
(2,749 Views)