Can't read from a Micro820 Modbus Server / Slave

bill1995

Member
Join Date
Feb 2024
Location
NYC
Posts
2
Hello,

I set up my Micro820 with a basic mapping. When I try to run a script to read the addresses I get errors for illegal addresses.

  • Connected to Modbus Server
  • _IO_EM_DO_01: OFF
  • _IO_EM_DO_02: OFF
  • _IO_EM_DO_03: OFF
  • _IO_EM_DO_04: ON
  • Error reading _IO_EM_DI_01: Exception Response(130, 2, IllegalAddress)
  • Error reading _IO_EM_DI_02: Exception Response(130, 2, IllegalAddress)
  • Error reading _IO_EM_DI_03: Exception Response(130, 2, IllegalAddress)
  • Error reading _IO_EM_DI_04: Exception Response(130, 2, IllegalAddress)
  • Error reading _IO_EM_AO_00: Exception Response(131, 3, IllegalAddress)
  • Error reading _IO_EM_AI_00: Exception Response(132, 4, IllegalAddress)
What's strange is that I can read the 4 DI if I read them as coils (0x01) NOT as discrete inputs (0x02).

This is my mapping. I've tried adjusting the registers but no luck.

Code:
modbus_mapping = {
    '_IO_EM_DO_01': {'address': 0, 'type': 'coil'},
    '_IO_EM_DO_02': {'address': 1, 'type': 'coil'},
    '_IO_EM_DO_03': {'address': 2, 'type': 'coil'},
    '_IO_EM_DO_04': {'address': 3, 'type': 'coil'},
    '_IO_EM_DI_01': {'address': 4, 'type': 'discrete_input'},
    '_IO_EM_DI_02': {'address': 5, 'type': 'discrete_input'},
    '_IO_EM_DI_03': {'address': 6, 'type': 'discrete_input'},
    '_IO_EM_DI_04': {'address': 7, 'type': 'discrete_input'},
    '_IO_EM_AO_00': {'address': 8, 'type': 'holding_register'},  # Assuming it's a single register
    '_IO_EM_AI_00': {'address': 24, 'type': 'input_register'},  # Assuming it's a single register
}

1709263771559.png
 
Here are the most used Function Codes:

Most used Function Codes​

So if you wanted to address "_IO_EM_DI_01" you would map that to address 100001 since it's Discrete and then
you use Function 02 to read address 10001.

I suggest you study up on Modbus Addressing just Google it you will find plenty of information.
 
Your advice helped me greatly. I was under the impression the IDE in CCW took care of that part of the addressing. My new table works as expected. I also was mistaken in how the addresses got mapped. I thought I needed "16" addresses for words but that part is managed by the address being "4xxxxx" or "3xxxxx" apparently. Thank you!

1709299342860.png
 

Similar Topics

Hi, The hardware is: Click Plc model # CO-O1DD1-O HMI model # S3ML-R magnetic-inductive flow meter model # FMM100-1001. I will set the flow meter...
Replies
4
Views
144
Is there a way to use the FAL instruction to do +=2 instead of +=1? I have an array that is organized with alternating "data" and "flag" values...
Replies
5
Views
126
Hi everyone i have a customer, who wants to show an alarm on the machine, if the I/O forces are enabled and set, on at ControlLogix L81E with...
Replies
3
Views
246
Hi Iam using monitouch hmi(V9 soft) with omron plc cj2m (CX programmer). In this I want to read a data from hmi to plc. The data was like...
Replies
0
Views
99
Hi everyone. Quick questions. On UnityPro, I want to open and quickly read tags from a .STA files witouth opening the program. I have 30 plc...
Replies
2
Views
147
Back
Top Bottom