[LuaVIEW-users] Modified 'pull flat data'
ATReding at GWLISK.com
Tue Apr 17 14:53:51 BRT 2007
I don't know exactly how the luaview engine pulls its data, but
I have used lua in C++ programs and I don't think it is possible to
exchange data without type information. Lua uses a virtual stack to
handle the data exchange between the virtual machine and the host
program. In C/C++, everything is strictly typed so you must be able to
translate into a valid C data type to extract data, and you need to know
the type when you pull it. I expect that the luaview pull function is
parsing the type definition of the cluster to pull the data from the
stack in some sort of recursive loop - which is why every element in the
cluster needs to be named and needs a type that translates directly into
a C type. I think ultimately this is a limitation of lua, and the lua
code itself would probably need to be modified to change it. I'm sure
the CIT guys will correct me if I'm wrong.
I know that in C/C++ it is possible to check the type of an
element on the stack and then pull the correct type at runtime, but I
don't think luaview supports such functionality. I've wanted to have the
capability to check the type of a stack element before - perhaps that
would be a simpler change to make to the core code? It would require us
to do some parsing and run-time checking on the LV side before we pulled
stack elements, but it might be possible.
Don't know if this helped or hindered...
From: luaview-users-bounces at lists.luaforge.net
[mailto:luaview-users-bounces at lists.luaforge.net] On Behalf Of Mike
Sent: Tuesday, April 17, 2007 12:34 PM
To: luaview-users at lists.luaforge.net
Subject: [LuaVIEW-users] Modified 'pull flat data'
I was wondering if it might be possible to create a modified version of
the pull/push flat data whose purpose is simply to obtain a 'pickled'
string representation of a Lua table. It seems that the original
version of the pull flat data must be doing something like that already.
My goal is to extend a global data manager that currently only works
with numeric and boolean data types and is very useful as a global data
store between script threads or from a script thread to LabVIEW.
LuaVIEW-users mailing list
LuaVIEW-users at lists.luaforge.net
More information about the LuaVIEW-users