MCPcopy Create free account
hub / github.com/LabPy/lantz / simple_test

Function simple_test

examples/experiment.py:15–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13Hz = Q_(1, 'Hz')
14
15def simple_test():
16 with LantzSignalGeneratorTCP(host='localhost', port=5678) as actuator:
17 print('The identification of the actuator is : ' + actuator.idn)
18 actuator.amplitude = 3 * volt
19 actuator.offset = 200 * milivolt
20 actuator.frequency = 20 * Hz
21 actuator.output_enabled = True
22 actuator.waveform = 'sine'
23 actuator.refresh()
24 actuator.dout[1] = True
25 print(actuator.dout[1])
26 print(actuator.din[2])
27 actuator.calibrate()
28 actuator.self_test(1, 3)
29
30 with LantzVoltmeterTCP(host='localhost', port=5679) as sensor:
31 print('The identification of the sensor is : ' + sensor.idn)
32 sensor.range[0] = 10
33 sensor.self_test()
34 sensor.refresh()
35 print(sensor.voltage[0])
36 print(sensor.voltage[1])
37 sensor.calibrate()
38 sensor.auto_range(0)
39 print(sensor.range[0])
40 print(sensor.voltage[0])
41
42def test_experiment():
43 import time

Callers 1

experiment.pyFile · 0.85

Calls 4

refreshMethod · 0.80
auto_rangeMethod · 0.80
calibrateMethod · 0.45
self_testMethod · 0.45

Tested by

no test coverage detected