[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [EnergyPlus_Support] using macro to concatinate zoneprefix to variable name





Hi, jean
 
The parameter names in the square bracket must be unique.   More of the same name does not make sense.
===========================
##def  CO2_EMS_FOR_ZONES [ mmZone ]

EnergyManagementSystem:GlobalVariable,
#EVAL[ CO2_EMS_FOR_ZONES [ mmZone ] // _CurrentCO2Concentration ],
#EVAL[ CO2_EMS_FOR_ZONES [ mmZone ] // _CurrentCO2SP ],
#EVAL[ CO2_EMS_FOR_ZONES [ mmZone ] // _CurrentDamperPos ];
#enddef
=========================
 
 
 
CO2_EMS_FOR_ZONES [Zone1]
 
should give you:-
 
EnergyManagementSystem:GlobalVariable,
Zone1_CurrentCO2Concentration,
Zone1_CurrentCO2SP,
Zone1_CurrentDamperPos ; 
 
When using a MACRO just before a 'semicolon',  add a space before the semicolon to indicate the end of the macro.  Otherwise, the semicolon may be part of the macro name and not recognized for expansion.
===========================
 
If you want the substitution to come out as zonex, zoney and zonez, then
=============================
##DEF CO2_EMS_FOR_ZONES [ mmZone1 ,mmZone2 ,mmZone3   ]
New example,
    mmZone3,
    mmZone2 ;
 
##enddef
=========================
The macro call  line below illustrate that the name is substituted in whole.  The numbering in the macro definition  need not be the order of the paraters.

CO2_EMS_FOR_ZONES [ Zone10, Zone100, Zone0 ]
 
would expand to:-
=====================
New example,
Zone0,
Zone100 ;
 
===================
 
 

 Dr. Li  

 

To: EnergyPlus_Support@xxxxxxxxxxxxxxx
From: jeannieboef@xxxxxxxxx
Date: Thu, 15 Sep 2011 09:57:18 +0000
Subject: [EnergyPlus_Support] using macro to concatinate zoneprefix to variable name

 
Can anyone give me a small example of using the #eval and // to concatinate ZoneName with "otherVariable" in a #set1 or #def declaration?

Something like:

##DEF CO2_EMS_FOR_ZONES [ mmZone,mmZone,mmZone,mmZone,mmZone,mmZone,mmZone,mmZone,mmZone,mmZone ]

EnergyManagementSystem:GlobalVariable,
#EVAL[ CO2_EMS_FOR_ZONES [ mmZone ] // _CurrentCO2Concentration ],
#EVAL[ CO2_EMS_FOR_ZONES [ mmZone ] // _CurrentCO2SP ],
#EVAL[ CO2_EMS_FOR_ZONES [ mmZone ] // _CurrentDamperPos ];




__._,_.___


Primary EnergyPlus support is found at:
http://energyplus.helpserve.com or send a message to energyplus-support@xxxxxxxx

The primary EnergyPlus web site is found at:
http://www.energyplus.gov

The group web site is:
http://groups.yahoo.com/group/EnergyPlus_Support/

Attachments are currently allowed but be mindful that not everyone has a high speed connection.  Limit attachments to small files.

EnergyPlus Documentation is searchable.  Open EPlusMainMenu.pdf under the Documentation link and press the "search" button.




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___