Jump to content
  • 0

Triggering on threshold


Loic VINET

Question

Hello

I am using a digital discovery device.

in a python program, I would like to trigger on a threshold value. Assuming I am using the 12 first bits, dio 0 to 11, I would like to trigger as soon as I have a value greater than a value between 0 to 4095 = (1<<12)-1.

I tried dwf.FDwfDigitalInTriggerSet(hdwf, c_int(threshold), c_int(4095), c_int(4095), c_int(0)), but it is not working.

First, is it possible to trigger on threshold?

Second, how should I do it?

Thank you

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hi @Loic VINET

A 12bit bus value range is 0 to 4095. It can't be greater than 4095.

To trigger on 4095 you can use:
dwf.FDwfDigitalInTriggerSet(hdwf, c_int(0), c_int(0xFFF), c_int(0), c_int(0))

To trigger on 2048-4095:
dwf.FDwfDigitalInTriggerSet(hdwf, c_int(0), c_int(0x800), c_int(0), c_int(0))

To trigger on 3840-4095:
dwf.FDwfDigitalInTriggerSet(hdwf, c_int(0), c_int(0xF00), c_int(0), c_int(0))

image.png

Link to comment
Share on other sites

  • 0

Hello Attila,

I tried your solution, but it didn't work for me.

Let me explain what I did:

I have a clock signal from DIO out 24 to DIO in 8, when I trigger with dwf.FDwfDigitalInTriggerSet(hdwf, c_int(0), c_int(0), c_int(1 << 8), c_int(0)), it works.

Now I want to trigger on threshold, that is to say as soon as I have a value greater than 100 for example, since c_int(1 << 8) = c_long(256), I tried dwf.FDwfDigitalInTriggerSet(hdwf, c_int(0), c_int(100),  c_int(0), c_int(0)), but it doesnt trigger.

Do you know why?

Regards

Link to comment
Share on other sites

  • 0

Hello Attila,

I tried your solution, but it didn't work for me.

Let me explain what I did:

I have a clock signal from DIO out 24 to DIO in 8, when I trigger with dwf.FDwfDigitalInTriggerSet(hdwf, c_int(0), c_int(0), c_int(1 << 8), c_int(0)), it works.

Now I want to trigger on threshold, that is to say as soon as I have a value greater than 100 for example, since c_int(1 << 8) = c_long(256), I tried dwf.FDwfDigitalInTriggerSet(hdwf, c_int(0), c_int(100),  c_int(0), c_int(0)), but it doesnt trigger.

one more thing, I am using a 16-bit bus, but I want to trigger only within DIO in  (0 to 11) with a threshold

Is it possible?

Regards

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...