11-28-2012 04:55 AM
hey,Yamaeda
i can not understand you clearly. does it mean that i shoul put a control in timeout case to end the while loop containg that event structure? i can not figure where it is. in my opinio, once i trigger event structure,then, some case in that structure will happen. at the same time, three loops about controlling queue will suspend. after a particular case in event structure finished, the three loops will execute again. and i do not know your last suggestion, how can i change three loop around event for starters?
11-28-2012 05:20 AM
11-28-2012 05:32 AM
hey,Yamaeda
in my program, top while loop and event will use uart at the same time. but i think it does not matter, cause top while loop reads data from uart and event writes data to uart. and uart is a kind of full duplex protocal. before this program, i put those three sub loops about queue as an event case, and a top while loop contains this event structure, but once i trigger this case(read data from queue), i can not trigger other events, so i change is to this structure. my aim is to read data continuesly from uart, and at the same time, write some data to uart.
11-28-2012 05:53 AM
Quick suggestion, does this work similar to your idea?
/Y
11-28-2012 06:08 AM
hey,
it works,i can end the program with one control ! thanks for your great patience!!! i am a new bird for labview, so i still want to know the reason behind suggestions that it can end the program with one control press, but my program does not work. however, an old problem still exists, once you press many events, the whole program seems run so slowly. and you can not press other cases
11-28-2012 06:15 AM
Your reading loop spins as fast as it can (there's no wait, referring to my 1st assumption on greedy loops) which can cause the write commands to be slow, try a small wait in the read loop (10 or 100ms?) and see if it makes any difference.
/Y
11-28-2012 06:26 AM
hey,
i have put vi(wait) for 100ms in the loop containing visa read. now, the phenomenon is the first two buttons that i press responce quikliy ,then it is hard for me to press more, it shows slow responce
11-28-2012 06:55 AM
It sounds like the event starts taking alot of time, highlight execution mode and/or some timing info is needed to look for that issue, from a code perspective it looks like it should work.
/Y
11-28-2012 07:02 AM
hey,
i highlight the program, it looks like it works except that it is so slow. is there any possible reasons outside the program, like my pc is too old? do you meet the same problem? i add the vi(wait) to the loop containing VISA read in the"suggestions" you give me
11-28-2012 07:47 AM