Signal Conditioning

cancel
Showing results for 
Search instead for 
Did you mean: 

SCAN_Op returns one less sample than expected.

I'm acquiring data from a SCXI chassis using a WinXP P4 computer. Sometimes when I run my app, SCAN_Op returns one less sample than it should. Looking at the data array, it appears that one sample is missing down in the array where there should be a reading from the first channel. The rest of the readings are all shifted up by one and the first of these is garbage. The rest are correct. This only happens some of the time, but when it does, it happens no matter how many modules I'm using in the chassis (I've tried up to three at once). It also happens using just one high voltage module, As a result, the data I send to SCAN_Demux is incorrect and comes out scrambled. I've checked my inputs to the function repeatedly and am confid
ent they are correct. I am in debug mode when this happens. So far, I haven't seen it happen in release mode. Has anyone seen this condition?
0 Kudos
Message 1 of 2
(2,761 Views)
Hello,

I am not sure exactly what could be causing this problem. However, we could try something.

Try allocating your memory as an i32 array that is half the size of the array that you want. This will force memory to be allocated slightly differently. Then just typecast your array whenever you need to use it.

I know this has fixed some alignment issues in the past.

Let us know if this does not work.

Best regards,

Justin T.
National Instruments
0 Kudos
Message 2 of 2
(2,761 Views)