03-30-2007 07:17 AM
03-30-2007 08:05 AM
03-30-2007 08:06 AM
03-30-2007 08:19 AM
03-30-2007 09:29 AM
Another thought, not sure if it'll help or not.
One thing I've done is to define my own "scripting language" where there are specific keyword textstrings that I can associate with specific sub-vi's I've made. If I were to do it for functions like add, subtract, multiply, I'd also provide support for named variables.
Then a user can create a text script which my program can interpret and execute. Functionally, it's *kind of* like building code on the fly. Truly, it sequences operations on the fly, which may be close enough.
For your type of case, a script might look like:
Variable P1
S1 = SUBTRACT(14, 10)
P1 = MULTIPLY(S1, 7)
etc.
(Sorry, I still haven't figured out how to control single-spaced lines vs. double-spaced lines in this forum editor. I usually get double-spaced, but have occasionally gotten single-spaced and have no idea why.)
Will take a lot of careful string parsing and stuff required, but I hope it gives you a glimmer of hope that there are other ways to skin that cat...
-Kevin P.
03-30-2007 12:19 PM
Dropping nodes on the diagram is easy. Wiring them up is another story.
The Express VI's the Vision toolkits, the State Diagram Editor, and the VI Analyzer all use scripting.
Here is the link to the scripting forum on LAVA.
http://forums.lavag.org/LabVIEW-VI-Scripting-f29.html
I am always interested in the "use case" case for scripting.
Why do you want to do this?
Ben
03-31-2007 02:02 PM
I agree that it's weird that sometimes the editor uses double-spaced and sometimes single-spaced, but at least there is a way to reliably get single spaced lines - use shift+enter. This is also useful for paragraphs inside indented lists.
@Kevin Price wrote:
Sorry, I still haven't figured out how to control single-spaced lines vs. double-spaced lines in this forum editor. I usually get double-spaced, but have occasionally gotten single-spaced and have no idea why.
04-02-2007 11:34 AM
Hi,
Thanks for the answer. I wanted to build an application which would help in writing test cases. For example, I have sub vi's for Add, sub and muliply. Instead of an user writing a test case flow in labview, I wanted to give him a GUI in which would enable him to write testcases using the labview modules. This would be easier for an user to write his own test case even if he doesn't know much about labview programming.
Regards
Gopal
04-02-2007 11:52 AM
04-02-2007 12:01 PM
Neat goal. Trying to implement it as a GUI is well beyond what I've ever attempted. But the text-based invented script language I referred to earlier was designed to accomplish the same thing. Just a text language interface rather than a GUI. But I succeeded in largely extracting myself from the need to provide continuous long-term programming support for all the sequencing variations they wanted to try.
My most recent implementation was based on the idea of a "plugin architecture". Language instructions were implemented by vi's with the same name placed under a plugin folder. (Example: "Multiply.vi"). All vi's had to adhere to a common wiring terminal interface and some other specific conventions I documented with a generic template. Using this approach made the scripting language highly extensible, even after building an executable out of the main program.
-Kevin P.