g_status = PLCM3OpenUnit

Post your C and C++ discussions here
Post Reply
Martin Chisnall
Newbie
Posts: 0
Joined: Tue Dec 06, 2016 9:53 pm

g_status = PLCM3OpenUnit

Post by Martin Chisnall »

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

Hitesh

Re: g_status = PLCM3OpenUnit

Post by Hitesh »

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,

Martin Chisnall
Newbie
Posts: 0
Joined: Tue Dec 06, 2016 9:53 pm

Re: g_status = PLCM3OpenUnit

Post by Martin Chisnall »

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

Hitesh

Re: g_status = PLCM3OpenUnit

Post by Hitesh »

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,

Martin Chisnall
Newbie
Posts: 0
Joined: Tue Dec 06, 2016 9:53 pm

Re: g_status = PLCM3OpenUnit

Post by Martin Chisnall »

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

Hitesh

Re: g_status = PLCM3OpenUnit

Post by Hitesh »

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,

Post Reply