Dear all,
I am working on Codesys V3.5. I am using WIN V3 as my device.I want to communicate with a Modbus slave connected to my Workstation on the COM port.
So I have successfully added IODrvModbus library to my project. I am able to view all the files in the library.
I have added a MASTER COM port in my codesys project. Now as I have iodrvmodbus library added to my project,
I have the following function blocks available
a) IoDrvModbuscomport
b) Modbus request
c) Modbusrequest2
d) ModbusSlavecomport
you do not need to call anything manually from the library all is done implicit by the config/ iodriver
just generate the device configuration in the device tree, then add the mapping to your slave
- use the IO variables that't it.
BR
E. Schwellinger
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok for Implicit configuration IODrv, but i have to access to 2000 registers with one register by channel. So, there isn't enough channels. I would like to set with a variable the offset shield. Or maybe use ModbusRequest FB from iodrvmodbus library. But i don't know how to find the hComPort (RTS_IEC_HANDLE)???? for this FB...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
I'm on codesys 3.5 sp7 patch5 and I'm trying to use the ModbusRequest FB from iodrvmodbus library. But i don't know how to find the hComPort, me too like the user Moun72.
I suppose my serial port is number 1 but if i try to put 1 directly to input of FB when i launch the command execute the system crash.
Can someone help me ?
thanks in advance
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hello, i'm here again,
After some days of search on google and here in this forum i don't find nothing about this function block.
I can not believe no one has ever used this.
And I can not believe that there is no information on this.
No manual, no examples, nothing.
Why ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am also in need of some information on how to give the handle for my serial port to an instance of IoDrvModbus.ModbusRequest2.
My Modbus device is set up poorly and as such I would need to create a channel for almost every word I need to write to. I've created a function block to pass in an offset and value and it will write to the modbus register. With ModbusTCP I have used ModbusRequest and it is working great but I now need to use the serial port for a different device with the same I/O layout.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Mirasoft, I am very much looking forward to your library!
I had to open the COM port first using the SysCom library - this returns the RTS_IEC_HANDLE for the port to pass into the ModbusRequest block.
There is very, very little documentation on this...
VAR  modbusRequestSerial:IoDrvModbus.ModbusRequest2;  modbusCommandSerial:IoDrvModbus.ModbusCommand;  comm:IoDrvModbus.RTS_IEC_HANDLE;  commSettings:SysCom.COM_Settings;  pntResult:POINTERTOSysCom.RTS_IEC_RESULT;END_VAR            comm:=SysCom.SysComOpen2(pSettings:=ADR(commSettings),0,pResult:=pntResult);            modbusRequestSerial(              xExecute:=xExecute,              xAbort:=,              hComPort:=comm,              usiSlaveAddr:=32,              modbusCommand:=modbusCommandSerial,              tResponseTimeout:=,              uiSendTimeout:=,              pSendData:=ADR(servoOpcode),              pRecvData:=,              transmission:=,              xDone=>xDone,              xBusy=>,              xError=>xError,              xAborted=>,              uiDataLength=>,              byModbusError=>);
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear all,
I am working on Codesys V3.5. I am using WIN V3 as my device.I want to communicate with a Modbus slave connected to my Workstation on the COM port.
So I have successfully added IODrvModbus library to my project. I am able to view all the files in the library.
I have added a MASTER COM port in my codesys project. Now as I have iodrvmodbus library added to my project,
I have the following function blocks available
a) IoDrvModbuscomport
b) Modbus request
c) Modbusrequest2
d) ModbusSlavecomport
2) Also, as a Modbus master, where do I mention Function Code, Slave id, no of bytes to read etc.
Kindly guide
Praveena
Hi,
you do not need to call anything manually from the library all is done implicit by the config/ iodriver
just generate the device configuration in the device tree, then add the mapping to your slave
- use the IO variables that't it.
BR
E. Schwellinger
Hi all,
Ok for Implicit configuration IODrv, but i have to access to 2000 registers with one register by channel. So, there isn't enough channels. I would like to set with a variable the offset shield. Or maybe use ModbusRequest FB from iodrvmodbus library. But i don't know how to find the hComPort (RTS_IEC_HANDLE)???? for this FB...
Hi all,
I'm on codesys 3.5 sp7 patch5 and I'm trying to use the ModbusRequest FB from iodrvmodbus library. But i don't know how to find the hComPort, me too like the user Moun72.
I suppose my serial port is number 1 but if i try to put 1 directly to input of FB when i launch the command execute the system crash.
Can someone help me ?
thanks in advance
hello, i'm here again,
After some days of search on google and here in this forum i don't find nothing about this function block.
I can not believe no one has ever used this.
And I can not believe that there is no information on this.
No manual, no examples, nothing.
Why ?
I am also in need of some information on how to give the handle for my serial port to an instance of IoDrvModbus.ModbusRequest2.
My Modbus device is set up poorly and as such I would need to create a channel for almost every word I need to write to. I've created a function block to pass in an offset and value and it will write to the modbus register. With ModbusTCP I have used ModbusRequest and it is working great but I now need to use the serial port for a different device with the same I/O layout.
Since we had the same problems, we decided to develop our own Modbus library. This will be available in the CODESYS store in March. Hold on
https://forum.codesys.com/viewtopic.php?f=11&t=8568&p=20894#p20894
Mirasoft, I am very much looking forward to your library!
I had to open the COM port first using the SysCom library - this returns the RTS_IEC_HANDLE for the port to pass into the ModbusRequest block.
There is very, very little documentation on this...
It's done. Have a look at Universal Modbus Client/Master