lauren1 Posted February 22, 2023 Share Posted February 22, 2023 (edited) 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 February 22, 2023 by lauren1 Link to comment Share on other sites More sharing options...
0 artvvb Posted February 24, 2023 Share Posted February 24, 2023 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? Thanks, Arthur Link to comment Share on other sites More sharing options...
Question
lauren1
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 lauren1Link to comment
Share on other sites
1 answer to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now