PicoLog 1000 and channel sync

Forum for discussing PicoLog
Post Reply
rgramann
Newbie
Posts: 0
Joined: Fri Apr 05, 2019 3:30 pm

PicoLog 1000 and channel sync

Post by rgramann »

Hi,
We're using your Pico SDK to monitor (6) pressure sensors as a continuous stream, with a sampling rate of 1 reading/sec. I am able to pull these readings using pl1000GetValues(). During testing, I attach a plunger to the sensor to simulate an increase in pressure. The pressure values are displayed within my application. However, occasionally the channels appear to get out-of-sync. For example, apply pressure to Sensor #1, and the data in the values array shows an increase in Channel #3. This is unpredictable, and happens about 10% of the time. We've tested the integrity of the sensors and cabling, which checks out. Just trying to figure out what I'm doing wrong.

We're connected via USB, running in a Citrix VM Windows 7 SP1.

pl1000.dll v1.2.0.5
picowinusb driver 2.0.5.12

Visual Studio 2017
C#/WPF

Any help would be appreciated.

Cheers,

Ron

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

Re: PicoLog 1000 and channel sync

Post by Martyn »

We would need to see your code to see how you have set up the device, and how you are collecting data. You can either post this here or you can send it to support@picotech.com and one of the team will be able to look into it.
Martyn
Technical Support Manager

rgramann
Newbie
Posts: 0
Joined: Fri Apr 05, 2019 3:30 pm

Re: PicoLog 1000 and channel sync

Post by rgramann »

Thanks Martyn,

Code: Select all

Note: _readReceived is defined as Action

 public async void Start(uint numberOfReadingsPerSecond)
        {
            try
            {
                var usForBlock = (uint) 1000000 ;
                short[] channels = {1, 2, 3, 4, 5, 6};
                var status = _pico.SetInterval(ref usForBlock, numberOfReadingsPerSecond, channels, 6);

                status = _pico.Run(numberOfReadingsPerSecond, enPL1000Method.STREAM);
                IsRunning = true;

                while (true)
                {
                    if (!IsRunning)
                    {
                        break;
                    }

                    short isReady = 0;

                    while (isReady==0)
                    {
                        _pico.Ready(out isReady);
                    }

                    var values = new short[channels.Length * numberOfReadingsPerSecond];
                    var numberOfValues = (ushort) (numberOfReadingsPerSecond);

                    status = _pico.GetValues(values, ref numberOfValues, out var overflow, out var triggerIndex);

                    if (numberOfValues > 0)
                    {
                        Debug.WriteLine($"1:{values[0]},2:{values[1]},3:{values[2]},4:{values[3]},5:{values[4]},6:{values[5]}");
                    }

                    if ((uint) status == StatusCodes.PICO_OK)
                    {
                        if (numberOfValues > 0)
                        {
                            _readReceived?.Invoke(values);
                        }
                    }
                    else
                    {
                        var message = status.ToStatusCodeMessage();
                        Stop();
                        await _logger.Log(new PicoException(message));
                        Error?.Invoke(this, message);
                        return;
                    }
                }
            }
            catch (Exception e)
            {
                Stop();
                await _logger.Log(e);
            }
        }

rgramann
Newbie
Posts: 0
Joined: Fri Apr 05, 2019 3:30 pm

Re: PicoLog 1000 and channel sync

Post by rgramann »

FYI, _pico is a wrapper around the Pico API

Post Reply