Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

how can i stop prorgamm which use serial port ?

i make a program which read data from serial port . when i press on the " stop " button the program dosent stop. 

how can i solve this problem ?

..............................................
" Science is came....not come "
I study Mechatronics Engineer
..............................................
skype : t_alhowaiti
0 Kudos
Message 1 of 14
(6,001 Views)

Post your program and we can add some useful comments.

Otherwise just a wild guess:

You have not stopped one of the while loops in your program.

greetings from the Netherlands
0 Kudos
Message 2 of 14
(5,981 Views)

i divide the program to two photo....my program read RFID card from serial porthttp://www.mikroelectron.com/index.php?route=product/product&product_id=237&search=rfid

..............................................
" Science is came....not come "
I study Mechatronics Engineer
..............................................
skype : t_alhowaiti
Download All
0 Kudos
Message 3 of 14
(5,979 Views)

It is very difficult to troubleshoot an image and twice as hard to troubleshoot two images. Please post your VI.

 

What happens in the cases not shown?

 

My first guess would be that your serial port is waiting for a termination character or the 13th character. It is almost always better to configure the port and close the port outside the loop and only have the reads inside.

 

Infinite timeout (or whatever value is coerced to fit a U32) will have to expire before the loop completes its execution and stops. Also, the stop button is probably read immediately after the loop iteration starts, so the stop =True will not be read until the next iteration. So the time to stop is approximately 2*infinity if the VISA Read does not complete normally.  Actually the largest possible timeout value is about 49 days, so your loop may stop somewhere near the end of May.

 

Lynn

0 Kudos
Message 4 of 14
(5,957 Views)

this is my program

..............................................
" Science is came....not come "
I study Mechatronics Engineer
..............................................
skype : t_alhowaiti
0 Kudos
Message 5 of 14
(5,955 Views)
Why do you open the serial port in the loop?
And where is the close of the serial loop?

And pleasesend in the vi instead of a picture of a vi
greetings from the Netherlands
0 Kudos
Message 6 of 14
(5,950 Views)

the close of serial port is found in my program

..............................................
" Science is came....not come "
I study Mechatronics Engineer
..............................................
skype : t_alhowaiti
0 Kudos
Message 7 of 14
(5,947 Views)
Constantly opening and closing the port makes it more likely that the program will not run for a long time.
0 Kudos
Message 8 of 14
(5,944 Views)

how can i make my program run for 24 hours

..............................................
" Science is came....not come "
I study Mechatronics Engineer
..............................................
skype : t_alhowaiti
0 Kudos
Message 9 of 14
(5,940 Views)
I don't see much reason why it wouldn't if you fix the configuration/close in the loop problem. If you want to stop it automatically, use the Elapsed Time function.
0 Kudos
Message 10 of 14
(5,931 Views)