LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Include .lsb file from one CIN to another CIN

Hey!
I have a program that includes several CINs. In the first CIN executed, an extern long is sat to a value, that is defined in a included C-file. I want this extern long to be sat in the other CINs aswell, but when I create the other CINs and include the same C-file as in the first CIN, the extern long is not sat to any value. Any ideas?

/Jakob
0 Kudos
Message 1 of 2
(2,377 Views)


@Jakob wrote:
Hey!
I have a program that includes several CINs. In the first CIN executed, an extern long is sat to a value, that is defined in a included C-file. I want this extern long to be sat in the other CINs aswell, but when I create the other CINs and include the same C-file as in the first CIN, the extern long is not sat to any value. Any ideas?

/Jakob




You can't do that. A CIN is basically a DLL with a very specific number of exported functions. Each CIN is its own DLL and therefore can't share variables with other CINs through binary object code linking.

Create a DLL instead for all those functions and import that functionality through the Call Library Node. In that way you can share whatever data you want between the different functions of your DLL. Just watch out that sharing external data between functions makes those functions in general multi-threading unsafe, so you should define the Call Library Node to execute in the UI thread for those functions.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 2
(2,370 Views)