[LuaVIEW-users] Modified 'pull flat data'

Mike Sachs mike.sachs at gmail.com
Tue Apr 17 23:37:40 BRT 2007


Hi Andy,

I understand that to translate (Marshall?) the lua table structure to
c/c++ would require type information, but all I want is to be able to
house the table state in a LabVIEW based global string mechanism and
then pass it to another LuaVIEW script thread which contains an
identical table.  I am attaching a remote debugger that I wrote some
time again that uses a pickling routine that is capable of recursively
parsing a table and spitting it out as a string, so I know it can be
done.

On 4/17/07, Andy Reding <ATReding at gwlisk.com> wrote:
> Mike,
>
>         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...
>
>         Andy
>
> -----Original Message-----
> From: luaview-users-bounces at lists.luaforge.net
> [mailto:luaview-users-bounces at lists.luaforge.net] On Behalf Of Mike
> Sachs
> 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.
>
> Mike Sachs
> Intelligent Systems
>
> _______________________________________________
> LuaVIEW-users mailing list
> LuaVIEW-users at lists.luaforge.net
> http://lists.luaforge.net/cgi-bin/mailman/listinfo/luaview-users
>
> _______________________________________________
> LuaVIEW-users mailing list
> LuaVIEW-users at lists.luaforge.net
> http://lists.luaforge.net/cgi-bin/mailman/listinfo/luaview-users
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Remote_Debug.zip
Type: application/zip
Size: 249886 bytes
Desc: not available
Url : http://lists.luaforge.net/pipermail/luaview-users/attachments/20070417/60cc4c0c/Remote_Debug-0001.zip


More information about the LuaVIEW-users mailing list