Hello All, I am a beginner in learning the TCP Modbus protocol. I was wondering if it should be possible to set a single coil using function code 15. If yes, does it mean that I do not necessarily need FC 5 anymore to set a single coil ? The reason I am asking this is because I am seeing odd results when I try to set a single coil status using function code 15. For my tests I am using the "Free" mod_RSsim.exe simulator. I tried to following
Step 1: I send the following byte stream (in decimal) to set address 0 to ON. This was OK ( I saw address 0 becoming "1")
169 91 0 0 0 8 255 15 0 0 0 1 1 1
Step 2: I send the following byte stream (in decimal) to set address 2 to ON. This was OK. I saw address 0 en 2 both being '1')
125 28 0 0 0 8 255 15 0 2 0 1 1 1
Step 3: I send the following byte stream (in decimal) to set address 3 to ON. This was OK. I saw address 0, 2 and 3 all being '1')
76 46 0 0 0 8 255 15 0 3 0 1 1 1
Step 4: I send the following byte stream (in decimal) to set address 2 to OFF (At least that was my plan). Now instead of seeing only address 2 going to '0' and address 0 and 3 remaining "1'" I saw both address 2 and 3 becoming "0".
77 146 0 0 0 8 255 15 0 2 0 1 1 0
Can anyone explain to me what I am doing wrong ?
Regards,
Pluto Mars
Step 1: I send the following byte stream (in decimal) to set address 0 to ON. This was OK ( I saw address 0 becoming "1")
169 91 0 0 0 8 255 15 0 0 0 1 1 1
Step 2: I send the following byte stream (in decimal) to set address 2 to ON. This was OK. I saw address 0 en 2 both being '1')
125 28 0 0 0 8 255 15 0 2 0 1 1 1
Step 3: I send the following byte stream (in decimal) to set address 3 to ON. This was OK. I saw address 0, 2 and 3 all being '1')
76 46 0 0 0 8 255 15 0 3 0 1 1 1
Step 4: I send the following byte stream (in decimal) to set address 2 to OFF (At least that was my plan). Now instead of seeing only address 2 going to '0' and address 0 and 3 remaining "1'" I saw both address 2 and 3 becoming "0".
77 146 0 0 0 8 255 15 0 2 0 1 1 0
Can anyone explain to me what I am doing wrong ?
Regards,
Pluto Mars