-2

I actually need to create an instance on Siemens PLCSim Advanced (a virtual network simulator) and I need to use :

using Siemens.Simatic.Simulation.Runtime;

void button1.click()
{
IInstance myInstance = SimulationRuntimeManager.RegisterInstance("nameOfYourInstance");
myInstance.PowerOn();
}

but I don't know what is the reference name that I need to add. I need your help if you know.

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jul 07 '22 at 12:45

1 Answers1

-1

You would need to add reference to Siemens.Simatic.Simulation.Runtime.Api.x64.dll. It includes the namespace and classes you need to run simulation.

Siemens provides documentation in the PDF file here: SIMATIC S7-PLCSIM Advanced. Section 2.2 of this document help with Visual studio integration. In case the URL goes stale, here is the part relevant to this question.

Programming in Visual Studio

Danish
  • 136
  • 5
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/low-quality-posts/32195018) – Saeed Zhiany Jul 08 '22 at 07:12
  • @SaeedZhiany why do you think it does not provide answer? OP asked for reference to include to use the classes in code snippet and this is precisely it. I do not see seeking clarification either anywhere in my response. Are you sure you added comment to right post? – Danish Jul 08 '22 at 07:53
  • because it is not clear how it should be done and may the OP or future users that will read your answer may don't know how they should apply your answer to make it work. your current answer seems like a comment to me (you're considering the OP knows completely what you are talking about). Please read [How do I write a good answer?](https://stackoverflow.com/help/how-to-answer). – Saeed Zhiany Jul 08 '22 at 07:58
  • @SaeedZhiany fair enough. I expect OP to know how to add reference since they are already writing code which is fairly complicated that adding a reference. – Danish Jul 08 '22 at 09:10
  • @SaeedZhiany Added more details about the simulation library – Danish Jul 08 '22 at 09:18