raptorsix
Electrical
- May 27, 2003
- 9
I am trying to debug some equipment and am really kind of new at c programming and wonder if anyone can help me with this. I kind of need to know what this if statement is doing.
/* Check the vial code from the change parts V1.05 */
if ((State == INIT_STATE) && (Command == CMD_INIT))
{
code = 0;
if (TestIo(DI_ProductCode0)) code = code | 0x01;
if (TestIo(DI_ProductCode1)) code = code | 0x02;
if (TestIo(DI_ProductCode2)) code = code | 0x04;
if (TestIo(DI_ProductCode3)) code = code | 0x08;
if (DEBUG) printf("Vial code is: %d\n", code);
DMC(&CurRecipe, DMC_READ_SINGLE);
if (DEBUG) printf("Recipe code is: %d\n", ProdCode[CurRecipe.User.VialType]);
DispatchAlarm(AlmPath, &Alarms[AL_VIAL_CODE_ERR], ProdCode[CurRecipe.User.VialType] != code);
}
It should be comparing a hard-wired code coming from some change parts with one set in a recipe.
Thanks,
raptorsix
/* Check the vial code from the change parts V1.05 */
if ((State == INIT_STATE) && (Command == CMD_INIT))
{
code = 0;
if (TestIo(DI_ProductCode0)) code = code | 0x01;
if (TestIo(DI_ProductCode1)) code = code | 0x02;
if (TestIo(DI_ProductCode2)) code = code | 0x04;
if (TestIo(DI_ProductCode3)) code = code | 0x08;
if (DEBUG) printf("Vial code is: %d\n", code);
DMC(&CurRecipe, DMC_READ_SINGLE);
if (DEBUG) printf("Recipe code is: %d\n", ProdCode[CurRecipe.User.VialType]);
DispatchAlarm(AlmPath, &Alarms[AL_VIAL_CODE_ERR], ProdCode[CurRecipe.User.VialType] != code);
}
It should be comparing a hard-wired code coming from some change parts with one set in a recipe.
Thanks,
raptorsix