10-09-2008 01:14 AM
hi need help
i have an array(requesting data like hyperterminal)...
let say my first index is requesting ... let say i have got reply... i must continue the second index
if my first index request is not response i have to request it for 30 second ..and if it didnt reply thn only i hv to go to next index..
hw to do tht?
can anyone help
thk u
10-09-2008 01:34 AM
Look at the standard state maschine design pattern. You can find this under File > New... > VI > From Template > Frameworks > Design Patterns.
You have three states: Send request, Wait for response and exit. Additional you need a shift register holding the index into your array. Start with Send request sending the request to the device. Then change to Wait for response. Here you can check for timeout and repeat the response. If you got the response you can change the index and send the next request. At the end of the array you can go through exit.
You can add other states if need for e. g. initializing the communication or other things.
10-09-2008 03:03 AM
hi thk u
can i have an example of this... plz...
thk u
10-09-2008 03:18 AM
10-09-2008 03:19 PM
Hi jeyanthi,
As waldemar said in his post, in LabVIEW, click on File, select New... (make sure you select the one with the dots), expand the folders named VI, then From Template, then Frameworks, and finally Design Patterns. The Standard State Machine example should be an example of what he is talking about. For more information on state machines, see this document.
Regards,
Stephen S.
10-09-2008 03:34 PM - edited 10-09-2008 03:38 PM
I created a small example from the template I mentioned and added the two states I was refering to. There is a wait miliseonds function included. This is just to slow down the VI and allow you to see in the indicators what is happening.
The examaple is in LV 8.0.1.
Stephen S. thank you for adding the tutorial to the thread.