CopperArc (Customer) asked a question.

BUG - ST IF NOT on an array element blocks transfer (Validate passes)

Productivity Suite 4.7.2.4, P1-550 CPU (also happens when transferring to the Simulator).

 

My project validated with no errors but wouldn't transfer. It stopped at 0% on the second stage with "P1-550: The project's files could not be generated." The message doesn't name a task or line, and Saving shows no error. A new, simple project transferred fine, so Suite, the PC and the connection were OK.

 

I tracked it to one line in a Structured Text task: an IF nested inside another IF, where the inner condition is NOT on a Boolean array element with a tag as the index. Rewriting that line as a compare (= FALSE) fixed it, and the project transferred to the Simulator and the PLC normally.

 

Test code to reproduce it is below, then the workaround.

 

 

  1. (* ---------------------------------------------------------------------- *)
  2. (* REPRO: transfer fails with "The project's files could not be *)
  3. (* generated." Validate passes. *)
  4. (* *)
  5. (* Create these tags first: *)
  6. (* RunTest Boolean *)
  7. (* IdxTag Integer 32 *)
  8. (* HitCount Integer 32 *)
  9. (* FlagArr Boolean array, 1-D, 10 elements *)
  10. (* *)
  11. (* Pattern: NOT on a Boolean array element with a variable index, as the *)
  12. (* whole condition of an IF nested inside another IF. *)
  13. (* ---------------------------------------------------------------------- *)
  14. IdxTag := 1;
  15. IF RunTest THEN
  16. IF NOT FlagArr[IdxTag] THEN
  17. FlagArr[IdxTag] := TRUE;
  18. HitCount := HitCount + 1;
  19. END_IF;
  20. END_IF;

Workaround (same logic, transfers normally)

 

  1. (* ---------------------------------------------------------------------- *)
  2. (* WORKAROUND: same logic, written as a compare instead of NOT. *)
  3. (* Validate passes and the project transfers normally. *)
  4. (* Same tags as the repro. *)
  5. (* ---------------------------------------------------------------------- *)
  6. IdxTag := 1;
  7. IF RunTest THEN
  8. IF FlagArr[IdxTag] = FALSE THEN
  9. FlagArr[IdxTag] := TRUE;
  10. HitCount := HitCount + 1;
  11. END_IF;
  12. END_IF;

 

 

 


  • kewakl (Customer)

    can confirm.

    Interesting, at line 16, if I change the pointer from 'IdxTag' to a constant 1, the project transfers.

  • ADC Community_02 (Automationdirect.com)

    Thanks for reporting this. We’ve identified the issue and a fix has been developed. It will be included in the next software release. We don’t have a release date to share yet, but we’ll update this thread when we do.