Jump to content

Citronjack

Members
  • Posts

    2
  • Joined

  • Last visited

Citronjack's Achievements

Newbie

Newbie (1/4)

0

Reputation

  1. Hi @attila, thank you for your answer, it helped me out. Another question though. I want to generate a pattern that look like the signals below, they should repeat every 6ms. The time both the ACT and SEND signal are not zero is called Tact=0.2ms. The ACT signal should alternate with a frequency of 21kHz. I created 2 arrays and loaded the ACT and SEND values into them respectively. sendSignal = (c_double*samples)() actSignal = (c_double*samples)() What seems to be the problem right now, is to find the correct values for the runTime, waitTime and the divider. I am not sure how to select them and my trial and error approach was not successful. I want to generate 8 different ACT and SEND signal pairs, i.e. use all 16 GPIOs. Later on, I want both the ACT and SEND signal pair to have a specific delay in the range from 0 to 350ms. The maximum Tact=400ms. So I am thinking to define the signals for 1ms and then wait for the remaining 5ms. dwf.FDwfDigitalOutRunSet(hdwf, c_double(runTime)) dwf.FDwfDigitalOutWaitSet(hdwf, c_double(waitTime)) FDwfDigitalOutDividerSet(hdwf, c_int(0), c_int(signalDiv)) Also, in the GUI I can set a frequency value, I did not find how to manipulate it
  2. Hi there, I am currently working on generation patterns with the AD2. I am using python. I closely looked at the example. Among other functions it calls: rgdSamples = (c_double*cSamples)() dwf.FDwfAnalogOutNodeDataSet(hdwf, channel, AnalogOutNodeCarrier, rgdSamples, cSamples) The maximum for cSamples seems to be 1024, even though in the GUI I can select a value up to 8192, why is that? (I did adjust the length of rgdSampleTmp) Also, if I just setup up the rdgSamples, I cannot observe an output, I had to find a work around using bytearray and then creating a ctype. I did not find a clear explanation why that is. rgdSampleTmp = bitstring.BitArray( '0x' '0000000000000000000000000000000000000000000000000000000000000000' 'FFFFFFFFFFFFFFFFFFFFFF0000000000000000000000' '0000000000000000000000FFFFFFFFFFFFFFFFFFFFFF' 'FFFFFFFFFFFFF0000000000000000000000000000000' '00000000000000000000000000000000000000000000' '0000000000000000') # 256 bytes --> 1024 bit ba = bytearray(data.bytes) rgdSample = (c_uint8 * len(ba)).from_buffer(ba) Thank you very much for reading this and trying to help out, I am available for further questions. Have a nice day!
×
×
  • Create New...