equal
deleted
inserted
replaced
97 s4o.print_integer(action_number); |
97 s4o.print_integer(action_number); |
98 s4o.print("];\n"); |
98 s4o.print("];\n"); |
99 s4o.print(s4o.indent_spaces + "UINT __nb_actions;\n"); |
99 s4o.print(s4o.indent_spaces + "UINT __nb_actions;\n"); |
100 |
100 |
101 /* transitions table declaration */ |
101 /* transitions table declaration */ |
102 s4o.print(s4o.indent_spaces + "BOOL __transition_list["); |
102 s4o.print(s4o.indent_spaces + "__IEC_BOOL_t __transition_list["); |
103 s4o.print_integer(transition_number); |
103 s4o.print_integer(transition_number); |
104 s4o.print("];\n"); |
104 s4o.print("];\n"); |
105 |
105 |
106 /* transitions debug table declaration */ |
106 /* transitions debug table declaration */ |
107 s4o.print(s4o.indent_spaces + "BOOL __debug_transition_list["); |
107 s4o.print(s4o.indent_spaces + "__IEC_BOOL_t __debug_transition_list["); |
108 s4o.print_integer(transition_number); |
108 s4o.print_integer(transition_number); |
109 s4o.print("];\n"); |
109 s4o.print("];\n"); |
110 |
110 |
111 /* last_ticktime declaration */ |
111 /* last_ticktime declaration */ |
112 s4o.print(s4o.indent_spaces + "TIME __lasttick_time;\n"); |
112 s4o.print(s4o.indent_spaces + "TIME __lasttick_time;\n"); |
126 s4o.print(";\n"); |
126 s4o.print(";\n"); |
127 step_number = 0; |
127 step_number = 0; |
128 wanted_sfcdeclaration = sfcinit_sd; |
128 wanted_sfcdeclaration = sfcinit_sd; |
129 |
129 |
130 /* steps table initialisation */ |
130 /* steps table initialisation */ |
131 s4o.print(s4o.indent_spaces + "STEP temp_step = {0, 0, 0};\n"); |
131 s4o.print(s4o.indent_spaces + "static const STEP temp_step = {{0, 0}, 0, 0};\n"); |
132 s4o.print(s4o.indent_spaces + "for(i = 0; i < "); |
132 s4o.print(s4o.indent_spaces + "for(i = 0; i < "); |
133 print_variable_prefix(); |
133 print_variable_prefix(); |
134 s4o.print("__nb_steps; i++) {\n"); |
134 s4o.print("__nb_steps; i++) {\n"); |
135 s4o.indent_right(); |
135 s4o.indent_right(); |
136 s4o.print(s4o.indent_spaces); |
136 s4o.print(s4o.indent_spaces); |
152 s4o.print(";\n"); |
152 s4o.print(";\n"); |
153 action_number = 0; |
153 action_number = 0; |
154 wanted_sfcdeclaration = sfcinit_sd; |
154 wanted_sfcdeclaration = sfcinit_sd; |
155 |
155 |
156 /* actions table initialisation */ |
156 /* actions table initialisation */ |
157 s4o.print(s4o.indent_spaces + "ACTION temp_action = {0, 0, 0, 0, 0, 0};\n"); |
157 s4o.print(s4o.indent_spaces + "static const ACTION temp_action = {0, 0, 0, 0, 0, 0};\n"); |
158 s4o.print(s4o.indent_spaces + "for(i = 0; i < "); |
158 s4o.print(s4o.indent_spaces + "for(i = 0; i < "); |
159 print_variable_prefix(); |
159 print_variable_prefix(); |
160 s4o.print("__nb_actions; i++) {\n"); |
160 s4o.print("__nb_actions; i++) {\n"); |
161 s4o.indent_right(); |
161 s4o.indent_right(); |
162 s4o.print(s4o.indent_spaces); |
162 s4o.print(s4o.indent_spaces); |
206 case sfcdecl_sd: |
206 case sfcdecl_sd: |
207 step_number++; |
207 step_number++; |
208 break; |
208 break; |
209 case sfcinit_sd: |
209 case sfcinit_sd: |
210 s4o.print(s4o.indent_spaces); |
210 s4o.print(s4o.indent_spaces); |
|
211 s4o.print(SET_VAR); |
|
212 s4o.print("("); |
211 print_variable_prefix(); |
213 print_variable_prefix(); |
212 s4o.print("__step_list["); |
214 s4o.print("__step_list["); |
213 s4o.print_integer(step_number); |
215 s4o.print_integer(step_number); |
214 s4o.print("].state = 1;\n"); |
216 s4o.print("].state,1);\n"); |
215 step_number++; |
217 step_number++; |
216 break; |
218 break; |
217 case stepdef_sd: |
219 case stepdef_sd: |
218 s4o.print("#define "); |
220 s4o.print("#define "); |
219 s4o.print(SFC_STEP_ACTION_PREFIX); |
221 s4o.print(SFC_STEP_ACTION_PREFIX); |