Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I register a new version of BVOPCClient.dll on Win9x machine?

This is a followup question to one I first posted in the FieldPoint section entitled:

"How to get the OPC Client (VC++ example program) to work? Having DataSocket problems..."

I'm trying to get our custom software (written in C++ by someone else) to talk with a NI FieldPoint
device. The device works fine, and can communicate perfectly with the FieldPoint Explorer.

Our software uses the ComponentWorks DataSocket ActiveX control (cwds.ocx) to talk with an OPC Server which in turn communicates with the FieldPoint device. The call to Create the datasocket results in an error:

Can't connect to URL step 4 (0x800c000d)

I think this error comes from our code and I believe that the URL is not the problem.

This led me to investigate whether the DataSocket is working at all. I downloaded the sample application
called OPC Client, compiled it into a Release version executable ran it on my client machine.

I believe the Browse button is supposed to bring up a list of OPC servers, but instead i get the error
message:

"OPC Client, Member not found."

I am using FieldPoint Explorer 3.0 and ComponentWorks 2.01 and have installed both a couple times with no improvement.

"Another clue: In reading the KB article called "Redistributing a ComponentWorks Application Built with DataSocket" (Document ID: DIRECT-45GPQQ) I came across this line:

"If you want to use OPC browsing, include BVOPCClient.dll."

This seemed like the thing to do, but I couldn't find it on my client or development machine. However I did
find it on an old development machine that was used to develop the original software that I am working
on, and happens to be the only machine on which the OPC Client example program works. (I can't test my
code on this machine because the instrument isn't connected to it.)

I copied the file BVOPCClient.dll into the C:\WINDOWS\SYSTEM directory on my client machine and then tried to register it with regsvr32.exe. I got the following error message:

"c:\windows\system\BVOPCClient.dll was loaded, but the DllRegisterServer entry point was not found.
DllRegisterServer may not be exported, or a corrupt version of c:\windows\system\BVOPCClient.dll may
be in memory. Consider using PView to detect and remove it."

I then found a newer version of BVOPCClient.dll on your site and downloaded that with the same result.

I then reinstalled FieldPoint Explorer 3.0 with all options checked AND ComponentWorks 2.01 with all
options checked to see if the .dll would show up and be registered that way. No dice.

I've also tried regsvr32 with the /i /n options to use DllInstall rather than DllRegisterServer but this results in a simlar error message. I'm guessing that BVOPCClient.dll is not a self-registerable .dll and that it needs to be installed with some kind of official program. Is this the case or is there a workaround to register the .dll manually?

OR am I totally offtrack and missing something else? It seems like it should be easier than this.

Thanks,

Eric
0 Kudos
Message 1 of 5
(3,703 Views)
The error you are getting in the OPC Client demo is trying to tell you that some member of the DataSocket class you tried to access does not exist on the version you are using. It is most likely the SelectURL member method that allows you to browse for OPC and DataSocket data items.

What version of the DataSocket nids.dll do you have? You should most likely be using version 3.0x and up with the OPC Client example program. As far as not being able to connect to the URL you have created separately, are you able to connect to it in any fashion with DataSocket or another OPC API? Do you get this error on a call to the DataSocket Connect or ConnectTo member methods? More information along these lines might help.

As for the bvopcclient.dll this shouldn't
factor into this situation at all, it is a BridgeView OPC interface, and is not used for the OPC Client example you were trying.

In the long run you might want to know that you would best be suited trying to access OPC servers with the latest version of DataSocket, v4.0. You can get it with an upgrade to any of your major development environments like ComponentWorks, which is now a part of Measurement Studio and is currently listed at v6.0 (v2.0 of CW is two major revisions behind v6.0, version numbers 4 and 5 were skipped as number conventions.)

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 2 of 5
(3,703 Views)
I don't have any version of nids.dll on any 3 of my machines including the one on which the OPC Client example works. I've seen reference to it a few places but couldn't find anywhere to download it. I'm guessing that it did not come with ComponentWorks 2.0.1? Was there an equivlent .dll that came with that version that I could look for?

In my code, as far as I can tell the problem occurs in a call to ConnectTo which is in cwdatasocket.h:

void CCWDataSocket::ConnectTo(LPCTSTR URL, long AccessMode)
{
static BYTE parms[] = VTS_BSTR VTS_I4;
InvokeHelper(0xd, DISPATCH_METHOD, VT_EMPTY, NULL, parms, URL, AccessMode);
}


and my code looks like this (i've cut some irrelevent parts...):

bool CCurrentLoop::InitializeDSockets()
{
BSTR b
strLic;
BOOL cRFail, cWFail;
VARIANT vt;
vt.vt = VT_R4;
vt.fltVal = 0.004f;

pWs = new CCWDataSocket[mNumOutputs];
pRs = new CCWDataSocket[mNumOutputs];

bstrLic = ::SysAllocStringLen(pwchcwdsLic1, sizeof (pwchcwdsLic1) / sizeof(WCHAR));
CString lic1 = pLic1;

for (int i = 0; i < mNumOutputs; i++)
{
cWFail = pWs[i].Create("", WS_DISABLED, CRect(0,0,100,100), pWnd, DSID[i], NULL, FALSE, bstrLic);
cRFail = pRs[i].Create("", WS_DISABLED, CRect(0,0,100,100), pWnd, DSRID[i], NULL, FALSE, bstrLic);

if ((cWFail == FALSE) || (cRFail == FALSE))
{
AfxMessageBox("No Data Socket Created");
return(FALSE);
}

CCWData data(pWs[i].GetData());
data.SetValue(vt);

pWs[i].ConnectTo(pDSRec[i].url, cwdsWriteAutoUpdate); ** Error occurs here!!
pRs[i].ConnectTo(pDSRec[i].url, cwdsReadAutoUpdate);
}
.
.
.


Thanks much!

Eric
0 Kudos
Message 3 of 5
(3,703 Views)
I've double checked and I think that the BVOPCClient.dll is definitely important for my application and the sample program. I renamed it and the program didn't work, named it correctly and it did work. I'm guessing that the functionality that is now contained within nids.dll used to be part of BVOPCClient.dll. I have ComponentWorks 2.0.1 which is a few years old I think. My program uses the ActiveX control cwds.ocx and I have version 2.1.447 (1997). Without upgrading to the latest and greatest version of Measurement Studio, it seems like I should be able to get this thing working now, since it was working 2 years ago and still does work on the old development computer.

Is there a way to register BVOPCClient.dll on my new client machine and try out this
hypothesis?

Thanks!

Eric
0 Kudos
Message 4 of 5
(3,703 Views)
Hello??
0 Kudos
Message 5 of 5
(3,703 Views)