Picolog Trigger question

Forum for discussing PicoLog
Post Reply
gwanwoo.choe
Newbie
Posts: 0
Joined: Wed Aug 05, 2020 5:24 am

Picolog Trigger question

Post by gwanwoo.choe »

Hello
I try to using trigger api function in C# application.
(I use Picolog 1216)
I made a code like below and i connected ch1 to 0.9V power rail.(it start up 0V to 0.9V)
I wish to capture waveform 0V to 0.9V.(By using trigger function)
But when i run "Imports.Run(handle, nValues, Imports.enPL1000Method.SINGLE)" and
voltage ramp-up it captured waveform 1.5V -> 0V.
Actually it starts 0V to 0.9V.
In PICOlog SW, i can captured voltage rising waveform.
Anyone can help me why it captured different waveform rather than actual voltage ramp up?

==================================================
//enum setting for trigger option
public enum PicoTriggerSelection
{
//enabled, whether to enable or disable the trigger:
// 0: disable the trigger
// 1: enable the trigger
PL1000_TRIGGER_DISABLED = 0,
PL1000_TRIGGER_ENABLED
}

public enum PicoAutoTriggerSelection
{
//auto_trigger, whether to rearm the trigger automatically after each trigger event:
PL1000_AUTO_TRIGGER_DISABLED = 0,
PL1000_AUTO_TRIGGER_ENABLED
}
public enum PicoAuto_ms
{
//auto_ms, time in milliseconds after which the unit will auto-trigger if the trigger condition is not met
PL1000_AUTO_ms_0 = 0,
PL1000_AUTO_ms_1,
PL1000_AUTO_ms_2,
PL1000_AUTO_ms_3,
PL1000_AUTO_ms_4,
PL1000_AUTO_ms_5,
PL1000_AUTO_ms_6,
PL1000_AUTO_ms_7,
PL1000_AUTO_ms_8,
PL1000_AUTO_ms_9,
PL1000_AUTO_ms_10,
PL1000_AUTO_ms_100=100,
PL1000_AUTO_ms_200=200,
PL1000_AUTO_ms_300=300,

}

//dir, which edge to trigger on:
//0: rising edge
//1: falling edge
public enum Pico_Trigger_Edge_Select
{
//dir, which edge to trigger on:
//0: rising edge
//1: falling edge
PL1000_Trogger_Edge_Rise = 0,
PL1000_Trogger_Edge_Fall
}

public enum Pico_Trigger_Threshold
{
//dir, which edge to trigger on:
//0: rising edge
//1: falling edge
//threshold, trigger threshold(the level at which the trigger will activate) in ADC counts
PL1000_Trogger_Threshold_0V3 = 491,
PL1000_Trogger_Threshold_0V5 = 819,
PL1000_Trogger_Threshold_0V7 = 1146,
PL1000_Trogger_Threshold_0V9 = 1031,
PL1000_Trogger_Threshold_2V5 = 4095,
PL1000_Trogger_Threshold_1V4 = 2293
}


public enum Pico_Trigger_hysteresis
{
//hysteresis, trigger hysteresis in ADC counts.This is the difference between the upper and lower
//thresholds. The signal must then pass through both thresholds in the same direction in order to activate the
//trigger, so that there are fewer unwanted trigger events caused by noise.The minimum value allowed is 1.
PL1000_Trogger_Hysteresis_0V = 0,
PL1000_Trogger_Hysteresis_0V2 = 327,
PL1000_Trogger_Hysteresis_0V3 = 491,
PL1000_Trogger_Hysteresis_0V5 = 819,
PL1000_Trogger_Hysteresis_0V7 = 1146,
PL1000_Trogger_Hysteresis_0V9 = 1031,
PL1000_Trogger_Hysteresis_2V5 = 4095,
PL1000_Trogger_Hysteresis_1V4 = 2293
}


===================================================
//Trigger running
short handle;
short status;
ushort nValues = 100;

short[] channels = {1};

int x = pl1000OpenUnit(out handle); //Pico Logger open

int result = pl1000PingUnit(handle);
if (result == 0)
{
//MessageBox.Show("Pico device OK");
}
else
{
MessageBox.Show("Pico device failed.");
}

uint us_for_block = 1000; //1ms

Imports.SetTrigger(
handle,
(ushort)PicoTriggerSelection.PL1000_TRIGGER_ENABLED,
(ushort)PicoAutoTriggerSelection.PL1000_AUTO_TRIGGER_DISABLED,
(ushort)PicoAuto_ms.PL1000_AUTO_ms_100,
Imports.enPL1000Inputs.PL1000_CHANNEL_1,
(ushort)Pico_Trigger_Edge_Select.PL1000_Trogger_Edge_Rise,
(ushort)Pico_Trigger_Threshold.PL1000_Trogger_Threshold_0V3,
(ushort)Pico_Trigger_hysteresis.PL1000_Trogger_Hysteresis_0V2
, 0.0f); //delay


Imports.SetInterval(handle, ref us_for_block, nValues, channels , (short)channels.Length);

//100개 샘플 캡쳐
Imports.Run(handle, nValues, Imports.enPL1000Method.SINGLE);

Post Reply