Jump to content
OMRON Forums

Modbus


KennNova
 Share

Recommended Posts

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.

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 10 months later...

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.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...