Jump to content
OMRON Forums

P variable value on power up


steveneads

Recommended Posts

Could someone clarify what the value of a P variable (global) is on power up? In UMAC it was whatever had been saved in flash.

 

Is it simply a random undefined value unless it has explicitly set in a file such as global definitions.pmh or PLC 1?

 

I've had some issues where "nan" and "inf" have appeared in globals, and I suspect that it's because I've not initialised everything that I need to at power up.

 

If I do need to make sure that key variables are explicitly initialised, is there an easy way to do this for arrays, so that I don't need to use a loop or add loads of lines, ie something like:

 

global Xvalue(100) = 0;

 

Maybe it's in the manual somewhere - but I didn't spot it!

 

Thanks

Steve

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

In Power PMAC, “global”s (and “csglobal”s) are not saved. Note that “sys.P” is described under “Sys. Global Non-Saved Setup Data Structure Elements”. A “global” (valid P-variable) should never return “nan” unless explicitly assigned by user startup code. These are initialized to zero by the firmware on reset.

 

Initializing array elements will require individual assignment, or some type of looping mechanism.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...