PicoLog 1000 series Multiple Channel Streaming

Post general discussions on using our drivers to write your own software here
Post Reply
fatemeh
Newbie
Posts: 0
Joined: Thu Apr 06, 2023 2:23 am

PicoLog 1000 series Multiple Channel Streaming

Post by fatemeh »

Hello!
I have a 16 channel PicoLog datalogger and need to stream data from multiple channels simultaneously through Python. I am currently using the provided example code for single channel streaming but struggling to change this for multiple channels. What parameters need to be altered/added and how? I am not familiar with ctypes which is how this script is communicating between Python and C.
Thank you!

thopau
Newbie
Posts: 0
Joined: Tue Sep 05, 2023 3:48 pm

Re: PicoLog 1000 series Multiple Channel Streaming

Post by thopau »

Hello. I am also encountering the very same issue. I am using the PicoLog1216 and python. I would like to use, let's say, 2 or more channels. There is not really enough information regarding this. I would gladly provide a functioning code to improve the documentation if you could help me out with this.
How do we have control over which channels are currently recording?

does this happen at the level of channels = ctypes.c_int16(1)
does this happen at the level of picosdk.pl1000.pl1000GetValues(chandle, ctypes.byref(values), ctypes.byref(noOfValues), ctypes.byref(overflow), None)

Could you maybe provide a code snippet to clarify?
Thanks a lot

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: PicoLog 1000 series Multiple Channel Streaming

Post by Martyn »

It would be something like

Code: Select all

#channels, an array of numbers identifying the channels from which you wish to capture:
#[PL1000_CHANNEL_1 to PL1000_CHANNEL_12] (PicoLog 1012) enums 1 to 12
#[PL1000_CHANNEL_1 to PL1000_CHANNEL_16] (PicoLog 1216) enums 1 to 16
#Sampling of multiple channels is sequential.
#no_of_channels, the number of channels in the channels array
	
# set sampling interval
usForBlock = ctypes.c_uint32(10000000)
noOfValues = ctypes.c_uint32(1000000)
# array of the channels that you need to record in this example channels 1 to 4
channels = ctypes.c_int16([1, 2, 3, 4])

#number of channels set to 4
status["setInterval"] = pl.pl1000SetInterval(chandle, ctypes.byref(usForBlock), noOfValues, ctypes.byref(channels), 4)
assert_pico_ok(status["setInterval"])
I haven't checked this as I do not have a PicoLog 1012 or 1216 to test with
Martyn
Technical Support Manager

Post Reply