MODBUS AND HMI COMMUNICATION HELP

Hi,
I am trying to programind and trying to communicate arduino and HMI screen (Easy wiev)
when I write from SCADA as 500 led pin 13 must blinking

#include <ModbusMaster.h>
int led = 13;
ModbusMaster node(2);

void setup()
{
node.begin(19200);
}

void loop()
{
static uint32_t i;
uint8_t j, result;
uint16_t data[6];

i++;

// set word 0 of TX buffer to least-significant word of counter (bits 15..0)
node.setTransmitBuffer(0, lowWord(i));

// set word 1 of TX buffer to most-significant word of counter (bits 31..16)
node.setTransmitBuffer(1, highWord(i));

// slave: write TX buffer to (2) 16-bit registers starting at register 0
result = node.writeMultipleRegisters(0, 2);

// slave: read (6) 16-bit registers starting at register 2 to RX buffer
result = node.readHoldingRegisters(2, 6);

// do something with data if read is successful
if (result == node.ku8MBSuccess)
{
for (j = 0; j < 6; j++)
{
data[j] = node.getResponseBuffer(j);
}
}
if(word(2)==200)

{
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second

}

}

is this correct one if not please somebody tell me how it is possible

Is the MODBUS library using SPI? I seem to recall that it does. If that is the case, then you can't use pin 13 for the LED, as that is one of the SPI pins.

My friend ? am new at arduino and ? am trying to communicate arduino and HMI panel
I want to write a value from scada if this value is equal to 500 and one of pins must blink
What code should ? write and what type configuration ? have to do

I want to write a value from scada if this value is equal to 500 and one of pins must blink

I think that you mean that you want to read a value from scada, and if the value is 500, a pin must periodically be turned on or off.

So, what part of this are you having problems with? Links to the hardware you are using, and the library, would be useful.

My friend really ? dont know what ? have done at upward codes :slight_smile:
But ? thought that ? adjusted word 0 and 1 (Tx and Rx node )by using setbuffer command
And result=node.writemultipleregister(0,2)
Result=node.readmultipleregister(2,6)

And ? thouhgt that ? set 6 word read write adress from 0 to 6
?f it is correct till here
I need to write decimal or hexadecimal value to HMI adress side
What do ? need to do