Test and Measurement Forum

PIC05203 SetTriggerChannelConditions Trigger Function?

Post general discussions on using our drivers to write your own software here

PIC05203 SetTriggerChannelConditions Trigger Function?

Postby tan85 » Wed Nov 18, 2009 1:38 pm

After calling
1.OpenUnit
2.SetChannel
3.SetMemorySeg
4.GetTimebase
5.SetTriggerFunctions:
-a.ps5000SetTriggerChannelConditions(Pico_handle1,ATriggerConditions,1);
-b.ps5000SetTriggerChannelDirections(Pico_handle1,RISING,NONE,NONE,NONE,NONE,NONE);
-C. ps5000SetTriggerChannelProperties(Pico_handle1,AChannelProperties, 1, 0, 0);
*ALL trigger functions return Error Code =0==> Everythings fine.
6.RunBlock
7.SetBuffer
8.GetValue
9.ps5000Stop

Now Redo the step (2-5), but now
The SetTriggerChannelConditons return error code=73 ,but SetTriggerChannelProperties return 0.
So what is the problem now?Why the trigger won't work?

I get the trigger work again once i closeunit or turn off the picoscope.
Any suggestion for solvong this problem?

Thanks
tan85
 

Re: PIC05203 SetTriggerChannelConditions Trigger Function?

Postby tan » Wed Nov 18, 2009 1:51 pm

Forget to mention I use delphi for coding..


thanks
tan
Newbie
 
Posts: 0
Joined: Mon Nov 16, 2009 3:01 pm

Re: PIC05203 SetTriggerChannelConditions Trigger Function?

Postby tan » Wed Nov 18, 2009 5:40 pm

Here is my pascal code:


New(ATriggerConditions) ;
ATriggerConditions^.ChannelA:=CONDITION_TRUE;
ATriggerConditions^.channelB:=CONDITION_DONT_CARE;
ATriggerConditions^.channelC:=CONDITION_DONT_CARE;
ATriggerConditions^.channelD:=CONDITION_DONT_CARE;
ATriggerConditions^.channelExt:=CONDITION_DONT_CARE;
ATriggerConditions^.aux:=CONDITION_DONT_CARE; ATriggerConditions^.pulseWidthQualifier:=CONDITION_DONT_CARE;
CodeError:=ps5000SetTriggerChannelConditions(Pico_handle1,ATriggerConditions,1);
Memo1.lines.Add('SetTrigChCond='+inttostr(CodeError));
Dispose(ATriggerConditions);

CodeError:= ps5000SetTriggerChannelDirections(Pico_handle1,RISING,NONE,NONE,NONE,NONE,NONE);
Memo1.lines.Add('SetTrigChDir='+inttostr(CodeError));

S1:=Edit4.TExt;
val(S1,TriggerL,C);
New(AChannelProperties) ;
AChannelProperties^.thresholdMajor:=round(TriggerL*32767/500); AChannelProperties^.thresholdMinor:=0; AChannelProperties^.hysteresis:=0;
AChannelProperties^.channel:=ps5000_Channel_A;
AChannelProperties^.thresholdMode := LEVEL;

CodeError:=ps5000SetTriggerChannelProperties(Pico_handle1,
AChannelProperties, 1, 0, 0);
Memo1.lines.Add('SetTrigChProp='+inttostr(CodeError));
Dispose(AChannelProperties);
///////////////////////////////////////////////
ps5000SetTriggerChannelConditions return 73.
ps5000SetTriggerChannelDirections return 0.
ps5000SetTriggerChannelProperties return 0 .

So any one can help me to find what is going wrong on the
function ps5000SetTriggerChannelConditions?
Thanks
tan
Newbie
 
Posts: 0
Joined: Mon Nov 16, 2009 3:01 pm

Pass the pointer into setTriggercondition in delphi problem?

Postby tan » Mon Nov 23, 2009 5:15 pm

SetTriggerFunctions:


