Hi all,
Is there a way in transition_to_buffered for users to send a command to a device like Arduino at a specific clock time?
For example, if I've already implemented in generate_code(), storing which command I want to send at a specific clock tick:
command_data = [time0_send_command0, time1_send_command_1, ...]
Then in transition_to_buffered(), I can read in this "command_data" from the decoding the compiled hd5 file. And I can iterate through this "command_data" to send command to the Arduino. But what I don't understand is, doesn't transition_to_buffered() just send commands to the Arduino without caring about the clock ticks? Since there seems no clock information being passed to transition_to_buffered(), how does transition_to_buffered() know when to send a command to Arduino?
A related example to this question is the transition_to_buffered() in labscript_devices.NovaTechDDS9M.
# Now program the buffered outputs:
if table_data is not None:
data = table_data
for i, line in enumerate(data):
for ddsno in range(2):
self.connection.write(b't%d %04x %08x,%04x,%04x,ff\r\n'%(ddsno, i,line['freq%d'%ddsno],line['phase%d'%ddsno],line['amp%d'%ddsno]))
From my understanding, what this code does is to read the data which contains a series of output commands, and the program will iterate through every one of them and send the commands to a device. But I don't see why this will allow the NovatecDDS to output a specific value at different times since the program will just iterate through all commands once it sees those codes.
This question has been crowed me for a while and I now seek a chance to understand it. Thank you!
Best,
Lufter