Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Modbus
#1
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.
Reply
#2
I have requested that a firmware engineer reply regarding this parameter. Stay tuned.
Reply
#3
(09-22-2014, 11:10 AM)CharlesP Wrote: 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.
Reply
#4
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
Reply
#5
(09-22-2014, 02:06 PM)CharlesP Wrote: 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.
Reply
#6
(09-22-2014, 02:36 PM)KennNova Wrote: 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.
Reply
#7
This is in the documentation folder for the "PowerPmacModbusExample" example project:
"C:\DeltaTau\Power PMAC IDE\PowerPMACProjectExamples\PowerPmacModbusExample\PowerPmacModbusExample\Documentation"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)