Azzera filtri
Azzera filtri

PLC Code out of a Stateflow -> Code in the State gets translated as comment..

3 visualizzazioni (ultimi 30 giorni)
Hi,
does anyone here can explaine to me why my Code in the state itself gets a comment if I generate the PLC Code? What Seetings do I need to change? (The "con_Hauptmenue=false;" in the Sate for example should get Structured Text Code in line 340 but gets a comment...)
Thank you for your help!
334 Chart_IN_Hauptmenue:
335 (* During 'Hauptmenue': '<S1>:1' *)
336 (* '<S1>:4:1' sf_internal_predicateOutput = bProgrammEinlernen ==true; *)
337 IF bProgrammEinlernen THEN
338 (* Transition: '<S1>:4' *)
339 (* Exit 'Hauptmenue': '<S1>:1' *)
340 (* '<S1>:1:7' con_Hauptmenue=false; *)
341 is_c3_Chart := Chart_IN_Programmname;
342 (* Entry 'Programmname': '<S1>:3' *)
343 (* '<S1>:3:3' con_Programmname=true; *)
344 ELSE
345 (* '<S1>:8:1' sf_internal_predicateOutput = bStandardPosen==true; *)
346 IF bStandardPosen THEN
347 (* Transition: '<S1>:8' *)
348 (* Exit 'Hauptmenue': '<S1>:1' *)
349 (* '<S1>:1:7' con_Hauptmenue=false; *)
350 is_c3_Chart := Chart_IN_Standard_Posen;
351 (* Entry 'Standard_Posen': '<S1>:7' *)
352 (* '<S1>:7:3' con_standardPosen=true; *)
353 ELSE
354 (* '<S1>:50:1' sf_internal_predicateOutput = bPoseNumerisch==true; *)
355 IF bPoseNumerisch THEN
356 (* Transition: '<S1>:50' *)
357 (* Exit 'Hauptmenue': '<S1>:1' *)
358 (* '<S1>:1:7' con_Hauptmenue=false; *)
359 is_c3_Chart := c_Chart_IN_Pose_numerischeE;
360 (* Entry 'Pose_numerischeEingabe': '<S1>:46' *)
361 (* '<S1>:46:3' con_PoseNumerischeEingabe=true; *)
362 (* '<S1>:46:4' poseErreicht==false; *)
363 ELSE
364 (* '<S1>:72:1' sf_internal_predicateOutput = bFernsteuerung==true; *)
365 IF bFernsteuerung THEN
366 (* Transition: '<S1>:72' *)
367 (* Exit 'Hauptmenue': '<S1>:1' *)
368 (* '<S1>:1:7' con_Hauptmenue=false; *)
369 is_c3_Chart := Chart_IN_Fernsteuerung;
370 (* Entry 'Fernsteuerung': '<S1>:71' *)
371 (* '<S1>:71:4' con_Fernsteuerung==true; *)
372 END_IF;
373 END_IF;
374 END_IF;
375 END_IF;

Risposte (1)

Ninad
Ninad il 21 Gen 2024
Hi Jannik,
I understand that you are trying to generate PLC code from a Stateflow chart in MATLAB and the code in the state itself getting translated as a comment.
According to the following MATLAB documentation, the "Comments" option in the PLC Code Generation pane of the Configuration Parameters dialog box controls whether comments are included in the generated code.
  1. This option is available on the PLC Code Generation > Comments pane in the Configuration Parameters dialog box.
  2. In the “Comments” section, select the “Off” option.
  3. Click the “Apply” button to save the changes.
  4. Generate the PLC code again and check if the issue is resolved.
Hope this helps.
Regards
Ninad

Categorie

Scopri di più su Simulink PLC Coder in Help Center e File Exchange

Prodotti


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by