New( ATriggerConditions) ;
ATriggerConditions^.ChannelA:=CONDITION_TRUE;
ATriggerConditions^.channelB:=CONDITION_DONT_CARE;
ATriggerConditions^.channelC:=CONDITION_DONT_CARE;
ATriggerConditions^.channelD:=CONDITION_DONT_CARE;
ATriggerConditions^.channelExt:=CONDITION_DONT_CARE;
ATriggerConditions^.aux:=CONDITION_DONT_CARE;
ATriggerConditions^.pulseWidthQualifier:=CONDITION_DONT_CARE;


CodeError:=ps5000SetTriggerChannelConditions(Pico_handle1,ATriggerConditions,1);
Memo1.lines.Add('SetTrigChCond='+inttostr(CodeError));
Dispose( ATriggerConditions);
ps5000SetTriggerChannelConditions(Pico_handle1,ATriggerConditions,1);

Note:ATriggerConditions is declared as pTriggerConditions;
where pTriggerconditions= ^tTriggerConditions.
and tTriggerConditions is a record class.( tTriggerConditions = record)

The SetTriggerChannelConditons return error code=73
So what is the problem now?Why the trigger won't work?
Any problem in declaring the Atriggerconditions and passing this pointer into triggercondition function call?
Any suggestion for solving this problem PLEASE?HELP!!!

Thanks
tan
Newbie
 
Posts: 0
Joined: Mon Nov 16, 2009 3:01 pm

Re: PIC05203 SetTriggerChannelConditions Trigger Function?

Postby moonlight shadow » Tue Mar 23, 2010 10:21 am

i have the same problems with my picoscope 5204 and Delphi.
1. the SetTriggerchannelproperties - function called with autotriggertime set to 0 results in a returncode 0 but the trigger is not working fine
2. in my case i have to have at least exactly 2041 (my buffersize) samples for the SetTriggerChannelProperties function to get an errorcode 0. the minuimum buffersize is not documented!!!
3.But the SetTriggerChannelConditions function still returns errorcode 73 (49hex) - the last several errorcodes are not documented, only in the newest picoStatus.h - wich means PICO_INVALID_TRIGGER_PROPERTY. I do not know if the errorcodes make a difference between Invalid Trigger Propertie and Invalid Trigger Condition?!?
I do not have any solution fo this...

By the way the .inc file has wrong definitions for the trigger function names!

At all i only need a simple Level-Trigger. Maybe it would be possible to include a ps5000SetSimpleLevelTrgger(handle,TriggerLevel,direction)-function into the API....

I hope one of the programmers at Pico can help and - by the way - can refresh the API-dcumentation and Delphi-Sources.
moonlight shadow
 

Re: PIC05203 SetTriggerChannelConditions Trigger Function?

Postby jim@jmxservices.com » Tue May 18, 2010 2:05 am

I have had a similar problem with the PS4424 when trying to use Channel C to trigger the units. I am getting an Error code 34(Hex 22) when I try to set the trigger conditions with coupling on Channel C. It will work fine on Channel A. If I first try to set the trigger conditions on Channel C and get the errror, when I go back after and set the Trigger coupling back to Channel A, I get the same error(73) you are getting on the trigger properties. The only way I can reset the error is to stop the application and restart it. I am using Borland Rad Studio 2007 with C++ Builder.
jim@jmxservices.com
Newbie
 
Posts: 0
Joined: Sun May 16, 2010 8:46 pm

Re: PIC05203 SetTriggerChannelConditions Trigger Function?

Postby Pico Stuart » Tue Jun 08, 2010 3:51 pm

Hi There,

Thank you for your input and raising this issue, we have solution to this and are currently testing this through and should be available in the next two weeks.

Kindest regards,

Stuart
Technical Speciliast
Pico Stuart
Site Admin
Site Admin
 
Posts: 72
Joined: Tue Jun 30, 2009 3:08 pm


Return to General Software Discussions

Who is online

Users browsing this forum: No registered users and 4 guests