Test and Measurement Forum

Addressing one Picolog 1216 when multiple are present

Post your LabVIEW discussions here

Addressing one Picolog 1216 when multiple are present

Postby jsiegris » Thu Nov 30, 2017 8:43 pm

I want a test fixture that has 12 Picolog 1216 connected with USB.
I only want to address and use one at a time.

Looking at the driver pl1000OpenUnit I assume that handle is the identifier for an individual logger. How do I determine each handle for all 12 individual loggers?
jsiegris
Newbie
 
Posts: 0
Joined: Thu Nov 30, 2017 8:36 pm

Re: Addressing one Picolog 1216 when multiple are present

Postby Martyn » Fri Dec 01, 2017 1:46 pm

Using OpenUnit to open a unit and get the handle, and then use GetUnitInfo to get the serial number, would be the only way to identify a device to a handle for the PicoLog 1216.
Martyn
Technical Support Manager
Martyn
Site Admin
Site Admin
 
Posts: 3091
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Addressing one Picolog 1216 when multiple are present

Postby jsiegris » Fri Dec 01, 2017 8:45 pm

Does each device have a unique static handle? Once I have all the handles for each device I use that as the input for a particular device with OpenUnit?
jsiegris
Newbie
 
Posts: 0
Joined: Thu Nov 30, 2017 8:36 pm

Re: Addressing one Picolog 1216 when multiple are present

Postby Martyn » Mon Dec 04, 2017 9:24 am

I am not sure that the OpenUnit function will allow you to specify the handle, and I am out of the offcie until next week so will not be able to check this.

Are you not able to open all units, and then just address and use them one at a time ?
Martyn
Technical Support Manager
Martyn
Site Admin
Site Admin
 
Posts: 3091
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Addressing one Picolog 1216 when multiple are present

Postby jsiegris » Tue Dec 05, 2017 3:52 pm

Does each device have a unique static handle?
I only need to call OpenUnit function once then operate on each device by it handle?
jsiegris
Newbie
 
Posts: 0
Joined: Thu Nov 30, 2017 8:36 pm

Re: Addressing one Picolog 1216 when multiple are present

Postby Martyn » Tue Dec 05, 2017 8:27 pm

If you open all units each will have a unique handle, if you know which serial number relates to which handle you can then operate on each unit using it's unique handle.
Martyn
Technical Support Manager
Martyn
Site Admin
Site Admin
 
Posts: 3091
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Addressing one Picolog 1216 when multiple are present

Postby jsiegris » Wed Dec 06, 2017 5:53 pm

I'm still not sure on how to address an individual device. Tell me if the following is correct.
Example
Device1: After connecting usb to only this device and issuing OpenUnit the handle returned is 16384
Device2: After connecting usb to only this device and issuing OpenUnit the handle returned is 16385

Now I connect both devices to usb on the same PC.

I perform OpenUnit. It returns 16384. But I want to GetUnitInfo from 16385.
I ignore 16384 that OpenUnit returned and perform GetUnitInfo using 16385 as the handle?

===============
I'm looking for detailed information on exactly what OpenUnit is doing. All the LabVIEW VI examples I have seen show an input = 0. Does OpenUnit do anything with this input?
jsiegris
Newbie
 
Posts: 0
Joined: Thu Nov 30, 2017 8:36 pm

Re: Addressing one Picolog 1216 when multiple are present

Postby Martyn » Thu Dec 07, 2017 9:50 am

If you only have one device connected to the PC at a time it will always be allocated the 16384 handle.

Imagine you have four units all connected to the PC, lets call these Serial1, Serial2, Serial3 sand Serial4

First you need to setup an array to hold the handles for each device

Serial1 handle
Serial2 handle
Serial3 handle
Serial4 handle

then in a loop you need to call open unit to retrieve a handle, then call getunitinfo to identify the serial number, then compare this with the serial numbers in your array and assign the handle to the correct device. Repeat this four times and you will now have something like

Serial1 16385
Serial2 16386
Serial3 16384
Serial4 16387

Now in you program if you wish to talk to Serial2 you look up the handle, in this case 16386, and then use that for all the API calls

Do not call CloseUnit, for any unit, until you close down the application.

Please note that the next time the PC and application is started the order of the handles may change.

Hope this helps.
Martyn
Technical Support Manager
Martyn
Site Admin
Site Admin
 
Posts: 3091
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Addressing one Picolog 1216 when multiple are present

Postby jsiegris » Thu Dec 07, 2017 3:29 pm

When I perform this loop will I be able to get the handle for all devices as shown in Windows OS Device Manager? Or is there a limit to the number of devices OpenUnit can handle?

I the test setup I am considering I would need 12 Pico 1216 connected to the PC.
jsiegris
Newbie
 
Posts: 0
Joined: Thu Nov 30, 2017 8:36 pm

Re: Addressing one Picolog 1216 when multiple are present

Postby Martyn » Fri Dec 08, 2017 7:09 am

Technically you can go up to 64, although we have never tried this many, you will be fine with 12 which has been tried.
Martyn
Technical Support Manager
Martyn
Site Admin
Site Admin
 
Posts: 3091
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots


Return to LabVIEW

Who is online

Users browsing this forum: No registered users and 1 guest