Simulation/Testing


#1

Is it possible to read the digital and analog IVals using the OptoMMP2 .NET SDK? I have a strategy running simulations in an R2 without any actual I/O modules.

I usually have a variable in the strategy (e.g. DEBUG). If that variable is on at startup, I disable communications to all IO Points and all external IO Units. Then I start a Simulation chart which runs continually. The Simulation chart sets various digital and analog points using the built-in simulation methods. The other charts run normally.

It runs fine in the R2, everything updates as it should. Problem is I’m using a c# program on my computer as the HMI and it’s not seeing the correct state of the digital and analog I/O. Does the library read the XVals only? Is there a way I can set it to give me the IVals instead?

Thanks.


#2

You can get the IVAL by using the Controller SDK => http://www.opto22.com/site/pr_details.aspx?cid=1&item=PAC-DEV-CONTROLLER-DOTNET

It can read strategy values as well. I think you can only get IO values by setting up a group read which is more difficult than it should be when you only need one value.


#3

Thanks. I didn’t even know about the controller SDK until very recently. I’m pretty excited about it.

One other thing, does anybody know if the PAC Sim responds to requests on port 2001, like the brains and controllers? I can’t connect to it using my program or with PAC Manager.


#4

PAC Sim doesn’t have an IO unit, only a controller - so just 22001 by default. Since there is no IO unit or scratchpad or anything, PAC Manager won’t talk to it either. You can use Soft PAC if you want all that if you have the pro edition.


#5

Just to clarify, and likely state the obvious, when Philip mentions SoftPAC is available in the Pro edition, that’s [B]PAC Project Professional.[/B] You can also buy [B][URL=“http://www.opto22.com/site/pr_details.aspx?cid=1&item=SOFTPAC”]SoftPAC[/B] as an individual product.

David


#6

Hi All,
As Philip mentions, SoftPAC (but not PAC Sim) has SOME basic mem map support in it, such as the Scratch Pad addresses. But there’s also this lesser-known (free!) [U][B]OptoMMP Server option[/B][/U] – not sure if/how you could use this but since we’re talking about simulations and .NET and SDK’s here I figured I’d mention it for you power-users!
-OptoMary