LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the Formula Node for PDA

I get a compile error when I use C code inside the formula node. Is it possible to use C Code inside the formula node for PDA applications? Do I have to include any file while building the executable for the PDA
0 Kudos
Message 1 of 15
(7,571 Views)
Dear Sprasad,

Thanks for contacting National Instruments. I would like to apologize for the delay in responding to your support request.

While the formula node does support C code, it does not support several of the standard C functions. If you're trying to make a function call to one of these unsupported functions, you will receive a compile error. Can you please post a screen shot of the error that you are receiving? That would greatly help me to reach a resolution to the problem you are experiencing.

I found knowledge base entries for calling external code using LabVIEW PDA (both PalmOS and PocketPC), so you may want to research these at the following links:

http://digital.ni.com/public.nsf/websearch/517300B49212795986256DDD00623FEE?OpenDocum
ent

http://digital.ni.com/public.nsf/websearch/8084BC0C4A2824FE86256DDC007D7498?OpenDocument


I hope this helps. Please let me know if there's anything else I can do to help. Have a great day!

Kind Regards,

Joe Des Rosier
National Instruments
Message 2 of 15
(7,571 Views)
Thanks Joe
I have attached the screen shot and I will paste the C code that i am using in the formula node. I did look up knowledge base but that did not solve the problem

Thanks
Prasad
int16 i;
int16nt;
int32 arrsz;
float64 D[1000];
arrsz=S;
cnt=0;
for (i=0; i{
if ((A[i]>T) || (A[i] < -T))
{
D[cnt] = A [i];
cnt=cnt+1;
}
else
{
D[cnt]=0;
cnt=cnt+1;
}
}
0 Kudos
Message 3 of 15
(7,571 Views)
Prasad-

I think I know your problem. Are you trying to call the C code that you pasted from inside the formula node? If so, you cannot declare variable values within the formula node. You need to declare the variables outside the formula node and pass them into the node as seen in the following example:

-From your front panel, click [Help]>>[Find Examples] and search for "formula node." Open and review the "Create Function with Formula Node" example.

Try re-arranging your code to the above spec. I think that doing so will cure your problem.

If this doesn't work, please take a screen shot of your block diagram of the VI and paste it in a subsequent post.

Kind Regards,

Joe Des Rosier
National Instruments
0 Kudos
Message 4 of 15
(7,571 Views)
Hi Joe
Thanks for the help. I am calling the C code from inside the formula node. I did rearrange the code to the specifications that you mentioned. I am still getting the same error.
I will attach the code.May be i am missing something.
thanks
Prasad
0 Kudos
Message 5 of 15
(7,571 Views)
Prasad-

I reviewed your code and it appears that you're still trying to initialize variables within the function nodes. You're making an int32 and float64 initialization within the first node, and an int32 declaration within the second node. You'll need to declare these variables outside the nodes and wire them into the node.

Please let me know if this works. I would be happy to send you more instruction if you're still having further issues once this fix is attempted.

Good Luck!

Joe Des Rosier
National Instruments
0 Kudos
Message 6 of 15
(7,571 Views)
I changed all the declarations as instructed but the complilation error seems to persist. I am attaching the fixed VI.Hope i have not missed anything.
0 Kudos
Message 7 of 15
(7,571 Views)
Sprasad-

Your code looks fine. At this point, I don't have many other options than to have you post your VI and allow me to run it in attempt to reproduce the error on my machine. I'll see if I can fix the problem locally within your code or at least give you some information as to how you can fix the problem.

Thanks for bearing with me.

Kind Regards,

Joe Des Rosier
National Instruments
0 Kudos
Message 8 of 15
(7,571 Views)
Thanks for all the help Joe..
I have attached the VIs
The Main VI is called CDMain which calls sub vi configureset which called cdconfigure.vi which has the problem
Thanks
Prasad
Download All
0 Kudos
Message 9 of 15
(7,571 Views)
Ok, I was able to successfully build an executable file without error. I attached the screen shots of your program in execution. Does this look like the desired result?

I'm confused as to why I can build and run the program on my machine. I have LabVIEW 7.0 and Windows XP. What version of Windows and LabVIEW are you using? Also, are you getting the error window when you try to build an executable or when you attempt to run the VIs within LabVIEW?

Regards,

-Joe-
Download All
0 Kudos
Message 10 of 15
(7,571 Views)