Hello,
i tried to print out the values of located vars and normal vars in the run() function of the plc.c file, but I cant figure out how. The vars do not change their values during execution of the softplc.
Something like in the "and_logic_debug_located_vars":
printf("IX0.0 = %s\n", *__IX0_0? "TRUE" : "FALSE");
printf("IX0.1 = %s\n", *__IX0_1? "TRUE" : "FALSE");
printf("QX0.0 = %s\n", *__QX0_0? "TRUE" : "FALSE");
printf("\n");
//LOCATED
printf("INICIAR: %s\n", (BOOL)__GET_LOCATED(STD_RESSOURCE__INST0.INICIAR,)? "TRUE" : "FALSE");
// printf("INICIAR: %s\n", (BOOL)*STD_RESSOURCE__INST0.INICIAR.value ? "TRUE" : "FALSE");
printf("PARAR: %s\n", (BOOL)__GET_LOCATED(STD_RESSOURCE__INST0.PARAR,)? "TRUE" : "FALSE");
printf("LAMP: %s\n", (BOOL)__GET_LOCATED(STD_RESSOURCE__INST0.LAMP,)? "TRUE" : "FALSE");
printf("INICIAR: %s\n", *(BOOL*)__GET_VAR(STD_RESSOURCE__INST0.INICIAR,)? "TRUE" : "FALSE");
// printf("INICIAR: %s\n", (BOOL)STD_RESSOURCE__INST0.INICIAR.value ? "TRUE" : "FALSE");
printf("PARAR: %s\n", (BOOL)__GET_VAR(STD_RESSOURCE__INST0.PARAR,)? "TRUE" : "FALSE");
printf("LAMP: %s\n", (BOOL*)__GET_VAR(STD_RESSOURCE__INST0.LAMP,)? "TRUE" : "FALSE");
It seems like the printed valus are not correct.
Can anyone help with this problem?
Hello,
i tried to print out the values of located vars and normal vars in the run() function of the plc.c file, but I cant figure out how. The vars do not change their values during execution of the softplc.
Something like in the "and_logic_debug_located_vars":
// printf("INICIAR: %s\n", (BOOL)*STD_RESSOURCE__INST0.INICIAR.value ? "TRUE" : "FALSE");
printf("PARAR: %s\n", (BOOL)__GET_LOCATED(STD_RESSOURCE__INST0.PARAR,)? "TRUE" : "FALSE");
printf("LAMP: %s\n", (BOOL)__GET_LOCATED(STD_RESSOURCE__INST0.LAMP,)? "TRUE" : "FALSE");
// printf("INICIAR: %s\n", (BOOL)STD_RESSOURCE__INST0.INICIAR.value ? "TRUE" : "FALSE");
printf("PARAR: %s\n", (BOOL)__GET_VAR(STD_RESSOURCE__INST0.PARAR,)? "TRUE" : "FALSE");
printf("LAMP: %s\n", (BOOL*)__GET_VAR(STD_RESSOURCE__INST0.LAMP,)? "TRUE" : "FALSE");