Using C structures in LabView 
Author Message
 Using C structures in LabView

Hi,

I want to use this function into labview:

struct  my_output my_function (char * signal, unsigned size_signal)

the output of the function is a C structure:

struct my_output
    {
    double d_value;
    unsigned u_value;
    unsigned u_value2;
   double d_value2;
   .....
   }my_output;

I would like to retrieve the C structure in a cluster in LabView.

Is it possible to convert from  C structure type to cluster type in LabView?

Thanks in advance,

Miguel.



Tue, 03 Dec 2002 03:00:00 GMT  
 Using C structures in LabView
First create CIN on your VI, then connect cluster to CIN's output.
Right click on CIN and choose to create .c file.
Output is belove.
More info on how to compile lsb file to be used by CIN is on NI website.
CIN=code interface node

/*
 * CIN source file
 */

#include "extcode.h"

/*
 * typedefs
 */

typedef struct {
 float64 d_value;
 float64 d_value2;
 uInt32 u_value;
 uInt32 u_value2;
 } TD1;

CIN MgErr CINRun(TD1 *Cluster, float64 *input_d);

CIN MgErr CINRun(TD1 *Cluster, float64 *input_d) {

 /* ENTER YOUR CODE HERE */

 return noErr;
 }


Quote:
> Hi,

> I want to use this function into LabView:

> struct  my_output my_function (char * signal, unsigned size_signal)

> the output of the function is a C structure:

> struct my_output
>     {
>     double d_value;
>     unsigned u_value;
>     unsigned u_value2;
>    double d_value2;
>    .....
>    }my_output;

> I would like to retrieve the C structure in a cluster in LabView.

> Is it possible to convert from  C structure type to cluster type in
LabView?

> Thanks in advance,

> Miguel.

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


Tue, 03 Dec 2002 03:00:00 GMT  
 Using C structures in LabView
Thanks for the information, but I have a dll function and I want to use
"call library function"
to access to the library.

Miguel.



Quote:
> First create CIN on your VI, then connect cluster to CIN's output.
> Right click on CIN and choose to create .c file.
> Output is belove.
> More info on how to compile lsb file to be used by CIN is on NI website.
> CIN=code interface node

> /*
>  * CIN source file
>  */

> #include "extcode.h"

> /*
>  * typedefs
>  */

> typedef struct {
>  float64 d_value;
>  float64 d_value2;
>  uInt32 u_value;
>  uInt32 u_value2;
>  } TD1;

> CIN MgErr CINRun(TD1 *Cluster, float64 *input_d);

> CIN MgErr CINRun(TD1 *Cluster, float64 *input_d) {

>  /* ENTER YOUR CODE HERE */

>  return noErr;
>  }



> > Hi,

> > I want to use this function into LabView:

> > struct  my_output my_function (char * signal, unsigned size_signal)

> > the output of the function is a C structure:

> > struct my_output
> >     {
> >     double d_value;
> >     unsigned u_value;
> >     unsigned u_value2;
> >    double d_value2;
> >    .....
> >    }my_output;

> > I would like to retrieve the C structure in a cluster in LabView.

> > Is it possible to convert from  C structure type to cluster type in
> LabView?

> > Thanks in advance,

> > Miguel.

> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----==  Over 80,000 Newsgroups - 16 Different Servers! =-----



Tue, 03 Dec 2002 03:00:00 GMT  
 Using C structures in LabView
http://digital.ni.com/explprog.nsf/75c7cd5de6d387788625663d00558a4c/3...
d630e5e48625683a000a8332?OpenDocument

Check this example, that should do it.


Quote:
> Thanks for the information, but I have a dll function and I want to use
> "call library function"
> to access to the library.

> Miguel.



> > First create CIN on your VI, then connect cluster to CIN's output.
> > Right click on CIN and choose to create .c file.
> > Output is belove.
> > More info on how to compile lsb file to be used by CIN is on NI website.
> > CIN=code interface node

