Jump to content
OMRON Forums

DemoBox_4X.PowerPmacSuite_sln Question?


dzrong

Recommended Posts

I have a question in the DemoBox_4X.PowerPmacSuite_sln example in the PPmac IDE. In the pp_proj.h file there are some definition, one of these is '#define mypvar1 8193'. What is it mean? And what the 8193 mean? And in the 'demo box defines.pmh' file there is other definition is 'global mypvar1'. Why is this declared name as the same as the pp_proj.h one? Thanks, Rodder
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

The pp_proj.h is a header file generated by pp_proj software. Upon downloading of a project from IDE to Power PMAC, all the Global, CSGlobal and Ptr variable definitions in [b]Project/PMAC Script Language/Global Includes/global definition.pmh[/b] file will be parsed and based upon that pp_proj.h is created. Now, why does this need to happen? Although the script PLCs and Programs can access the Global, CSGlobal and Ptr variables just by name, the C applications and CPLCs need to access them through API calls such as GetGlobalVar() and SetGlobalVar(). The argument passed to these APIs using the pp_proj.h header file. When using API calls, user simply uses the same variable name defined in the global definition.pmh file, but before compilation of the CPLCs or Background C programs, these names will be replaced with a number indicating their place holder in the variable table. The number 8193 is the place holder for your variable. If you right click the project in the Solution Explorer and select properties, you'll see a window like this: [attachment=1372:name] This is where you define what the starting number should be for assignment of Global, CSGlobal and Ptr variables. Since the default is 8192, you got a 8193 for your second defined variable.
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...