02-19-2008 06:34 AM
02-19-2008 04:15 PM
@daveTW wrote:
Hello all,
using LabView 8.5 I started to create a CIN, using VC++ 2008 Express, from this tutorial and the NI LabView Handbook "Using External Code in LabView". They both are very clear & easy to understand. There were some issues with the variables "$(ProjectDir)" and "$(OutDir)" in the Custom Build Step (which calls lvsbutil.exe), since $(OutDir) holds the full path to the output directory, not the relative one. This was fixed quickly.
But I still got an error with the Custom Build Step, despite all parameters were set properly. Now I realized, that the command line parameters of lvsbutil.exe changed (and significantly the size) with LabView Version 8.2. Now there seem all parameters need to be preceded by switches, such as "-c" "-t". A must- parameter seems to be the -c, but what does it mean?
Playing around on the command line with lvsbutil always produced: lvsbutil: error building resource file: 1
But when I tried to build the lsb- file with the lvsbutil from LV 8.0, it worked as described in the tutorials. If lvsbutil of LV 8.2 is used with the command line switches set as following, it also works (Bold: output of lvsbutil):
C:\Program Files\National Instruments\LabVIEW 8.2\cintools>lvsbutil -c "SampleCIN" -t CIN -d "C:\Eigene Dateien\VC-Sources\SampleCIN\Debug"
LabVIEW resource file, type 'CIN ', name 'SampleCIN.lsb', created properly.
But this command line doesn't work with lvsbutil of LV 8.5! Anyhow, the command line help of both versions is the same. Since I can use the created .lsb (version 8.2) file with LV 8.5 VIs, this should be no real problem for my work, but what is going on there? Does anyone has a hint, how to use the lvsbutil.exe of LV 8.5? And what do the other parameters mean?
greets, Dave
02-20-2008 02:30 AM - edited 02-20-2008 02:34 AM
02-20-2008 03:44 AM
03-29-2008 02:14 AM
CIN has great advantage, it can take control even if a parent VI is not running. Using extra entries like CINLoad, CINUnload, CINInit, CINDispose, etc. it has an opportunity to initialize some resources and release them depending on VI stage. Also, each CIN instance has its own unique data space (4 bytes value) that is usefull to identify the instance or store a pointer to dynamically allocated memory specific for the instance. All this together is great mechanism to embed external code into reentrant and multi-thread ready VIs.
kind regards
03-29-2008 04:17 AM
@kostya wrote:
CIN has great advantage, it can take control even if a parent VI is not running. Using extra entries like CINLoad, CINUnload, CINInit, CINDispose, etc. it has an opportunity to initialize some resources and release them depending on VI stage. Also, each CIN instance has its own unique data space (4 bytes value) that is usefull to identify the instance or store a pointer to dynamically allocated memory specific for the instance. All this together is great mechanism to embed external code into reentrant and multi-thread ready VIs.
kind regards
03-29-2008 10:50 AM - edited 03-29-2008 10:51 AM
CINxxx entries are called for each CIN instance (at least CINInit/CINDispose), while DllMain for only entire DLL. This is a big difference! I agree about most of programmers don't use this (=CIN) features, but it does not mean CIN has no right to be live. Again, CIN is great mechanism for making advanced LV programming, and it provides advantages unreachable with DLL.
kind regards,
Konstantin Shifershteyn
03-29-2008 01:41 PM
@kostya wrote:
CINxxx entries are called for each CIN instance (at least CINInit/CINDispose), while DllMain for only entire DLL. This is a big difference! I agree about most of programmers don't use this (=CIN) features, but it does not mean CIN has no right to be live. Again, CIN is great mechanism for making advanced LV programming, and it provides advantages unreachable with DLL.
kind regards,
Message Edited by kostya on 03-29-2008 10:51 PM
Konstantin Shifershteyn
08-08-2019 11:06 AM
I am running LabView 8.6 and getting the same issue. I click on the link marked here and it was dead. I would like to use the CIN for a project I am doing.
08-08-2019 01:51 PM - edited 08-08-2019 01:54 PM
@JJM57 wrote:
I am running LabView 8.6 and getting the same issue. I click on the link marked here and it was dead. I would like to use the CIN for a project I am doing.
Why? Save yourself some headache and grey hair and simply develop a DLL! CINs are dead! They offer no advantage over DLLs anymore but several disadvantages. And if you ever plan to move to a newer LabVIEW version and 64-bit they won't work anymore and there is no officially supported way to create them for 64-bit LabVIEW (or LabVIEW for Mac OSX or any of the modern realtime targets).