Hi, Andrea
According to the documentation I found here: https://groups.frib.msu.edu/controls/files/devSnmp.html in the topic set_type you need to set the type of the variable that
you are getting. 'i' for integer, 'f' for floating point, 's' for string.
An example record that I got from one IOC:
record(ai, "$(P)$(R)InputVoltage$(CH)-R") {
field(DESC, "Present input voltage in channel $(CH)")
field(EGU, "RMS V (AC)")
field(DTYP, "Snmp")
field(SCAN, ".5 second")
field(PREC, "1")
field(INP, "@$(HOST) $(COMMUNITY) UPS-MIB::upsInputVoltage.$(CH) INTEGER: 100 i")
}
Maybe that helps? I'm not sure.
Cheers,
Marco
Dear colleagues,
I have a device that can be programmed using SNMP (Wiener MPOD crate).
A typical reply to the command:
snmpget -v 2c -m +WIENER-CRATE-MIB -c guru 10.152.72.10 outputVoltage.u0
Looks as:
WIENER-CRATE-MIB::outputVoltage.u0 = Opaque: Float: 0.000000 A
Where, as you see, the device replies with the number (0.0000) containing also units (A)
My record to read this is:
record(ai, “wienerCh0:v")
{
field(DESC, “Voltage")
field(DTYP, "Snmp")
field(SCAN, "$(SCAN)")
field(PREC, "3")
field(EGU, “V")
field(INP, “@10.152.72.10 guru WIENER-CRATE-MIB::outputVoltage.u0 Float: 100")
field(ADEL, "1.0")
}
If I execute my IOC, I get the error:
2025/03/06 15:00:49 devSnmp AI read error 'wienerCh0:v' : epicsScanDouble failed on '5.000000 V'
As if the IOC is not able to parse the “Volt” units. And indeed, the PV is not properly populated:
caget wienerCh0:v
wienerCh0:v 0
May I ask you if any of you also faced this issue?
Thanks,
Andrea