Home AMX User Forum NetLinx Studio

AMX Modbus Module

Looking for an example code snipet on how to pass a command from a main program to the modbus module. I want to write a value to a modbus device. As an example the value 128. Modbus slave module address is 58. I'm assuming the modbus.comm module translates the decimal value to hex. Also using
write_hold function 06 or 16.
Thanks in advance

Comments

  • ericmedleyericmedley Posts: 4,177
    tomw471 wrote: »
    Looking for an example code snipet on how to pass a command from a main program to the modbus module. I want to write a value to a modbus device. As an example the value 128. Modbus slave module address is 58. I'm assuming the modbus.comm module translates the decimal value to hex. Also using
    write_hold function 06 or 16.
    Thanks in advance

    There is a modbus module on the AMX site.

    http://www.amx.com/inconcert/trednet.asp?page=device

    seach by 'modbus' in the device window.
  • AMX Modbus

    That's the module I'm trying to use. Just can't figure how to pass info to the module from the main program.
    All I want to do is to be able to read or write values to a single holding register.
  • AMXJeffAMXJeff Posts: 450
    tomw471 wrote: »
    That's the module I'm trying to use. Just can't figure how to pass info to the module from the main program.
    All I want to do is to be able to read or write values to a single holding register.
    // WRITE_HOLD=<addr>:<value>[:<zoneID>:<key>][:DEV=<dev_addr>]
    SEND_COMMAND vdvModbus,'WRITE_HOLD=6:78'
    
    //READ_HOLD=<addr>[:<number>][:<zoneID>:<key>][:DEV=<dev_addr>]
    SEND_COMMAND vdvModbus,'READ_HOLD=6'
    
    // You get this information back in your string event in vdvModBus Data_Event
    // WRITE_HOLD=<addr>:<value>:<zoneID>:<key>:DEV=<dev_addr>
    'WRITE_HOLD=6:78:12:3:DEV=71'
    
    //READ_HOLD=<addr>:<value[,value&#8230;]>:<zone ID>:<key>:DEV=<dev_addr>
    'READ_HOLD=6:8:0:0:DEV=1'
    
    
  • A couple of things to keep in mind.
    - Set the actual modbus device to slave
    - Remember that modbus addresses are referenced to zero. So to write to holding register 1 you need to send to 0. And although holding registers start at modbus address 40001, you do a write_hold to address 0, the module translates this to modbus 40001

    eg. To write to modbus register 40031 you send -
    send_command VdvModbus,"'WRITE_HOLD=30:',itoa(info[1].temp)"
  • Toshiba TCS-NET Modbus Integration with AMX , Toshiba TCB-IFMB640TLE

    I have a site where the client wants to integrate with the Toshiba TCS-NET modbus via RS -485. Does anyone have a modbus module for this device.

    Do i need to get a modbus interface gateway to AMX or can i control it directly.
  • it is really funny that in the last 4 - 5 posts about Modbus protocol questions there is ALWAYS the SAME post from Ajish... :)
  • jjamesjjames Posts: 2,908
    papadouk wrote: »
    it is really funny that in the last 4 - 5 posts about Modbus protocol questions there is ALWAYS the SAME post from Ajish... :)
    Hey now - respect! He's former tech support! :)
  • I apologize for the thread jacking. I will not repeat this. Thanks all for the constructive words
  • ajish.rajuajish.raju Posts: 185
    I am using the AMX modbus module and trying to control the coils in address 2777 to turn on/off. Via Modscan32 software i am able to change the data point on/off but not via the module. There is string to an fro from the device.

    From the pc, i am using a usb to serial and then 232 to 485 converter and then connected to the the Toshiba Modbus device. The baud rates are proper as per the device. I am not sure what i am doing wrong.
Sign In or Register to comment.