Jump to content
  • 0

DigitalIn_ScanScreen index error



When running DigitalIn_ScanScreen.py  (waveformsSDK sample script) I got the following error. 

line 95, in <module>
rgb[i] = c + 0.8*((rgSamples[i]>>c)&1)
IndexError: invalid index


Does anyone know how to fix this? 

Edited by lauren1
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi @lauren1, welcome to the forums.

The index into either the rgb array or the rgSamples array is exceeding the size of the array. The index is limited by the number of valid samples in the acquisition buffer, which ought to be less than the size of the buffer. FDwfDigitalInStatusSamplesValid is presumably returning a nonzero value for the error to be showing up at all, so it seems like some data has been acquired. Presumably, a device is getting opened since you aren't getting stopped around line 40.

A couple of questions that might help me reproduce:

Have you made any modifications to the example? What version of python are you using, and what hardware are you using? What version of WaveForms?



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