Hi there, im having some problems communicating two PLCs M340 2020 (without NOE), with the READ_VAR function.
I need to read some values in one of the PLC.
First, i dont have the PLCs with me, so i have to perform de test with the simulator(the ethernet network is setup correctly). What i've done so far: i set up the function so it should read the values i want (i.e: %MW300) from the simulator itself (so the origin and destination IP's would be the same). The READ_VAR block is set up as follows:
ENABLE := PARAMETER_TABLE[1].0, (negated)
ADR := ADDM(CPU_ETH{192.168.5.15}),
OBJ := '%MW',
NUM := 300,
NB := 10,
GEST:= PARAMETER_TABLE,
RECP => READING;
CPU_ETH is the netlink for the simulated PLC, and the IP is the one configured on the same PLC.
The error i get in the third integer from the PARAMETER_TABLE is 16#0003, wich means "Incorrect address format" according to the Help file. There is a comment in the READ_VAR help wich i dont understand regarding this error and the RECP.
I've tried changing the way i write the ADR in many ways, i.e:
ADDM('0.0.3{192.168.5.15}')
ADDM('CPU_ETH{127.0.0.1}')
ADDM('{192.168.5.15{192.168.5.15}')
ADDM('CPU_ETH{CPU_ETH}')
and many other combinations.
Perhaps the self-reading is forbidden, but that would show me some other kind of error message, not incorrect format.
I cant seem to solve this on my own, maybe someone has an idea?
Thank you.
I need to read some values in one of the PLC.
First, i dont have the PLCs with me, so i have to perform de test with the simulator(the ethernet network is setup correctly). What i've done so far: i set up the function so it should read the values i want (i.e: %MW300) from the simulator itself (so the origin and destination IP's would be the same). The READ_VAR block is set up as follows:
ENABLE := PARAMETER_TABLE[1].0, (negated)
ADR := ADDM(CPU_ETH{192.168.5.15}),
OBJ := '%MW',
NUM := 300,
NB := 10,
GEST:= PARAMETER_TABLE,
RECP => READING;
CPU_ETH is the netlink for the simulated PLC, and the IP is the one configured on the same PLC.
The error i get in the third integer from the PARAMETER_TABLE is 16#0003, wich means "Incorrect address format" according to the Help file. There is a comment in the READ_VAR help wich i dont understand regarding this error and the RECP.
I've tried changing the way i write the ADR in many ways, i.e:
ADDM('0.0.3{192.168.5.15}')
ADDM('CPU_ETH{127.0.0.1}')
ADDM('{192.168.5.15{192.168.5.15}')
ADDM('CPU_ETH{CPU_ETH}')
and many other combinations.
Perhaps the self-reading is forbidden, but that would show me some other kind of error message, not incorrect format.
I cant seem to solve this on my own, maybe someone has an idea?
Thank you.
Last edited: