Test and Measurement Forum

g_status = PLCM3OpenUnit

Post your C and C++ discussions here

g_status = PLCM3OpenUnit

Postby Martin Chisnall » Sat Dec 10, 2016 3:23 pm

Hi,
I am a C beginner writing code for the PLCM3 based upon your sample code in the SDK.
I am confused by the line g_status = PLCM3OpenUnit(&g_handle, NULL);
My understanding is the function should only return 0 if it completes successfully.
In fact it appears to return 0 even if the CM3 is no longer physically connected (USB unplugged)
What am I misunderstanding please?
Thank you
Martin Chisnall
Newbie
 
Posts: 0
Joined: Tue Dec 06, 2016 9:53 pm

Re: g_status = PLCM3OpenUnit

Postby Hitesh » Tue Dec 13, 2016 11:02 am

Hi Martin,

Which version of the plcm3.dll is your application using?

You can find this by right-clicking on the dll, selecting Properties and then selecting the Details tab. Alternatively, please call the PLCM3GetUnitInfo function with the info argument set to PICO_DRIVER_VERSION (you can set the handle value to something like 16384.

Regards,
Hitesh

Technical Support Engineer
Hitesh
Site Admin
Site Admin
 
Posts: 2365
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: g_status = PLCM3OpenUnit

Postby Martin Chisnall » Wed Dec 14, 2016 8:16 am

Hi Hitesh,
plcm3.dll (32bit) version 1.0.4.9
Thank you for your alternate suggestion. I am in fact already using PLCM3GetUnitInfo USB_version to check for the hardware presence as I have discovered that returns 0 correctly. I just thought PLCM3OpenUnit would be a logical place to check.
Martin
Martin Chisnall
Newbie
 
Posts: 0
Joined: Tue Dec 06, 2016 9:53 pm

Re: g_status = PLCM3OpenUnit

Postby Hitesh » Wed Dec 14, 2016 9:27 am

Hi Martin,

Thanks for confirming the version.

That does appear to be a little bit out of date. There are two options for obtaining a more recent driver:

1. Download and install PicoLog 5.25.3 (you will need to be using Windows 7 or later) from our Downloads page and use the driver from the installation directory (copy it to the SDK installation directory).

2. E-mail support@picotech.com and we can provide a dll

Regards,
Hitesh

Technical Support Engineer
Hitesh
Site Admin
Site Admin
 
Posts: 2365
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: g_status = PLCM3OpenUnit

Postby Martin Chisnall » Wed Dec 14, 2016 12:25 pm

Hi Hitesh,
Yes, that works. Updating the dll to 1.0.6.2 solves the PLCM3OpenUnit problem.
So for your reference, the SDK is shipping with an outdated 32 bit plcm3.dll
thank you again,
Martin
Martin Chisnall
Newbie
 
Posts: 0
Joined: Tue Dec 06, 2016 9:53 pm

Re: g_status = PLCM3OpenUnit

Postby Hitesh » Wed Dec 14, 2016 12:35 pm

Thanks for confirming that Martin.

The SDK has not been updated as we are in the process of looking of how best to deploy the examples.

Regards,
Hitesh

Technical Support Engineer
Hitesh
Site Admin
Site Admin
 
Posts: 2365
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire


Return to C and C++

Who is online

Users browsing this forum: No registered users and 1 guest