Codesys Modbus TCP Server

Hello everyone

i do understand that you can create modbus registers to be read by a Modbus Master using the Modbus TCP Server and they are populated in the IO Mapping.

1736270264140.png1736270573851.png
My question is can you make multiple registers of variable length eg. (16,32,64 ...bytes) using the dialogue to import CSV files as the properties only allows you to create multiple registers of a particular length ????
can i do this by either importing a csv file or through Structured Text

Please ASSIST with examples
 
The basic answer is probably no: the only sizes and types served by a Modbus Slave/Server implementation of the Modbus Protocol are either 1-bit booleans (Discretes Input or Coils) or 16 bits integers (Input registers or Holding registers; see here, page 6/section 4.3 MODBUS Data Model).

That said, there are some Modbus Master/Client implementations that "know" how to read 32 or 64 bits worth of 16-bit integers at a time and interpret them as integer, or even floating point, values, but that is entirely outside the scope of the formal Modbus Protocol. I don't know if Codesys is such an implementation, but given the genearlly primitive, limited, and minimal feature status of Codesys it would surprise me if that capability was available.
 
thank you drbitboy

i think i came up with a solution to my problem

I have made my registers into 2 words then created my entire list of registers by placing values from my Data Array into the locations i.e. if i require to send data 4 words long on an address i take the individual words in my array i.e. array[0],array[1], and so on so this will allow me to varry the length of the data as i required
 
I don't know if Codesys is such an implementation, but given the genearlly primitive, limited, and minimal feature status of Codesys it would surprise me if that capability was available.
Primitive and limited? Hardly, but I'd agree it's power is certainly not obvious to the occasional user.

OP, check this example, I don't know that it contains specifically what you want, but you can manipulate the server in your logic using the correct libraries.
 
Primitive and limited? Hardly, but I'd agree it's power is certainly not obvious to the occasional user.
... I would say it’s less hand-holdy, but just as capable and probably more in a lot of cases.
The power is no different than any other Turing Complete PLC; that is not the issue.

The "less hand-holdy" is what I was talking about, i.e. the UI is not as polished, feature-rich, and easy to navigate (per the "not obvious" admission above) as I have seen elsewhere, although it is a few steps up from CCW's abysmal Fisher-Price look and feel.

Rather than put the onus on the user with the "less hand-holdy" label, I would say "less respectful of the programmer's time" or "some assembly required."

If I wanted less hand-holdy I would go back to a 386SX laptop with a 10MB hard drive, a parallel printer port for I/O, and QBasic for programming, or a Timex 2068.

Again, the fundamentals are there to do whatever is needed, just it takes more work to something complex.
 

Similar Topics

I am looking for assistance with my codesys project I have setup a Modbus TCP Client to read data from a modbus device which is then processed...
8
Replies
1,904
Views
I have a program for a PLC, but I don't have the PLC now. I am running the PLC program in the Codesys simulation mode. Can I connect SCADA to...
2
Replies
4,060
Views
I'm going to be adding Modbus TCP communications to a Turck Codesys system. There will be more than one HMI hitting the Turck hardware, hopefully...
0
Replies
1,791
Views
Hi all, A couple of years ago, I ran some tests with MODBUS TCP communication between rPi running CodeSYS and a couple of Arduino's. I remember...
6
Replies
4,911
Views
Hi folks, I'm running eCockpit version 1.3.1.4 I have set up a Modbus client function using the standard library module: FbMbMasterTcp. My...
4
Replies
5,470
Views
Top