Having modbus string problem

Ignition 7.5.6

Have a PAC3200 power meter with string data (2 x words/register) as per the manual.

Creating a sqltag with

[meter]1.HRS64001:54

Data via modbus driver trace

2:04:28 PM ReadHoldingRegistersRequest Received message: [ 07 EA 00 00 00 39 01 03 36 00 2A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 56 02 02 00 00 00 F6 00 00 00 01 01 00 1F ]

But it only shows * in the returned string.

I am a little concerned because there should be a serial number LQN111129200220 eg 4C 51 4E 31 31 31 31 … in here, that has been lost on the device (no longer displays on the device even after factory reset) . I did see it in the earlier traces, but it is now gone. The PAC3200 registers are read only, and my tag is read only, so there is no way this should have happened.

There are some non-printables in the return string here due to the way the device does the data eg the sequence 56 02 02 00 represents Version V220. You can only read the data as a 27 register chunk to load up the definition on this device so there is some post processing to be done.

A straight string field without the caveats of the above also fails to work [meter]1.HRS64028:32, in this case. Empty string returned in this case.

Can anyone shed some light.

.

I would expect the above to have returned empty string… I’m surprised you’re even getting a ‘*’. When reading Strings, the Modbus driver only appends bytes to the string until it encounters a null byte (0x0), and then it stops, regardless of length.

Thanks Kevin,

now I have a real problem…this device only allows a bulk read at that start address 64001 to get data out of the range of interest.

That is with a \0 strip in place there is no other way to get at the data using your server. I cannot do something like HR64001,HR64002…as ints and then reconstruct the data as the device will not respond with data except on a register 64001 request.

Is there any way one can a raw char read of modbus data, so that idiosyncratic devices such as this can be read.

I have also ascertained that string read is working for a proper ascii text range, but not the write.

i.e. [meter]1.HRS64028:32 is returning a 32 char string of spaces (0x20) into the OPC tag, but write does not work.

Regards

Tarek

There’s no such option right now. I’ll add this is as a feature request, but I’m not going to be able to get to it for a little while. We’re pretty busy with the “fallout” from the 7.6.0 release, among other things…

Thanks for your help,

I have a workaround using kepware. Kepware has the same string issue with the \0, but I can get around it by reading it as an array of type “word”

In ignition I can than get at it via OPCpathname.464001[54]@word, and then use a script to do the parsing into tags.

Tarek