Help! Mondbus Conversion from Range Data


Recommended Posts

I am too new at Daqfactory and I haven't been able to find an answer in the forums here.

I'm connected to a Veris E30 multi-channel power meter. The E-30 uses Modbus RTU, and I have the point map for the E-30. It supplies a 16-bit integer as well as a 32-bit Floating point number for each reading, and for each power line monitored it can provide multiple readings: Power, Current, Voltage, Peak Power draw, etc.

For each integer value, there is also a scale register. The scale gives the order of magnitude for the measurement being read. So if the actual power being measured is 10 KWH, the integer register might contain 1000 and the scale register would contain -2. The conversion would be Value * 10^Scale or 1000 * 10^-2 = 10.

For different measurements, the scale register # is offset by the Integer register by some amount. In one case it is 112 less than the integer register #.

Is there a way I can create a formula to use in the conversion that will apply the scale factor for each measurement? I'm looking for some way to do this: Conversion = Value * 10^ Scale Value, where Scale Value is found at register (Value register# - 112)

Please help me, and explain it like you would to a really newbie, which I am!

Thanks,

Shep

Link to comment
Share on other sites

Actually, I don't think you could do this with a channel, not because a conversion can't handle it, but because you don't know what order the two registers are going to come in. More than likely, if the scale is second, it will actually get into the channel second which means that the conversion on the first channel would run before you got the latest scale value and instead use the last scale value. You then have two choices:

1) read the scale values ahead of the main value. Use the offset parameter for this. So if your value channel is Timing 1, set its offset to 0.1 and keep the scale channel at Timing 0, Offset 0. Then your conversion becomes: Value * 10^scale[0] where scale is the name of the scale channel. The problem with this is that DAQFactory can't really optimize your Modbus reads, and will probably have to do an individual query for each reading.

2) use script to poll the device, and then calc the result in script and push it into your channel using myChannel.addvalue(). This is the better way, but requires a script, which in itself has its benefits (more control) but requires more steps.

If bandwidth isn't a problem, try the first method.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.