KennNova Posted September 21, 2014 Posted September 21, 2014 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.
Omron Forums Support Posted September 22, 2014 Posted September 22, 2014 I have requested that a firmware engineer reply regarding this parameter. Stay tuned.
KennNova Posted September 22, 2014 Author Posted September 22, 2014 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.
Omron Forums Support Posted September 22, 2014 Posted September 22, 2014 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
KennNova Posted September 22, 2014 Author Posted September 22, 2014 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.
JeffLowe Posted August 18, 2015 Posted August 18, 2015 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.
steve.milici Posted August 18, 2015 Posted August 18, 2015 This is in the documentation folder for the "PowerPmacModbusExample" example project: "C:\DeltaTau\Power PMAC IDE\PowerPMACProjectExamples\PowerPmacModbusExample\PowerPmacModbusExample\Documentation"
Recommended Posts