Jump to content

kevin vannorsdel

Members
  • Posts

    20
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

kevin vannorsdel's Achievements

Member

Member (2/4)

2

Reputation

  1. OK this code seems to work- wow... finally. - Thank you! def read_din_pin(handle, dio_pin): val = ctypes.c_longlong() dwf.FDwfDigitalIOStatus(handle) dwf.FDwfDigitalIOInputStatus64(handle, ctypes.byref(val)) return (val.value >> 16+dio_pin) & 1
  2. Actually, I was wrong. This above code does not work. It reads just the DIO lines I guess... not the DIN lines. So I still have no idea how to do the simplest thing with this digitial discovery... read in the logic level applied to DIN 0.
  3. The documentation in the SDK pdf is not very clear but I believe this works: def read_din_pin(handle, dio_pin): val = ctypes.c_uint32() dwf.FDwfDigitalIOStatus(handle) dwf.FDwfDigitalIOInputStatus(handle, ctypes.byref(val)) return (val.value >> dio_pin) & 1 I wish I understood what this function does: dwf.FDwfDigitalIOStatus(handle) I also dont understand why dwf.FDwfDigitalIOInputStatus() returns a 32 bit value - when there are a total of 40 pins in the digital discovery. Shouldnt I need to use the 64 bit function? I also dont understand why I am using an IO funciton here to read the "input" pins. I thought the IO functions were for the IO pins 24 -> 39 So many questions.
  4. @attila, are you saying the digital-io functions can be used on pins 0-23 of the digital discovery? I don't think you are saying that but I am not sure exactly what you are saying... can you please clarify? I have not yet found an example for basic reading of the digital input pins 0-23 in any of the example directories...
  5. I want to programmatically read the value from Digital input pin 0 ... I dont need any fancy recording or logging or triggering... I just want to query pin 0 and see if it is high or low. How is something this simple done? Not sure why I cannot find something this simple as an example or in the docs. I am probably overlooking it. Thanks!
  6. Yeah, sorry I mentioned 27 twice. that was a mistake. Thanks.
  7. Thanks for the response. I guess I see what you are saying. I think when you said: "I suppose you wanted to say to control DIO 24 and 29 from digital-io" by "digital-io" you are referring to the Digital I/O functions mentioned in section 8 of the SDK ref manual? I sure wish I knew what this paragraph actually means: The digital IO signals are shared in the device between Digital-IO, Out and In functions. The Digital-IO has priority over Digital-Out. The Digital-Out is only applied for a signal when the Digital-IO Enable and Output are zero for the respective bit. Especially this last sentence. it makes almost no sense to me. Can you clarify what this means by chance?
  8. Still confused, let's say I want to control DIO 24 and DIO 27 as software controlled digital outputs and DIO 25,26 and 27 used by the nice pattern generator logic. How do I control these sort of "independant" digital output lines 24 and 27 while leaving the ones in between those alone? It seems complicated but I just want a python function that can write a 0 or 1 to any single output line at will. Thanks!
  9. All I want to do is independently control output pin 24 and output pin 29. Something like this: Set_output_pin_24(1) Set_output_pin_29(0) Set_output_pin_24(0) I don't want to use any fancy pattern generator or anything like that. Just basic software controlled digital output using PYTHON. I dont see an example for how to clearly do this. Can you advise? Thanks!
  10. Thanks for the response @attila, I am trying to understand how many bits wide the divider and the counter are. Where can I find that out? Thanks!
  11. The SDK document says this: The initial values, for divider and counter, specify the initially loaded values, initial delay, when entering in Running state. The Divider specifies the clock division. This rate will be the custom sample frequency and step for the counter. When entering Running state, the initial value specified with FDwfDigitalOutDividerInitSet is loaded. When this expires, the value specified by FDwfDigitalOutDividerSet will be loaded upon each expiration. The block diagram also shows the word "Expire" in a few places. When do expirations happen? In other words... when does the INITIAL DIVIDER transition to the Other DIVIDER... ? Thanks!!!
  12. Sorry, I copied in the wrong function and meant to ask about FDwfDigitalInTriggerPositionSet() so thank you for anticipating and answering that. :) Where can we find documentation on the use of these functions in sync mode? The SDK PDF doesn't seem to include much about it that I have found. Is it just the example scripts that show how its used? Thanks!!!
  13. HI @attila, does this mean that for format=8 it actually clocks in 16 bits- DIN[7-0] AND DIO[31-24] ?
  14. Can you comment on the function FDwfAnalogInTriggerPositionSet() when using sync mode (where the trigger becomes a clock used for sampling data in)? It seems based on the examples that perhaps this becomes a count of samples but it is not spelled out as such in the SDK reference manual. I need to understand a little more about sync mode and this is the first step. THANK YOU!
×
×
  • Create New...