plugins/python/plc_python.c
changeset 483 bc26c42d2eec
parent 454 fd316d2babd5
child 613 be0ceea3b6dd
equal deleted inserted replaced
482:7c83eb6a55bd 483:bc26c42d2eec
   155 char* PythonIterator(char* result)
   155 char* PythonIterator(char* result)
   156 {
   156 {
   157 	char* next_command;
   157 	char* next_command;
   158 	PYTHON_EVAL* data__;
   158 	PYTHON_EVAL* data__;
   159 	//printf("PythonIterator result %%s\n", result);
   159 	//printf("PythonIterator result %%s\n", result);
       
   160     /*emergency exit*/
       
   161     if(PythonState & PYTHON_FINISHED) return NULL;
   160 	/* take python mutex to prevent changing PLC data while PLC running */
   162 	/* take python mutex to prevent changing PLC data while PLC running */
   161 	LockPython();
   163 	LockPython();
   162 	/* Get current FB */
   164 	/* Get current FB */
   163 	data__ = EvalFBs[Current_Python_EvalFB];
   165 	data__ = EvalFBs[Current_Python_EvalFB];
   164 	if(data__ && /* may be null at first run */
   166 	if(data__ && /* may be null at first run */