1
2'''
3AI - AI_N_samples_once.py.
4
5This example demonstrates how to read AI data in N-sample mode.
6
7To begin with, it start AI acquisition with sampling rate and samples.
8Then, it outlines the procedure for reading the streaming AI data.
9
10For other examples please check:
11 https://github.com/WPC-Systems-Ltd/WPC_Stand-alone_Python_release/tree/main/examples
12
13Copyright (c) 2024 WPC Systems Ltd.
14All rights reserved.
15'''
16
17## WPC
18import pywpc
19
20## Parameters setting
21sampling_rate = 1000
22sample = 10
23delay = 2000
24
25## Start AI acquisition
26pywpc.AI_start(sampling_rate, sample)
27
28## Read data acquisition
29ai_sample = pywpc.AI_readNsample(sample, delay)
30print(ai_sample)
31
32## Stop AI acquisition
33pywpc.AI_stop()
34
35del ai_sample