03-17-2008 08:05 AM
Go right-click on the CIN Node and select, Create .c File... Then compare the CINRun prototype created there with what you have and then tell me if you still don't understand why it crashes. Please!!
@bi wrote:
Ok... about compiling CIN, I've read on forums and made linkage with "ldconfig -s libpci.so libpci.so.2" and It begun compiling.
So Rolf.K., it wasn't connected with my fundamental problems with C. But still CIN not working when loaded in VI. Maybe those Libraries are called only when compiling CIN (because in Makefile they are present), and when Launching VI with CIN those Libraries are not loaded and thats why CIN not working?
1) In other words If my CIN uses other shared libraries that are used during compilation of a CIN, should I load them when launching VI with this CIN ?
Then I tried building new CIN that simply returns *Numeric = 32. and inside code with C functions it makes a file "log.txt" and writes this value also there.
On this point Labview crashes.
program code:
===================
#include "extcode.h"
#include "hosttype.h"
MgErr CINRun(int32 Numeric);
MgErr CINRun(int32 Numeric)
{
Numeric = 32;
FILE *sp;
sp=fopen("log.txt","w");
fputc(Numeric,sp);
fclose(sp);
return noErr;
}
===================
2) Does it mean that I can't create file simply using standard C functions? Should I use only LabView CIN functions for creating and writing into file?
===================
I read in Manual "Using External Code" that Call library nodes are more easy to use. But what about being Thread Safe?
• The code is thread safe when it does not access any hardware. In other words, the code does not contain register-level programming.
• The code is thread safe when it does not make any calls to any functions, shared libraries, or drivers that are not thread safe.
• The code is thread safe when it uses semaphores or mutexes to protect access to global resources.
3) Does it mean that I can use Thread safe Call Library node only for calculating some kind of "2 * 2" ?
4) What is "semaphores or mutexes" ?
===================
@Rolf.K wrote:
"I predict that at some point the CIN tools will not be delivered with LabVIEW anymore."
And can I make everything, that allows me CIN, with Call Library Nodes? (I'm interested in accessing hardware and funtions)
As for previous posts still didn't get answers on following questions:
5) Do you suggest - to compile my code as Library .so and then pass It to Call Library Node ?
6) Will I be able with this Library - to access hardware through PCIE, to write Data from PCIE board memory to file and to fill arrays with this data ? (as the program does)
7) Can I Launch those Libraries pcie.so.2 libz.so (which are used during compilation) with LabView into memory - that they will be launched only when my VI works ?
As for program code and VI attached below:
Message Edited by bI on 03-17-2008 07:10 AM
03-17-2008 12:01 PM
03-17-2008 12:09 PM
03-17-2008 12:38 PM
03-17-2008 01:50 PM - edited 03-17-2008 01:59 PM
The VI you included in your earlier post can absolutely positiviley not generate a prototype that will even remotely look like CINRun(int32 num);
@bi wrote:
" Go right-click on the CIN Node and select, Create .c File... Then compare the CINRun prototype created there with what you have and then tell me if you still don't understand why it crashes. Please! "
Rolf.K you call it advice ? I did it hundred times. I've told you that on my PC there are no messages in Terminal for errors - only Labview crashes. If there were any information I didn't ask you stupid questions. By the way you didn't answer on any of 7 questions. It seems you didnot read my post...Unsatisfied with not friendly support here, however companies buy software for thousands Euro.
And I repeat: My linux terminal do not show any debugging information about errors - labview crashes on launching VI.
If this was an advice..
" Go right-click on the CIN Node and select, Create .c File... Then compare the CINRun prototype created there with what you have and then tell me if you still don't understand why it crashes. Please! "
I did it, and how do you suppose that I undestand why it crashes if you adviced me to do what I've done before???
03-31-2008 10:59 AM