07-18-2006 02:49 PM
07-18-2006 03:25 PM
George,
I can't post the code but can give you a good stating point. The queue is just a series of messages. These messages can become the script by having a text file with a list of messages that will be put on the queue when the script is read.
Set the case structure to Case Insensitive Match to reduce errors. I used spaces to delimit data so I could pass in parameters into the queue. The first word is the queue command and anything after that is a parameter. So all states that the queue could call had no spaces in the name.
Example:
sendTouch 20 40
sendTouch = Is a state in the case structure that can be called from the queue
20 and 40 = Are parameters that can be passed in as messages
I used String => Match Pattern to space to parse up the queue messages
Does this make sense?
The next step was the logical control of the messages in the queue. This was very difficult. In short while processing an IF conditional statement with a True conditional you need to do nothing. Just keep processing the messages in the queue. If False, remove all messages from the queue until you find the endIf. Let me know if this is enough detail to be useful. I have not had time to work on compound statements but have it working with nested IFs and Whiles.
Got to go,
Matt
07-18-2006 03:37 PM
Thanks for the info. Passing parameters to the queue is pretty familiar to me. I was more curious about If statements and While loops. Anything at all you can offer about nested Ifs and Whiles would be welcome. I understand though if it's a pain to try and explain. I haven't found anything about this on the NI site.
George
07-18-2006 03:54 PM
07-19-2006 07:43 AM
One more question then I'll go off and give it a try. Did you parse the script first and build a queue from that or did you add items to queue during the processing? When I did this before I didn't have any branching to worry about so I built a queue beforehand. That would also work with something like a FOR loop, but I'm not so sure about an IF statement. I suupose items could be removed from the queue if necessary when the IF conditions were processed. Maybe you already said that. Anyway, thanks for the boost. I needed something to jumpstart me.
George
07-20-2006 03:17 PM
I loaded all items from disk to the quque (an string). I did not parsing of the individual lines until it was the command to be processed then I parsed out the first word to be the queue command. Any additonal itesm were parameters.
I will be at NI Week it you wish to discuss further. I will be easy to find because enrolled in all of the Vision classes
Matt