PicoLog 1000 series Multiple Channel Streaming
PicoLog 1000 series Multiple Channel Streaming
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!
Re: PicoLog 1000 series Multiple Channel Streaming
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
Re: PicoLog 1000 series Multiple Channel Streaming
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"])
Technical Support Manager