trigger setttings

Post your LabVIEW discussions here
Post Reply
s.kavitha
Newbie
Posts: 0
Joined: Tue Apr 24, 2012 4:56 am

trigger setttings

Post by s.kavitha »

hi i am kavitha. i am doing project in labview for data acquisition from impact echo. i downloaded ps3000_faststream.vi . initially the trigger value is been set to 0.for my project i want to make some modification in trigger settings. my aim is to perform data collection only after the occurance of each trigger. can u please help me to set the trigger.

Hitesh

Re: trigger setttings

Post by Hitesh »

Hello Kavitha,

Which device are you using?

I presume you are referring to the SetTrigger2 function in the block diagram.

Referring to the Programmer's Guide (http://www.picotech.com/document/pdf/ps3000pg-en-2.pdf), section 2.4.11 ps3000_set_trigger2 shows the parameters to be passed in with a description of what they represent:
  • handle, - handle to the unit
  • source, - the channel - 0 is channel A
  • threshold, - the threshold voltage in ADC counts
  • direction, - an enumeration for whether the signal is rising (0) or falling (1)
  • delay, - percentage of data points that are pre-trigger/post-trigger
  • auto_trigger_ms - delay (in ms) after which the trigger will occur automatically
You will need to set the value for threshold in 16-bit ADC Counts. You can use the following formula to do this:

adc_counts = threshold (milliVolts) * max ADC value / range

so for example, a threshold of 1000 mV and a range of +/-2000mV would result in

1000 * 32767 / 2000 = ~16384

I hope this helps - if you do require further assistance with this, please do respond to this post.

Regards,

s.kavitha
Newbie
Posts: 0
Joined: Tue Apr 24, 2012 4:56 am

Thank you for replying sir. but it's not work

Post by s.kavitha »

thank you sir,
i given the threshold value 8142, it's not respond anything. and i am attached Ps3000_faststream.vi and actual output snapshots document. so please kindly help me sir.
Attachments
Snapshot.rar
trigger problem details and snapshots
(144.78 KiB) Downloaded 546 times
ps3000_fastStream.vi
set trigger
(64.75 KiB) Downloaded 721 times

Hitesh

Re: trigger setttings

Post by Hitesh »

Hi Kavitha,

I've taken a look at the input values to the ps3000_set_trigger_2() function and I can see that you are passing in the enumeration value for 1 Volt. You will need to convert this to an ADC count value - I have attached an example based on the first file that you posted - this should trigger at a level of 500mV.
ps3000_fastStream[1]_trigger.vi
Example file
(55.34 KiB) Downloaded 717 times
You should be able to copy the inputs to your diagram and test it. The maximum ADC count value for the device is +32767.

I have carried out a test with your initial file having seen in your other post that you are using a PicoScope 3224 and captured some data prior to this post. Please note that in streaming mode, data collection will begin immediately regardless of whether a trigger is set or not.

Also ensure that you have the latest version of PicoScope 6 installed on your PC to ensure that you have the latest dll file installed. If you wish you can copy the ps3000.dll from C:\Program Files\Pico Technology\PicoScope6 to the same directory as your LabVIEW file.

Please try this - if you have any further issues, please send me the rar file as a .zip file.

Best wishes,

s.kavitha
Newbie
Posts: 0
Joined: Tue Apr 24, 2012 4:56 am

Re: trigger setttings

Post by s.kavitha »

Thank you sir.
i tried the vi file which u posted.But i cant set the trigger. can we make the data collection with trigger using autostop which is in getfaststreamingdetail function. the parameters are
numsample
handle
overflow-0
triggeredat-0
triggered-0
autostop-0
is there any possible way to set trigger using autostop?
if so, can u pls send me the procedure.

Hitesh

Re: trigger setttings

Post by Hitesh »

Hi Kavitha,

I've been looking into the LabVIEW file - it is going to need some further investigation to provide you with an answer.

The getfaststreamingdetail function sets flags to indicate if an overflow, trigger or autostop has occurred. The triggeredAt variable indicates where in the buffer the trigger occurred.

AutoStop can be set via the RunFastStreaming (ps3000_run_streaming_ns) function.

I'll provide an update as soon as I can.

Regards,

Hitesh

Re: trigger setttings

Post by Hitesh »

Hello Kavitha,

I've attached a modified version of the LabVIEw example we provide for fast streaming - the trigger function does work but you need to bear in mind the following:
  • I've changed the ps3000_set_trigger2 function to ps3000_set_trigger (no major difference other than the delay value is not a float) - please make sure that the auto_trigger_ms value is not set to 0 as there may be a bug in the driver.
  • In the RunFastStreaming call (ps3000_run_streaming_ns), ensure that auto_stop is set to true.
  • I have added some logic to retain on the display whether the scope has triggered and where it has triggered as it was being overwritten on each call.
Please note that the trigAt value refers to the index in the buffer being returned in that call to the function and not the overall number of samples - hence the additional counter to show the number of samples at the trigger.

Due to time constraints I have not been able to add logic in to reset the indicators that show whether the scope has triggered or not when you start a new run - the following article might help:

http://digital.ni.com/public.nsf/allkb/ ... 1D0075404F

Also, I have left the trigger threshold at 16256 ADC counts (500mV with a 1V range selected).

I hope this helps.
Attachments
ps3000_fastStream_triggered.vi
Fast Streaming with Trigger LabVIEW file.
(58.35 KiB) Downloaded 728 times

s.kavitha
Newbie
Posts: 0
Joined: Tue Apr 24, 2012 4:56 am

Re: trigger setttings

Post by s.kavitha »

Thank you sir. The vi file that u have sent is very useful. we worked on it and it's working good.

Post Reply