@drikske wrote:
Is there a way to retrieve the data type of your CIN or CLFN parameters without knowing which data type you will connect?
I’m
trying to make a single abstract block that supports the most common
data types. (so I want to know the data type during CINinit)
Kind regard,
No,
this wouldn't work. The only function which does have some information
about the datatypes is the CINRun function and that only internally
without a possibility for you to access that information. Also even if
you could access this information it would be a real hassle to make
sure you treat the stack properly depending on your parameters you
passed in, something which you might need to deal in assembler with to
make it always work right.
If the Variant datatype and the necessary LabVIEW manager fucntions to
deal with it would have been documented you could use a variant here,
but alas this information was not considered to be added to the
External Code Reference Manual and therefore stays undocumented up to
now.
Another way is to abandone the CIN altogether and go with shared
libraries. But be aware that self adapting code depending on the
variable types gets rather complicated soon. If you want to see an
example of how this could be solved and how the according C code would
look like you can check out
LabPython.
It does not support all LabVIEW types but a reasonable number of them
and it does get already quite complicated. The entire VI library, test
VIs and the c source code is available in the CVS repository on sourceforge.
Rolf Kalbermatter
Message Edited by rolfk on 12-21-2005 11:01 AM
Message Edited by rolfk on 12-21-2005 11:01 AM
Rolf Kalbermatter
My Blog 
DEMO, Electronic and Mechanical Support department, room 36.LB00.390