Modbus address Scanner

I am having problems reading the data that my scanner takes, it is connected via MODBUS and in Ignition it tells me that it is connected but when trying to read it through a tag it is difficult for me to write its address.

The scanner is PowerScan 9500 Series.

This is the information that comes in the manual.

I tried like this but the tag reads it as ‘bad’
image

Try these addresses and see if anything changes:

  • [Scanner_RTV]HR242
  • [Scanner_RTV]1.HR242
  • [Scanner_RTV]1.HR4242
1 Like

I think i see your issue, you have a data type of string, but you are not using the right string addressing.

HRS FORMAT: HRS<Modbus address>:<length>
If it really is a string, try these but substitute ### with the actual length.

  • [Scanner_RTV]HRS242:###
  • [Scanner_RTV]1.HRS242:###
  • [Scanner_RTV]1.HRS4242:###
2 Likes

Thanks to your answers my tag no longer shows bad but now it only shows ‘0’ in the value, I have been testing but I don’t know what is the error in my addressing.

image
Value = 0

image
Value = ’ ’

The presence of sequence numbers in the address table suggests that you might have to perform some acknowledgement handshake (writes to other addresses) to get the next buffered item to show up. Link to the manual, please?

(A zero in the 16-bit register is a pair of null characters, so an empty string is expected at that point.)

1 Like

This is the manual:

OK. You do need a handshake. Also, you need to be looking for your scan data in the Fragment Data section, HRS9:450. After reading any particular scan/fragment combination, you need to echo HR5 & HR6 over to HR236 and HR237. That tells the scanner to load the next item, if already scanned, into the input buffer. (Input is to you, Output is to the scanner.)

{ See the fragmentation example on page 39. }

Also, if you expect to be scanning true binary data, you will not be able to use the HRS data type, as that expects encoded characters for string data, and stops on null values. To handle raw binary, you would read the 225 16-bit registers as a group, render them into a suitable buffer, and extract the raw bytes. Kinda’ ugly.

Man… this seems like something you could have a custom driver for in about a days work.

The modbus is just tacked onto the EtherNet/IP support. Same buffer and timing expectations. I already offer a driver for EtherNet/IP scanning. (:

I also have another driver that could handle the raw binary via system.device.rawModbus(). (:

Oooh! Maybe I should offer an HRB type in my Advanced Modbus Driver, with syntax like HRS but dealing with byte arrays. That would be rather easy.