> > /*
> >  * CIN source file
> >  */

> > #include "extcode.h"

> > /*
> >  * typedefs
> >  */

> > typedef struct {
> >  float64 d_value;
> >  float64 d_value2;
> >  uInt32 u_value;
> >  uInt32 u_value2;
> >  } TD1;

> > CIN MgErr CINRun(TD1 *Cluster, float64 *input_d);

> > CIN MgErr CINRun(TD1 *Cluster, float64 *input_d) {

> >  /* ENTER YOUR CODE HERE */

> >  return noErr;
> >  }



> > > Hi,

> > > I want to use this function into LabView:

> > > struct  my_output my_function (char * signal, unsigned size_signal)

> > > the output of the function is a C structure:

> > > struct my_output
> > >     {
> > >     double d_value;
> > >     unsigned u_value;
> > >     unsigned u_value2;
> > >    double d_value2;
> > >    .....
> > >    }my_output;

> > > I would like to retrieve the C structure in a cluster in LabView.

> > > Is it possible to convert from  C structure type to cluster type in
> > LabView?

> > > Thanks in advance,

> > > Miguel.

> > -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> > http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> > -----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


Tue, 03 Dec 2002 03:00:00 GMT  
 Using C structures in LabView
Reinis,

Thank you for the program. This is just I need.
Miguel.



http://digital.ni.com/explprog.nsf/75c7cd5de6d387788625663d00558a4c/3...

Quote:
> d630e5e48625683a000a8332?OpenDocument

> Check this example, that should do it.



> > Thanks for the information, but I have a dll function and I want to use
> > "call library function"
> > to access to the library.

> > Miguel.



> > > First create CIN on your VI, then connect cluster to CIN's output.
> > > Right click on CIN and choose to create .c file.
> > > Output is belove.
> > > More info on how to compile lsb file to be used by CIN is on NI
website.
> > > CIN=code interface node

> > > /*
> > >  * CIN source file
> > >  */

> > > #include "extcode.h"

> > > /*
> > >  * typedefs
> > >  */

> > > typedef struct {
> > >  float64 d_value;
> > >  float64 d_value2;
> > >  uInt32 u_value;
> > >  uInt32 u_value2;
> > >  } TD1;

> > > CIN MgErr CINRun(TD1 *Cluster, float64 *input_d);

> > > CIN MgErr CINRun(TD1 *Cluster, float64 *input_d) {

> > >  /* ENTER YOUR CODE HERE */

> > >  return noErr;
> > >  }



> > > > Hi,

> > > > I want to use this function into LabView:

> > > > struct  my_output my_function (char * signal, unsigned size_signal)

> > > > the output of the function is a C structure:

> > > > struct my_output
> > > >     {
> > > >     double d_value;
> > > >     unsigned u_value;
> > > >     unsigned u_value2;
> > > >    double d_value2;
> > > >    .....
> > > >    }my_output;

> > > > I would like to retrieve the C structure in a cluster in LabView.

> > > > Is it possible to convert from  C structure type to cluster type in
> > > LabView?

> > > > Thanks in advance,

> > > > Miguel.

> > > -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> > > http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> > > -----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----==  Over 80,000 Newsgroups - 16 Different Servers! =-----



Thu, 05 Dec 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Using C structures in LabView

2. conflict between CS-PICK and control structure checking

3. to CS: or not to CS: in F-PC assembler

4. data to sql server using labview and labview sql toolkit

5. Using Smalltalk to teach intro cs courses

6. UPG using CS.exe

7. using GOFER/MIRANDA in a first-year CS course (2)

8. using GOFER/MIRANDA in a first-year CS course

9. Intro CS book using Dylan?

10. Wanted: references on using Scheme for Intro CS courses

11. Using CS override

12. The suitable LabVIEW data type correspinding to the array of structure in Visual Basic ActiveX DLL

 

 
Powered by phpBB® Forum Software