LuaVIEW?
这个东西的功能也比较强大, 哪位知道这方面的入门介绍? 比较中文且通俗一些的, 官方的介绍看起来有些累人.file:///C:/DOCUME%7E1/MARLON%7E1/LOCALS%7E1/Temp/moz-screenshot.jpghttp://www.citengineering.com/LuaVIEW/
LuaVIEW is a toolkit for scriptingLabVIEW and for creating scriptable LabVIEW applications. The toolkit embeds the simple yet powerful Lua scripting languageinto LabVIEW so that Lua scripts can run inside the LabVIEW runtime.Custom LabVIEW-implemented functions can be called from Lua so that there are nolimits to what can be scripted. LuaVIEW also provides tools for architecting modular LabVIEW applications withimproved error handling.
Labc
[ 本帖最后由 labc 于 2008-10-9 02:27 编辑 ] Lua - The Language 1 控制结构、table数据结构
1。用[]直接引用字符串,类似于C#里的 @"xxxxx"。
比如: [[alo [[
"alo\n123\"" = 123"]] = alo
123"]]
2。循环结构和选择结构
-- for and if
for i = 1,5 do
print("i is now "..i)
if i < 2 then
print("small")
elseif i < 4 then
print("medium")
else
print("big")
end
end
-- while
i=1
while i <=5 do
print("i is now "..i)
if i < 2 then
print("small")
elseif i < 4 then
print("medium")
else
print("big")
end
i = i+1
end
-- repeat until,注意没有end
i=1
repeat
print("i is now "..i)
if i < 2 then
print("small")
elseif i < 4 then
print("medium")
else
print("big")
end
i = i+1
until i == 6
输出结果:
i is now 1
small
i is now 2
medium
i is now 3
medium
i is now 4
big
i is now 5
big
3。简单的table结构
-- Arrays
myData = {}
myData = "foo"
myData = 42
-- Hash tables
myData["bar"] = "baz"
-- Iterate through the structure
for key,value in myData do
print(key .. "=" .. value)
end
输出结果:
1=42
0=foo
bar=baz
4。嵌套的table结构
-- table结构
myPolygon = {
color="blue",
thickness=2,
npoints=4;
{x=0,y=0},
{x=-10,y=0},
{x=-5,y=4},
}
-- 索引形式
print(myPolygon["color"])
-- 点形式
print(myPolygon.thickness)
-- 三个子表,分别是myPolygon 到 myPolygon
print(myPolygon.x)
print(myPolygon["y"])
输出结果:
blue
2
-10
4 将LUA的编译器完成cin的调用,实现代码式的功能。
原理上和LV的PDA工具包的C节点,以及LV的matlab script有相近之处;
本版的cpuview也同样是调用外部编译器。 只要学会了Lua编程语言,则可以采用它这个工具包来做了。 我看到一个源码中用到了这些东西,想了解一下.
谢谢!
Labc let learning!
页:
[1]