Applies To:
  • CitectSCADA 1.00 1.01 1.10 1.11 1.20 2.00 2.01 3.00

Summary:
Question: Under some weird conditions, Citect runtime got into a state where no new form could be displayed. For example the PageSelect(), none of the trend calculators etc could be displayed. When ever one of these functions was called the hardware error "Invalid argument passed FormNew" was generated. When I restarted Citect all the forms worked. What is causing this problem? 

Solution:
This is caused when FormNew() called without a FormRead(). Then the next time you call FormNew() it will fail with the invalid argument passed hardware error as the previous form new is still pending. This can happen if you have a piece of cicode which calls FormNew() then does various checks which causes the cicode to give up or abort before it calls FormRead(). Once you get Citect into this state all FormNews will fail. If you have called FormNew() and you want to give up you should call the function FormDestroy() to remove the pending form.

In Citect for Windows version 3.00 and later if you call FormNew() and don't call FormRead() and then you call another FromNew() after 2 seconds the first form will automatically be destroyed.

 

Keywords:
 

Attachments