Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple EMS actuator : is it a bug? #10279

Closed
3 tasks done
qqq000feel opened this issue Oct 25, 2023 · 2 comments · Fixed by #10575
Closed
3 tasks done

Simple EMS actuator : is it a bug? #10279

qqq000feel opened this issue Oct 25, 2023 · 2 comments · Fixed by #10575
Assignees
Labels
Defect Includes code to repair a defect in EnergyPlus MediumComplexityApproved Used for subcontractor defect complexity requests

Comments

@qqq000feel
Copy link

qqq000feel commented Oct 25, 2023

slowheattest_2files.zip

Issue overview

I am studying simple EMS script.
(please take a look attached IDF file)

I have a problem with the 'program5' of EMS:Program class.

As you can see, I made very simple 'schedule value' actuator, named 'actuHeatsp'. It controls the Schedule:Constant object named 'heatsp'.

At the end of the 'program5' script, I set the actuator's value to 'newtemp' variable(global).

When I run the IDF file, there were no severe errors or EMS errors, but the actuator 'actuHeatsp' doesn't control the 'heatsp' schedule.
This simple line didn't work at all with my original EMS script : [ SET actuHeatsp = newtemp ]

However, I changed the line like this, the actuator started to work.
[ SET actuHeatsp = (newtemp+1)-1 ]

As you can see, the value is same with original script line. (+1-1 = 0)

Is this just a bug? or did I miss something?

Details

Some additional details for this issue (if relevant):

  • Platform : Windows11
  • Version of EnergyPlus : V23.1
  • Helpdesk ticket number : #16509

Checklist

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Defect file added (list location of defect file here)
  • Ticket added to Pivotal for defect (development team task)
  • Pull request created (the pull request will have additional tasks related to reviewing changes that fix this defect)
@jcyuan2020
Copy link
Contributor

This was confirmed to be still the case in v23.2 (Helpdesk ticket 16509). One additional note is that it does not need to be newtemp+1)-1 to make the difference---simply adding a bracket like SET actuHeatsp = (newtemp) would make the difference as well. So it looks that any kind of operation on the right side would have the effect.

@qqq000feel
Copy link
Author

This was confirmed to be still the case in v23.2 (Helpdesk ticket 16509). One additional note is that it does not need to be newtemp+1)-1 to make the difference---simply adding a bracket like SET actuHeatsp = (newtemp) would make the difference as well. So it looks that any kind of operation on the right side would have the effect.

Thanks. Your simple solution is nice.

@jmarrec jmarrec self-assigned this Jun 18, 2024
@jmarrec jmarrec added the Defect Includes code to repair a defect in EnergyPlus label Jun 19, 2024
jmarrec added a commit that referenced this issue Jun 19, 2024
jmarrec added a commit that referenced this issue Jun 19, 2024
…nnual simulation

```
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/EMSManager.unit.cc:2463: Failure
Value of: actuatorDirectErlVar.Value.TrendVariable
  Actual: true
Expected: false
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/EMSManager.unit.cc:2464: Failure
Expected equality of these values:
  0
  actuatorDirectErlVar.Value.TrendVarPointer
    Which is: 1
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/EMSManager.unit.cc:2475: Failure
Value of: actuatorIndirectErlVar.Value.TrendVariable
  Actual: true
Expected: false
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/EMSManager.unit.cc:2476: Failure
Expected equality of these values:
  0
  actuatorIndirectErlVar.Value.TrendVarPointer
    Which is: 1
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/EMSManager.unit.cc:2499: Failure
Value of: resultValueErlVar.Value.TrendVariable
  Actual: true
Expected: false
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/EMSManager.unit.cc:2500: Failure
Expected equality of these values:
  0
  resultValueErlVar.Value.TrendVarPointer
    Which is: 1
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/EMSManager.unit.cc:2536: Failure
In comparing enums of type 'EnergyPlus::DataRuntimeLanguage::Value', Expected equality of these values:
  DataRuntimeLanguage::Value::Number
    Which is: 1
  actuatorDirectErlVar.Value.Type
    Which is: 0
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/EMSManager.unit.cc:2540: Failure
Value of: actuatorDirectErlVar.Value.TrendVariable
  Actual: true
Expected: false
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/EMSManager.unit.cc:2541: Failure
Expected equality of these values:
  0
  actuatorDirectErlVar.Value.TrendVarPointer
    Which is: 1
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/EMSManager.unit.cc:2548: Failure
In comparing enums of type 'EnergyPlus::DataRuntimeLanguage::Value', Expected equality of these values:
  DataRuntimeLanguage::Value::Number
    Which is: 1
  actuatorIndirectErlVar.Value.Type
    Which is: 0
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/EMSManager.unit.cc:2552: Failure
Value of: actuatorIndirectErlVar.Value.TrendVariable
  Actual: true
Expected: false
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/EMSManager.unit.cc:2553: Failure
Expected equality of these values:
  0
  actuatorIndirectErlVar.Value.TrendVarPointer
    Which is: 1
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/EMSManager.unit.cc:2576: Failure
Value of: resultValueErlVar.Value.TrendVariable
  Actual: true
Expected: false
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/EMSManager.unit.cc:2577: Failure
Expected equality of these values:
  0
  resultValueErlVar.Value.TrendVarPointer
    Which is: 1
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/EMSManager.unit.cc:2582: Failure
Expected equality of these values:
  45.0
    Which is: 45
  schDirect.CurrentValue
    Which is: 18
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/EMSManager.unit.cc:2583: Failure
Value of: schDirect.EMSActuatedOn
  Actual: false
Expected: true
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/EMSManager.unit.cc:2584: Failure
Expected equality of these values:
  45.0
    Which is: 45
  schDirect.EMSValue
    Which is: 0
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/EMSManager.unit.cc:2585: Failure
Expected equality of these values:
  45.0
    Which is: 45
  schIndirect.CurrentValue
    Which is: 18
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/EMSManager.unit.cc:2586: Failure
Value of: schIndirect.EMSActuatedOn
  Actual: false
Expected: true
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/EMSManager.unit.cc:2587: Failure
Expected equality of these values:
  45.0
    Which is: 45
  schIndirect.EMSValue
    Which is: 0

```
jmarrec added a commit that referenced this issue Jun 19, 2024
Before the simulation, the Actuators in EvaluateStack would be assigned a Value naively, which means if it was assigned the result of a @TrendValue, it would set the TrendVariable to true

Once we get to the Simulation itself again, BeginEnvrnInitializeRuntimeLanguage is called, which resets the actuators to a Value with Type Null

In EvaluateStack, we go into a different block, because it now thinks it is a trendVariable
And the assignment for trend variable only sets Number, not Type, so Type stays Null, and the actuator is not actuating anything as a result.
Myoldmopar added a commit that referenced this issue Jun 25, 2024
Fix #10279 - Make sure that assigning the result of a TendVariable (eg @TrendValue) results in proper actuator behavior
@Myoldmopar Myoldmopar added the MediumComplexityApproved Used for subcontractor defect complexity requests label Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect Includes code to repair a defect in EnergyPlus MediumComplexityApproved Used for subcontractor defect complexity requests
Projects
None yet
4 participants