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?
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:
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.