LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

compound boolean logic scripting

Matt,
 
You mentioned that you wrote a scripting system that uses text to drive a LV queued message handler. Is this anything you could post? I need to do the same thing and would welcome any head start I can get.
 
George
0 Kudos
Message 11 of 16
(1,033 Views)

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

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 12 of 16
(1,027 Views)

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

0 Kudos
Message 13 of 16
(1,021 Views)
LabVIEW unfortunately does not adapt well to this environment.  They call it TestStand if you want this functionality. 
 
To do nested I had to create a stack of script pointers.  I think you only need script pointers for the while loops.  Old school approch to saving and getting information by pushing and poping pointers to a stack.  This was a several week project to get this to work and another week to make it solid.  Another thing is that I use a list box to display the script and highlighted the script execution. 
 
I tried to get permission to write up and submit to NI but not approved at this time.  Stay tunned.
 
Good luck,
 
Matt 
Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 14 of 16
(1,018 Views)

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

0 Kudos
Message 15 of 16
(1,005 Views)

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

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 16 of 16
(992 Views)