Jump to content
  • 0

How to generate digital signals in "Patterns" using script?


sijie

Question

Right now I want to use the script to control the digital pins via patterns. The pins 0-4 corresponds to column decoders while pins 8-12 corresponds to row decoders. For instance, if the pins 0-4 have the values 00000, and pins 8-12 have 00001, it means that the component at column1 and row 2. I have a 32*32 array, so column and row has 5 bits respectively. I wanna do a sweep for the diagonal components, with each measuring time of 5ms. Could anyone please give some hint please? Thanks so much! Or some example code about how to use the script editor to control the "Patterns", I tried to refer to the "help" in digilent but errors such as "Can't find variable: Patterns" occur. Really appreciate your help!

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 1

Hi @sijie,

I'm slightly confused as to why you want to control the Patterns so that you can do a sweep with a set measurement time because the latter condition would imply that you are actually wanting to use the Logic Analyzer rather than Patterns, but regardless, the Script tool works based on the existing instruments that are already opened and the channels you want to manipulate enabled. Or put differently, the purpose of the Script tool is be an automated way to control some of the existing settings, such as frequency.

The error you are getting "Can't find variable: Patterns" is because you don't have the Patterns instrument open for the Script to manipulate. I like to have the line of

Quote

if(!('Patterns' in this)) throw "Please open the Patterns instrument";

just after my initial clear() line to help make sure that I have my workspace set up correctly.

Similarly, you'll also want to get each of the pins enabled in the Patterns instrument itself so that the Script tool can manipulate them.

An easy way to check what sort of things the Script tool can readily automate is by hovering over the setting you would want to change in the actual instrument itself; if you see the corresponding script command appear in the lower left corner, then that feature can be manipulated:

image.png

In the Script tool, you can also enable Code Completion from the Edit menu so that you can see what sort of variables are available. For example, if you have typed out Patterns.Channels. and then press CTRL+SPACE and your desired DIO0 does not appear in the menu, that is because you have not enabled DIO0 in the Patterns instrument. Here you can see that I only have access to DIO0, 8, 9, and 10 because that is all I have enabled in Patterns:
image.png

Let me know if you have any questions.

Thanks,
JColvin

Link to comment
Share on other sites

  • 0

Hi @JColvin

Thanks you so much for your help! I will look in greater detail. For your confusion, I think that logic analyzer is the tool to view and capture digital signals, and patterns is the one that generate the signal so that I could control the specific FET I wanna measure. Right now I can control the specific FET by generating the patterns digital signal manually, but how am I going to control the pattern to do the sweep automatically then? Thanks!

Link to comment
Share on other sites

  • 0

For your sweep of diagonal components, you'll want to iterate through your 32x32 array and set the corresponding pins accordingly. You can use nested loops for rows and columns, and adjust the values based on your timing needs. As for the error with "Patterns," it seems like a variable might not be defined or imported properly in your script.

Link to comment
Share on other sites

  • 0

Thanks everyone! Right now I am able to generate patterns to do sweep over the diagonal FETs. However, I met a weird situation that when I am measurint the Id-Vg curve for FETs using the sweep script, I cannot get the curve for some FETs, such as those from 0-15--those are just flat with current close to zero. But if I control patterns manually to verify, I find those FETs not working beforehand actually present ideal Id-Vg curves. What could be the difference here? I use "wait 1 " one second for my measurement. Really appreciate your help!

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...