I’m putting together an application in vb that uses the Memmap functions. The Opto is an EB1, ENET
On reading a min and max analog value, I’m having trouble.
I’ve got a grid view that is regularly updating and getting the values of the analog inputs, and I have a button that runs this:
[I] Dim intResult, intOffset As Integer
Dim sngValue, msngAnalogMinValue As Single
Dim mBrain As New OptoSnapIoMemMapXLib.OptoSnapIoMemMapX
intOffset = &HF01D4000 + (gclsOpto.ainpSupplyPressure.ModuleNumber * 768) + (gclsOpto.ainpSupplyPressure.ChannelNumber * 12)
intResult = mBrain.ReadFloat(intOffset, sngValue)
msngAnalogMinValue = sngValue
gstrOptoStatus = GetResultAsString(intResult)
AnalogDisplayBox.Text = msngAnalogMinValue.ToString[/I]
The value returns 0 and the intResult gets a -9
Alternatively, I tried avoiding the ReadFloat option in favor of a function made to read min and maxes
[I]Dim intResult, intOffset As Integer
Dim sngValue, GetAnaPtMaxValue As Single
Dim mBrain As New OptoSnapIoMemMapXLib.OptoSnapIoMemMapX
intResult = mBrain.GetAnaPtMaxValue(gclsOpto.ainpSupplyPressure.PointNumber, sngValue)
GetAnaPtMaxValue = sngValue
gstrOptoStatus = GetResultAsString(intResult)
AnalogDisplayBox.Text = GetAnaPtMaxValue.ToString[/I]
Again, 0 value and int result is -9.
The addresses and points are perfect.
anybody got any ideas? I can answer questions, I think. I’m kinda new to both Opto and Vb
Thanks,
Tony