pockey Posted January 15, 2007 Report Share Posted January 15, 2007 Hi, all I'm writing LabVIEW to test a board through COM Port. There're buttons on the front panel for user to send commands to the board. I could send one command at a time and display the response on a string indicator... However, I did not know how to send continuous commands one-by-one with just one button. For the "Reset" buttons, it will only send "x" to the COM Port, and the program runs OK. For the "RX_LOWBAND" button, it should send string "p rxon1", "p paen0", "p hp0", "r 0x0118" and "r 0x24ad" one-by-one to the board and get each corresponding response. I use a stacked sequence stracture to send these five commands one after one, however, the program could only implement the first one. Since I'm quite new to LabVIEW, I do not know whether there's some easy way to realize that... Could anyone give me some suggestion? Thanks a lot! Download File:post-6631-1168846857.vi Quote Link to comment
Donald Posted January 15, 2007 Report Share Posted January 15, 2007 Hello, I think you should consider a redesign of your code starting from one of the Design Patterns included with the standard templates. Depending on your knowledge of LabVIEW and application requirements you should go for a one loop state machine or consumer/producer pattern with 2 loops. Also consider using events instead of polling buttons and do not forget your error handling. Best regard, Donald Quote Link to comment
karthik Posted January 15, 2007 Report Share Posted January 15, 2007 Hello pockey, Donald is absolutely correct... :thumbup: I have moved my mouse considering Donald's suggestions and your requirement. Result is a small piece of code which can guide in right direction. I have used events instead of pooling and included error handling. I am sure you can figure out remaining coding part... All the best. Regards, Karthik SP Download File:post-4779-1168870168.vi Quote Link to comment
pockey Posted January 16, 2007 Author Report Share Posted January 16, 2007 Thanks a lot, karthik with your template, the problem seems clear to me. I'll try to figure other parts out! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.