Modbus Subroutines - Not 'Running'

This is our first time using an Opto22 ‘Modbus Subroutine’ - “O22Modbus04ReadInputRegistersAsInt”

We will be interfacing with a small Nanotec motor that will drive an Actuator, so we will need to send (write) various ‘Move’ commands to internal motor registers.

We have verified the ability to ‘R/W’ with the motor using a ‘Modbus Scanner’ program, this seems to work.

We are starting testing with an example ‘Modbus Communication’ Strategy from an Opto22 vendor and are assured the example Strategy works. We are using this Strategy for testing that our we can ‘R/W’ to the motor before adding logic into an existing larger Opto22 Strategy Project.

Some info on our setup and questions: (for starters)

Setup: SNAP-PAC-R2 running on Firmware r10.4d, using v10.5 PAC Control Basic (the final project will be using a SNAP-PAC-R1 ‘Gen2’ controller)

Questions: How can you tell if the ‘subroutine’ is running (similar to a Chart)? … The 7 parameters that are supposed to get ‘passed’ into the subroutine do not seem to be getting ‘passed’ … Continue to receive a ‘-216’ Timeout subroutine error … The Chart that contains the parameters to be passed is ‘Running’

Thanks

Dave W

         
           

The timeout tells you the subroutine is being called, it just isn’t receiving a response. Check your comm channel settings, or tells us how you have it set and what the device is configured for so we can verify if that is set correctly. Is it TCP or RTU?

phillip

thanks for the reply

We are trying to get Modbus RTU to work, we are trying to match the Nanotec Motor comm settings of a Baud Rate of ‘19200’ and Parity of ‘even’. The Comm Handle ‘chModbusMaster’ is set to ‘tcp:127.0.0.1:22500’. We are using an Opto22 ‘SNAP-SCM-485-422’ module (as this is what is used in the unit we are updating a new actuator), we have the module set up on ‘Port A’ 22500, the Baud Rate & Parity were setup using PAC Manager. We are currently testing using a SNAP-PAC R2 controller with Firmware of ‘R10.4d’, but the controller in the unit being upgraded will be using a SNAP-PAC-R1 Gen2.

This is first foray into the Modbus RTU communication, up till now we have been using simple serial communication to other motors, pumps, etc. using the SNAP-SCM-485-422 module.

This is also our first foray using the O22 Sub Routines. I noticed that we were working with a provided example strategy that was using the Sub Routine for ‘Read Input Registers As Int’. During our testing with a ‘modbus scanner’ tool, we were r/w to ‘Holding Registers.

Would a good step be to use the Sub Routine for ‘Holding Registers’? I think we’ll give this a try.

Any other tips/advice is welcome

Dave W

If holding registers were working on your tool (Modbus function code 3), then yes, use holding registers on the Opto Modbus kit. Since you already are familiar with the serial modules, the config is the same, so you are probably good there.