Jump to content
OMRON Forums

Recommended Posts

Posted

Having a problem in a capp with Modbus. Error copied from the output box is:

 

\\opt\eldk-4.2\debian_rootfs\opt\ppmac\libppmac\modbus.h(138,0): Error : too few arguments to function 'int ModbusRegisterRead(int, int, int, short unsigned int*, int)'

 

The ModbusRegisterRead works fine in the Terminal, but in the capp, I don't understand what appears to be extra "int" arguments. Cannot find documentation to support the function as shown in the error code.

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Posted

I have requested that a firmware engineer reply regarding this parameter. Stay tuned.

 

Thanks Charles. I actually worked on it more and have figured out where the problem is. For some reason, this particular function requires a "int" as an argument at the end of the argument list. Don't know why, but it is not consistent with what works in the terminal window and not consistent with what works for the ModbusFloatRead function.

Posted

Here is some documentation on the function:

 

int ModbusRegisterRead (int socknum, int refnum, int numwds, unsigned short * respbuf, int hold)

Performs register reads from a Modbus TCP/IP Server

Starts reads at "refnum" for "numwds". Uses Modbus function code 4

Parameters:

socknum - socket number

refnum - Modbus Server reference number

numwds - Number of 16 bit registers to read

hold - if !=0 read Holding Reg (fc=3) else read registers (fc=4)

*respbuf - ptr to register read buffer

Returns:

0 = OK

!0 = NOK (Use ModbusLinuxError, ModbusSocketError & ModbusServerException to view errors

Posted

Here is some documentation on the function:

 

int ModbusRegisterRead (int socknum, int refnum, int numwds, unsigned short * respbuf, int hold)

Performs register reads from a Modbus TCP/IP Server

Starts reads at "refnum" for "numwds". Uses Modbus function code 4

Parameters:

socknum - socket number

refnum - Modbus Server reference number

numwds - Number of 16 bit registers to read

hold - if !=0 read Holding Reg (fc=3) else read registers (fc=4)

*respbuf - ptr to register read buffer

Returns:

0 = OK

!0 = NOK (Use ModbusLinuxError, ModbusSocketError & ModbusServerException to view errors

 

Very good...I was using the "Power PMAC Modbus Design Document" and that document did not have this info. Of course, I should check for a later document. Thanks for your help.

  • 10 months later...
Posted

Very good...I was using the "Power PMAC Modbus Design Document" and that document did not have this info. Of course, I should check for a later document. Thanks for your help.

 

Where can I find this "Power PMAC Modbus Design Document". We are contemplating using a modbus stepper driver for a simple tool changer.

Posted

This is in the documentation folder for the "PowerPmacModbusExample" example project:

"C:\DeltaTau\Power PMAC IDE\PowerPMACProjectExamples\PowerPmacModbusExample\PowerPmacModbusExample\Documentation"

Guest
This topic is now closed to further replies.

×
×
  • Create New...