()
| 13 | Hz = Q_(1, 'Hz') |
| 14 | |
| 15 | def 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 | |
| 42 | def test_experiment(): |
| 43 | import time |
no test coverage detected