LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CIN with simplest array?



@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

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 Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 21 of 26
(1,003 Views)
did: #include <stdio.h>
LabView still crashes! I don't know why.
0 Kudos
Message 22 of 26
(992 Views)
Sorry, I cant help you if you dont read my advice.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 23 of 26
(990 Views)
" 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???
0 Kudos
Message 24 of 26
(988 Views)


@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???


The VI you included in your earlier post can absolutely positiviley not generate a prototype that will even remotely look like CINRun(int32 num);
If your CIN code parameters do not match what LabVIEW is passing and vice versa, a crash is the only possible outcome.

In fact there is no way for a CIN to pass its parameter as skalars by value. They will always be either resizable data like array or string handles or getting passed by reference for skalar and compound datatypes.

And about support please note following: I do this out of free will on my own time. I do not get paid or anything like that for this.
For the rest I repeated two times that CINs are legacy technology and there is no reason to use them anymore. They had have their time and nobody at NI is using them for years already since the shared library node is by far a better alternative. If you insist on using it fine, but don't complain that there is nobody that can help you with step for step explanations. I haven't done CINs for many years already either and never for Linux. So all I can give you here are basic advices and when I see an obvious error I'm not going to spend more time in second guessing gcc parameters and command switches, when the actual code absolutely positively can't run without crashing.

Also yu have made a several posts whose layout was so bad that reading it was a big pain just from that, but yet I tried to still follow you. Last but not least I helped you obviously through several problems in this thread already and according to earlier messages that got you to actually make it work, and now suddenly you claim you can't even compile it and all kinds of other problems.

But I'm done with this and won't bother you with more useless help and advice.

Rolf Kalbermatter


Message Edited by rolfk on 03-17-2008 07:59 PM
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 25 of 26
(977 Views)
Rolf.K., sorry, my mistake - cause I've mixed in one topic different program codes, even those which did not match this thread.
As for your advice - related to program code on the first thread page ( CIN with numeric array ) - works perfect. And about other questions: I should have post them in another thread.
Regards,
bI.
0 Kudos
Message 26 of 26
(889 Views)