LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Q:how to allocate memory in CINs?

Hi, Labview fellas,

I am using CINs(code interface Node) to process some array stuffs. I
know the CIN function setCINArraySize() is good for allocating memory
for an output array. But how can I declare an array for CIN's local use?
I tried to use:

float32 *array=(float32 *array)malloc(numElmts);

and, also, I tried to use:

TdHdl **array;
NumericArrayResize(int32 fS, 1, (UHandle *)array, nx);

Unfortunately, both of them caused illegal operations.

Please help me!!


Thanks.

GC


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
0 Kudos
Message 1 of 3
(4,145 Views)
> I am using CINs(code interface Node) to process some array stuffs. I
> know the CIN function setCINArraySize() is good for allocating memory
> for an output array. But how can I declare an array for CIN's local use?
> I tried to use:
>
> float32 *array=(float32 *array)malloc(numElmts);
>
> and, also, I tried to use:
>
> TdHdl **array;
> NumericArrayResize(int32 fS, 1, (UHandle *)array, nx);
>
> Unfortunately, both of them caused illegal operations.
>

There is a header file included in your CIN. It exports some
functions like DSNewPtr, DSNewHandle, DSDisposeHandle, and
DSDisposePtr.

I'm a little surprised that a call to malloc crashed, but I
haven't tried it in a very long time; so it might be necessary
to use one of the ones listed above.

Greg McKaskle
0 Kudos
Message 2 of 3
(4,145 Views)
I forgot to multiple numElmts by float32:>)

it works now. Thanks!
In article <37BE0B44.DB455112@austin.rr.com>,
GMCKASKLE@austin.rr.com wrote:
> > I am using CINs(code interface Node) to process some array stuffs. I
> > know the CIN function setCINArraySize() is good for allocating
memory
> > for an output array. But how can I declare an array for CIN's local
use?
> > I tried to use:
> >
> > float32 *array=(float32 *array)malloc(numElmts);
> >
> > and, also, I tried to use:
> >
> > TdHdl **array;
> > NumericArrayResize(int32 fS, 1, (UHandle *)array, nx);
> >
> > Unfortunately, both of them caused illegal operations.
> >
>
> There is a header file included in your CIN. It exports some
> functions like DSNewPtr, DSNewHandle, DSDisposeHandle, and
> DSDis
posePtr.
>
> I'm a little surprised that a call to malloc crashed, but I
> haven't tried it in a very long time; so it might be necessary
> to use one of the ones listed above.
>
> Greg McKaskle
>

--
Guoxiang Chen
Ph.D. Candidate
Ohio Unversity, Athens, OH


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
0 Kudos
Message 3 of 3
(4,145 Views)