.NET OptoMMP SDK

Hi,

I’m working with the latest .NET OptoMMP SDK (R3.0.7.0), and have some questions regarding the API:

public int ReadHighDensityDigitalState(int i32PointNumber, out bool bState);

Why is there not a complimentary Write method?

public int ReadHighDensityDigitalState(int i32Module, int i32Point, out bool bState);
public int WriteHighDensityDigitalState(int i32Module, int i32Point, bool bState);

The second parameter, i32Point, is misnamed; a channel number is required, not a point number. In addition, both methods check whether the value of i32Point is within the range 0-63. Shouldn’t the maximum allowable value be 31?

Thank you

1 Like

Welcome to the forums!

I agree with you, there probably should be a WriteHighDensityDigitalState method and the i32Point should be named i32Channel to be consistent with other methods. Hopefully Opto can fix this on the next version.

If you study the memory map a bit, you will find that they left the opportunity for 64 channel modules. This is probably why the SDK allows this.

Sometimes we use the names “point” and “channel” to mean the same thing (vs. a module). How do you use/interpret those? For the point/channel range, our high-density digital points currently support only 32 max, but we’ve left room for future expansion in there for up to 64.

What type of hardware are you using? SNAP-PAC-R or -EB?
I ask because, if you’re using a SNAP-PAC-R, you can skip the dlls and SDKs and just do an HTTP POST or GET to the RESTful API, which might simplify things in some cases, here’s an example w/an analog point:
http://developer.opto22.com/rest/pac/examples/read-a-point/

Looks like we have that Write method you expected in there:

If you’re still having trouble, don’t forget our support is free! (Best to reach them via email, support@opto22.com).

The other methods (that I looked at anyways) in the SDK use the term “channel”

Yes, but the Read has an overload that can take just the 0-511 HDD point #, the Write method does not have this overload.

You mean slot? :grin:

Yes! And do we start counting with a 0 or a 1, let’s not get going on that! :smile:

What happens when you can’t decide:

1 Like

Thank you both for your replies, i appreciate it.

I am working with a SNAP-PAC-EB2 Brain, so i must use the SDK. And that’s okay, it is not causing me problems. My intention was to point out some inconsistencies in the API, in the interest of improving it.

Thank you for the feedback. The corresponding write method has been added to the toolkit in version R4.0a. It is available here:
https://www.opto22.com/support/resources-tools/downloads/pac-dev-optommp-dotnet

I hope this helps you out. Thanks again.