10-19-2009 03:57 PM
Hi,
I have a relatively large data structure that I am passing to TestStand which contains different types of scalars, arrays, and other structures including unions. I was wondering how I would define a union or bit field in TestStand so that I can access the individual elements of the union.
typedef struct BINCODES
{ // BINCODES
unsigned char current:1, // 1 Max or min exceeded
programming:1, // 2 Readback <> written. NOTE:!!!!! Readback on A4 is faulty and should not be binned on.
code_range:1, // 4 Outside normal range
convergence:1, // 8 Failed to converge after 4 fine sensitivity rounds.
off_axis:1, // 16 Off-axis sensitivity is too great.
self_test:1, // 32 Next version: self-test response is improper (too low or high)
ratiometricity:1, // 64 Next version: ratiometricity too high
soft_rst:1, // 128 Score too low.
temp_comp:1, // 256
alignment:1, // 512 Misalignment too great for pick and place.
vacuum_at_sckt:1, // 1024 Vacuum fault when picking or placing a part on the tray.
tip:1, // 2048 Stability of measurement is insufficient since reference measurement is not consistent.
vdd:1, // 4096 Vdd is not within expected range.
mux:1, // 8192 Mux failure.
final_offset:1, // 16384 Final offset is out of specification.
rail:1, // 32768 Railed part is not close enough to rails.
dig_vfy:1, // 65536 Digital and Analog values out of tolerance
comm:1, // 131072 I2C and SPI don't match
registers:1, // 262144 Failed register write test
interupt:1, // 524288 Failed Interupt test
retest:1, // 1048576 Failed retest
lost_part:1, // 2097152 Failed to identify chip based on RC and Codes.
oscillator:1, // 4194304 Oscillator failed to trim sufficiently.
humidity:1, // 8388608
EEPROM:1, // 16777216
PotFrit:1, // 33554432
ScanVect:1, // 67108864
b27:1, // 134217728
b28:1, // 268435456
b29:1, // 536870912
b30:1, // 1073741824
b31:1; // 2147483648
} BINCODES;
typedef union BIN_UNION
{
long fullcode;
BINCODES singlecode;
} BIN_UNION;
The BIN_UNION is buried inside another structure. I basically want to be able to set various bits based on the results from a step hopefully without having to use an accessor method in the DLL.
Thanks,
Mike