Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VI Initialize with OptionsString is missing the Resource Name field when created by the IVI Driver Generator LabView 8.6

Solved!
Go to solution

Hi everybody

 

We just downloaded the last LabView version available 8.6 and there is a nice tool called LabView Generator for LabWindows CVI Instruments Drivers. Our instrument driver is an IVI driver that has a LabWindows CVI interface that the LabView Generator Tool is using to create all the VI that could be used to talk to the underlying IVI driver trough discovery of .fp, .sub and .h files. No error and more than 30 VIs are generated automatically.

 

There is one inconsistency in the IVI driver Initialize function. There is a VI for Initialize driver without an input OptionString parameter and there is a second VI with OptionString parameter.

Both of these VIs must have an input mandatory field that is the ResourceName of the instrument but this field is visible only in the VI Initialize that does not have an input OptionString parameter and is not at all visible in the other Initialize VI that does have an input OptionString parameter

 

Any clue why the second Initialize version does not display the ResourceName parameter?

 

Thanks

 

 

Sorin

0 Kudos
Message 1 of 33
(6,107 Views)

Hello Sorin,

       I am glad that you all are using the tool. 

 

Was your IVI instrument driver developing using the tools in CVI? 

 

Does your IVI instrument driver contain both an "Initialize" and an "Initialize with Options"?

 

The tool relies heavily on your .fp file, so that might be what is causing the problem.  I would first recommend that you just try to fix the VI and add the Resource Name control and see if your instrument driver function will accept it.  If that does not work, then you will need to take a look at your .fp file and see what is different between the function that had problems and the one that did not have problems.

 

Let us know how it goes,

 

NathanT

0 Kudos
Message 2 of 33
(6,090 Views)

Hi Nathan

 

I open the fp file in my development IDE that is Visual C++ .NET 2003. The IVI driver is developed in Visual C++ and the interface design is done with a thord party tool specially designed for creating IVI-COM drivers. The tool automatically generates an IVI-C driver that is a wrapper to the IVI-COM main driver. All IVI-C drivers calls are automatically redirected trough IVI-COM or directly to VISA. We use NI-VISA as our underlying library. As you must know the Initialize and Initilaize With Options are both part of the IVI public driver provided as the base IVI driver for all IVI drivers by the IVI Foundation public site. The IVIDriver.dll is installed as a part of IVI Shared Components as a prerequisite for any class or custom IVI driver.

 

On the second part of the question I checked the fp file in my IDE and I was able to see both forms of Initialize driver both having the ResourceName inside their definitions.

There files are build with our IVI-C wrapper interface: jdCMR.fp, jdCMR.h and jdCMR.sub files.

 

So the jdCMR.fp has both Initialize forms with ResourceName field included.

 

And I may see in the jdCMR.h file their prototypes defined below with ResourceName field inside:

 

1. ViStatus _VI_FUNC jdCMR_init ( ViRsrc ResourceName, ViBoolean IdQuery, ViBoolean Reset, ViSession* Vi );

 

2. ViStatus _VI_FUNC jdCMR_InitWithOptions ( ViRsrc ResourceName, ViBoolean IdQuery, ViBoolean Reset, ViConstString OptionsString, ViSession* Vi );

 

Thanks

 

Sorin

 

 

 

 

0 Kudos
Message 3 of 33
(6,077 Views)

Hello Nathan,

 

I am involved in the LabView plug and play driver generation from IVI drivers. I am attaching the IVI driver dll, .h, .fp and .sub file along with the two generated vis: initialize and initialize with options. You can review it and see the behaviour we are talking about. If you like, you can try and generate the vis yourself with the attached files.

 

Cheers,

 

Heather

0 Kudos
Message 4 of 33
(6,042 Views)
Solution
Accepted by topic author sorinxxxx

Hi Sorin and Heather,

 

I just built  your IVI driver and can see the issue that you are coming across.  What version of LabVIEW and the tool are you using?  I am looking into this further to try and dig into your problem a bit more.   If you add the connector to the connector pane, the created VI will meet the requirements as the Resource Name exists, it is just not in the connector pane.  You can do this by right clicking on the icon in the top right hand corner of the Front Panel and selecting Show Connector.  Select where on the VI you would like to add the connector and then select the Resource Name.

