ExpEYES

Programming ExpEYES with python

To run ExpEYES, you need the following

The main features are:

These are implemented using corresponding Python functions. Some of them are explained below.

import eyes17.eyes
p = eyes17.eyes.open()

Every program should start with these two lines, to load the library and establish a connection if the hardware is connected. The variable ā€˜pā€™ is an Object representing the device and subsequent calls use this.

v = p.get_voltage('A1')      #  Read the voltage present at input A1 
print (v)

Instead of ā€˜A1ā€™ you may use any other inputs.

Now Connect a wire from PV1 to A1.

import time
p.set_pv1(2.5)    			# Sets the voltage on PV1
time.sleep(0.2)      		# Allow some time to settle
v = p.get_voltage('A1')     # Read the volatge at A1
print(v)

The readback may differ by 4-5 millivolts. The resolution is 12 bits only.

import matplotlib.pyplot as plt
p.set_sine(1000)				# Set 1kH sine wave on WG
time.sleep(0.5)
p.select_range('A1',4)			# Set A1 to 4V max
t,v = p.capture1('A1',300, 5)	# Digitize 300 points, 5 microsecond spacing
plt.plot(t,v)					
plt.show()

Generates a sine wave on WG. Captures A1 and plots the waveform.

import matplotlib.pyplot as plt
import numpy as np

def f1(x):
	return np.sin(x) + np.sin(3*x)/3

p.load_equation(f1, [-np.pi, np.pi])
p.set_wave(400)
t,v = p.capture1('A1', 500,10)
plt.plot(t,v)
plt.show()

Demonstrates Arbitrary waveform generation.

For more information refer to Chapter 7 of the ExpEYES017 user manual