LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Instant PLUS API for executable license

Solved!
Go to solution

I have sourcecode written in LV2011 that is compiled for use on 32-bit and 64-bit PCs and I'd like to require online activation for end users.  I've purchased Protection Plus and Solo server.  I downloaded the "Third Party Licensing & Activation" toolkit.  The VIs work well but I can't tell how many days are left on an evaluation copy using these VIs.  I tried to call the "Instant Plus DLL" (IP2Lib32.dll) but it only has a few obscure functions and I eventually gave up.  Then I tried to use the "Instant PLUS API" which seemed promising since it has all the calls I need.  But the inplementation into LabVIEW is even more convoluted (calling fake.dll files, etc).

 

The questions are:

 

1. Is there any way to obtain the number of days left for a product evaluation using the "Third Party Licensing & Evaluation" toolkit?

2. What steps are needed to intergrate the "Instant PLUS API" into a VI?

 

 

Thanks.

0 Kudos
Message 1 of 18
(4,367 Views)

Thanks for your questions:

 

1. The "Third Party Licensing & Evaluation" toolkit can only indicate the lisencing status of the executable, using the "Get License Status VI"

 

http://zone.ni.com/reference/en-XX/help/373159B-01/addonlicensing/getlicensestatus/

 

Unfortuanately you won't be able to get the number of days left from the toolkit, but you will be able to from the Instant PLUS API using the"WR_TrialDaysLeft" (see below).

 

 

2. The following link is a good tutorial on how to use "Instant PLUS".  Instant PLUS doesn't integrate directly with VI's, since it attaches to VI's that have already been compiled.

 

https://decibel.ni.com/content/docs/DOC-17063

 

 

For further help with Instant PLUS: http://www.softwarekey.com/help/ip2man/

The Instant PLUS documentation includes how to use the API, which will be calling a DLL.  The following link will lead to a tutorial on programming with DLL's in LabVIEW:

http://www.ni.com/white-paper/3009/en

http://digital.ni.com/public.nsf/allkb/DCB90714981A1F148625731E00797C33?OpenDocument

https://decibel.ni.com/content/docs/DOC-9069#Example_DLL

 

 

 

 

Systems Engineer
SISU
0 Kudos
Message 2 of 18
(4,347 Views)

Nathan,

 

Thanks for the quick response.  I'd like to call "WR_TrialDaysLeft" using the Instant Plus API.  I expected to see it as a function in the dlls mentioned in their documentation but they're not showing up.  I've attached the dlls in a zip file.  I've looked pretty hard at their documentation and its not clear how to implement the API into LabVIEW.  A lot of the documentation is written for C-sharp, VB, java, etc.  So it gets close but not all the way.  If the Dlls worked, all would be good.  But they don't.  Any suggestions?

 

Is there a beta version coming soon?

0 Kudos
Message 3 of 18
(4,337 Views)

To implement their DLL in labview, you can follow the instructions on "Calling C/C++ DLLs from LabVIEW" :

 

https://decibel.ni.com/content/docs/DOC-9076

 

Also the last few links on my last post would help, I've included them again:

http://www.ni.com/white-paper/3009/en

http://digital.ni.com/public.nsf/allkb/DCB90714981A1F148625731E00797C33?OpenDocument

https://decibel.ni.com/content/docs/DOC-9069#Example_DLL

Systems Engineer
SISU
0 Kudos
Message 4 of 18
(4,325 Views)

Calling the Instant Plus DLL is not the problem.  The functionaly I want seems to be covered with the Instant Plus DLLs. The issue is in setting the three key parameters of the CallIPEx function for the decryption key, return key and the XML file location.  The documentation shows its use in VB, etc but not LabVIEW.  Any sample would be greatly appreciated.

 

0 Kudos
Message 5 of 18
(4,314 Views)

The following article has the information you need for setting up the "Call Library Function Node":

http://www.ni.com/white-paper/3009/en

 

It contains a table listing the Win32 datatypes and what they correspond to in LabVIEW when using the "Call Library Function Node".

 

After looking at the documentation for the Instant PLUS API, I would recommend using "CallIp", since the first parameter of "CallIpEx" is "A handle to the application's window to make the dialogs modal."  In LabVIEW you cannot obtain that reference.

 

Also, when setting up the Node, be sure to use "stdcall (WINAPI)", I found that out from looking into the header file: "IP2Lib.h".

 

Lastly, I found that LPCSTR is a constant string pointer (const char*), so in LabVIEW it will map to a String of "c-string" type.

 

Also, if you were wondering how to format the data being wired into the "Call Library Function Node", you'll need to look at how that data is being formatted from the other examples, even if they aren't written in LabVIEW, they could indicated what format the strings and numbers need to be.  I would also reccomend looking at the Instant PLUS API help file for the "flags" information.

 

Systems Engineer
SISU
Message 6 of 18
(4,302 Views)

You can get the window handle of a VI's front panel.  A VI to do this is included in the Windows Message Queue Library.

0 Kudos
Message 7 of 18
(4,297 Views)

Nathans,

 

Thanks for your help.  I am including a very simple test VI along with the license file and XML file created by Instant Plus.  When I run the code, I get an Error Code 1097.  Please advise...  Thanks again.

Message 8 of 18
(4,284 Views)
Solution
Accepted by topic author SJT

It will be more likely to work if you put the function parameters in the right order.  The function prototype in the Call Library Function Node dialog should (mostly) match the prototype in the header file, although LabVIEW uses different names for some datatypes (for example CStr instead of char * and int32_t instead of long).  It would also help if you attach IPLib.h, since, if you open IPLib32.h, you'll see that it doesn't contain the prototype for the function you're calling.

Message 9 of 18
(4,281 Views)

It worked to put the parameters in order.  I didn't attach IPLib.h since I could'nt find it on my PC.  Not sure where I get it from...  I attached the final VI.  Thanks for your help.

Message 10 of 18
(4,277 Views)