Caleb W

National Instruments

0 Kudos
Message 5 of 33
(6,029 Views)

Hello Sorin, Heather and Caleb,

       Thank you for elaborating, attaching the code and reproducing the problem.  The absense of an "IVI Open" function on the block diagram of the generated "Initialize with Options" VI leads me to believe that the Wrapper tool is treating the Initialize with Options as a generic VI and not as the special Initialize with Options that it truly is.  I do not see any obvious problems with the .fp file, but your IVI-COM IDE (Nimbus?) might have do something interesting when generating the fp file that is causing this problem.  The wrapper generator is primarily designed to work with IVI-C instrument drivers generated by LabWindows CVI.

        Please make sure that you are using version 1.2 (for 8.2 and later) of the Import Wizard.

         Is your goal to:

1.  Have customer's use the wrapper tool with your IVI-C wrappers?

OR

2.  Create LabVIEW Wrapper VIs to include with your IVI-C wrappers?

 

Thanks,

 

NathanT

Message Edited by NathanT on 12-09-2008 03:18 AM
0 Kudos
Message 6 of 33
(6,013 Views)

Thanks Nathan, Caleb

 

We got also an input from Caleb on this issue and his solution is good enough for us at this time.

For the IVI-C wrapper in LabView we prepare for any potential customer that want to use this tool.

Sooner or later some customers will start using your tool to generate these VIs from our IVI-C wrapper and we want to be ready for them.

 

It is clear that the Generator tool main target is the IVI-C drivers created trough LabWindows CVI but seeing the VIs generated by this tool makes the case for any other IVI-C type drivers. That small glitch is easy to fix and you got the benefit of having almost all VIs of the IVI-C driver in a breeze.

 

We should not forget that our IVI drivers are primarily IVI-COM drivers and LabView has a quite strong support on accessing directly this IVI interface.

The IVI-C interface is primarly used by LanWindows CVI users as this interface fits naturally into LabWindows but for all the other environments we direct our cutsomers to use IVI-COM interface that is much more friendly.

 

Thanks

 

Sorin

 

 

0 Kudos
Message 7 of 33
(5,998 Views)

Hello Nathan, Caleb & Sorin,

 

Thanks for all your responses. As Sorin suggested, there is a current solution to use IVI-COM with LabView through the ActiveX palette vis and associated hooks.

 

As far as LV Plug and Play drivers go, it is currently under consideration whether we will provide it to customers, but the given is that we would likely have to support any requests of this nature.

 

The one thing I have not tried is porting the IVI-C drivers and creating apps in a LabWindows environment. We have just used the IVI-C drivers that we have and simply used the PNP driver generator tool. This is done with LV 8.6 and LabView Interface Generator for LabWindows CVI Instrument drivers 1.2.

 

As a next step in this investigation, I can try and use this in LabWindows and explore the available function descriptions to see how they match. Are there any other suggestions you might have?

 

Thanks,

Heather

0 Kudos
Message 8 of 33
(5,988 Views)

Hello Heather,

       You could compare your Nimbus generated fp file to a CVI IVI Specific Driver Wizard generated fp file.  You could also try making your Initialize with Options match the CVI generated Initialize with Options.  My overall recommendation is to just include the wrapper wrapper with your original driver and wrapper so that your customers don't need to concern themselves with generating the wrapper wrapper.

 

Cheers,

 

NathanT

0 Kudos
Message 9 of 33
(5,964 Views)

Hello Heather and Sorin,

        I just spoke with someone who is a Instrument Driver Wrapper Generator expert and he told me that the problem is that "vi" is a reserved word that is handled differently.  You need to change the name of your output parameter to something other than "Vi" and try running the tool again.  I suspect that you will be happy with the results.  "resource name" is another reserved word that will cause the tool to place an IVI Logical Name control instead of just a string control.  We are planning on documenting these reserved words in the Readme for the tool and possibly in some online documentation.

 

Cheers,

 

NathanT

0 Kudos
Message 10 of 33
(5,950 Views)