LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to not implement interchangeability checking in LabWindows/CVI?

Solved!
Go to solution

Hello,

 

I'm creating an IVI-C driver using LabWindows/CVI 2012. I used the tool's IVI Instrument Driver Wizard and it created most of the code for supporting IVI Inherrent functions and attributes.

 

I do not plan to support the optional Interchangeability Checking and according to IVI specifications (IVI-3.2 version 2.1, section 5.21):

"If the IVI specific driver does not implement interchangeability checking, the specific driver returns the Value Not Supported error when the user attempts to set the Interchange Check attribute to True."

 

This would be a simple task if I could modify the write callback of the Interchange Check attribute. However, LabWindows/CVI does not allow any editing of an inherrent attribute. How can I make the driver return the Value Not Supported error when the user attempts to set the Interchange Check attribute to True?

 

Any help is appreciated!

 

Thanks.

0 Kudos
Message 1 of 5
(3,836 Views)

Hi buckhorn,

 

Thanks for posting in the NI Discussion Forums!

 

Have you been able to try a unit test where you attempt to set the Interchangeability Checking attribute? If so, what was the result? It's possible that this functionality is implemented for you already.

 

If this is not the case, would you be able to post the code you have so far?

0 Kudos
Message 2 of 5
(3,805 Views)

Hi Frank,

 

Thanks for replying to my post!

 

I have just started this project so the code is still essentially the same as the one generated by the wizard.

 

I would like to focus on developing the main content of the driver for the time being and postpone all optional implementation (e.g. interchangeability checking, coercion recording, etc.) for later releases. According to the IVI specification, all I need to do is simply return Value Not Supported when these options are enabled (set to True). Is it possible to do this when developing my driver using LabWindows/CVI? It looks like I have no ways of making any changes to LabWindows/CVI's implementation of inherent attributes.

 

Thanks in advance for your help!

0 Kudos
Message 3 of 5
(3,777 Views)
Solution
Accepted by buckhorn

Hello buckhorn,

 

 

According to your statement, I tried to "modify" the write callback of <prefix>_ATTR_INTERCHANGE_CHECK attribute and seems it worked. Here is part of the codes.

 

1. Create a ViBoolean write callback function:

static ViStatus _VI_FUNC agx2k3k_InterchangeCheckWriteCallback(ViSession vi, ViSession io, ViConstString repCapName, ViAttr attributeId, ViBoolean value)
{
	return IVI_ERROR_INVALID_VALUE;
}

 

 

2. Append the callback function to ATTR_INTERCHANGE_CHECK:

checkErr (Ivi_SetAttrWriteCallbackViBoolean (vi, AGX2K3K_ATTR_INTERCHANGE_CHECK, agx2k3k_InterchangeCheckWriteCallback));  

 

Hope this could help for your case.

 

 

Thanks,

 

- Charles

 

Message 4 of 5
(3,765 Views)

Hi Charles,

 

Yes, it works!! 

The solution is exactly what I was looking for.

 

Thank you so much for your great help. I really appreciate it!

 

Thanks,

Buckhorn

0 Kudos
Message 5 of 5
(3,742 Views)