On my B3000 Optomux firmware, I am having trouble with the ‘Set Trigger Pulse Polarity’ command. It does not seem to function, but the ‘Trigger On Positive Pulse’ and ‘Trigger On Negative Pulse’ do work. Here is a python terminal dump showing the problem.
>>> on.date_of_firmware(4)
OmuxNET.date_of_firmware(address=4)
OmuxNET.send_receive(address=4,command=80)
OmuxNET.build_packet(address=4,command=80)
OmuxTTY.write(pkt=>04`C4)
OmuxTTY.read(n=28)
OmuxNET.process_response(command=80,rsp=A810A09149809020100300000C8)
('A', '09/14/98')
>>> on.date_of_firmware(0)
OmuxNET.date_of_firmware(address=0)
OmuxNET.send_receive(address=0,command=80)
OmuxNET.build_packet(address=0,command=80)
OmuxTTY.write(pkt=>00`C0)
OmuxTTY.read(n=28)
OmuxNET.process_response(command=80,rsp=A810A09149809020100300000C8)
('A', '09/14/98')
>>> on.reset(4)
(‘A’, 0)
>>> on.set_timer_resolution(4,1)
(‘A’, 0)
>>> on.set_timer_resolution(0,10)
(‘A’, 0)
>>> on.set_pulse_trigger_polarity(4,15)
(‘A’, 0)
>>> on.read_and_clear_pulse_duration_counters(4,15)
(‘A’, (0, 0, 0, 0))
>>> on.read_pulse_complete_bits(4)
(‘A’, (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
>>> on.start_on_pulse(0,15,50)
(‘A’, 0)
>>> on.read_pulse_complete_bits(4)
(‘A’, (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
>>> on.trigger_on_positive_pulse(4,15)
(‘A’, 0)
>>> on.start_on_pulse(0,15,50)
(‘A’, 0)
>>> on.read_pulse_complete_bits(4)
(‘A’, (1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
>>> on.read_and_clear_pulse_duration_counters(4,15)
(‘A’, (499, 500, 499, 500))
utl.start_logging()
logging started
>>> on.set_pulse_trigger_polarity(4,15)
OmuxNET.set_pulse_trigger_polarity(address=4,positions=15)
OmuxNET.send_receive(address=4,command=28,{‘positions’: 15})
OmuxNET.build_packet(address=4,command=28,{‘positions’: 15})
OmuxTTY.write(pkt=>04a000F9B)
OmuxTTY.read(n=2)
OmuxNET.process_response(command=28,rsp=A)
(‘A’, 0)
>>> on.start_on_pulse(0,15,50)
OmuxNET.start_on_pulse(address=0,positions=15,time=50)
OmuxNET.send_receive(address=0,command=73,{‘positions’: 15, ‘data’: 50})
OmuxNET.build_packet(address=0,command=73,{‘positions’: 15, ‘data’: 50})
OmuxTTY.write(pkt=>00k000F3206)
OmuxTTY.read(n=2)
OmuxNET.process_response(command=73,rsp=A)
(‘A’, 0)
>>> on.read_pulse_complete_bits(4)
OmuxNET.read_pulse_complete_bits(address=4)
OmuxNET.send_receive(address=4,command=31)
OmuxNET.build_packet(address=4,command=31)
OmuxTTY.write(pkt=>04dC8)
OmuxTTY.read(n=8)
OmuxNET.process_response(command=31,rsp=A0000C0)
OmuxNET.optomux_data_to_tuple(data=0000)
(‘A’, (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
>>> on.read_and_clear_pulse_duration_counters(4,15)
OmuxNET.read_and_clear_pulse_duration_counters(address=4,positions=15)
OmuxNET.send_receive(address=4,command=33,{‘positions’: 15})
OmuxNET.build_packet(address=4,command=33,{‘positions’: 15})
OmuxTTY.write(pkt=>04f000FA0)
OmuxTTY.read(n=20)
OmuxNET.process_response(command=33,rsp=A000000000000000000)
OmuxNET.optomux_data_to_tuple(data=0000000000000000,bits=16)
(‘A’, (0, 0, 0, 0))
>>> on.trigger_on_positive_pulse(4,15)
OmuxNET.trigger_on_positive_pulse(address=4,positions=15)
OmuxNET.send_receive(address=4,command=29,{‘positions’: 15})
OmuxNET.build_packet(address=4,command=29,{‘positions’: 15})
OmuxTTY.write(pkt=>04b000F9C)
OmuxTTY.read(n=2)
OmuxNET.process_response(command=29,rsp=A)
(‘A’, 0)
utl.stop_logging()
logging stopped
>>> on.start_on_pulse(0,15,50)
(‘A’, 0)
>>> on.read_pulse_complete_bits(4)
(‘A’, (1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
>>> on.read_and_clear_pulse_duration_counters(4,15)
(‘A’, (499, 500, 499, 500))