Using protected command interface
To get a semaphore, read the semaphore Modbus register. The power meter will return a zero or a nonzero number.
-
If the meter shows zero, someone else owns the semaphore. You must wait for the semaphore to be available before sending a command.
-
If the meter shows a nonzero number, you own the semaphore. Semaphore is provided once until it is released or has been inactive for approximately 4 minutes. Once you have the semaphore, subsequent reads of the semaphore register will return zero until you release the semaphore or it times out.
To send a meter command using the protected command interface:
-
Read the semaphore register and record the meter response. This is your semaphore.
-
Build the packet to be written to the command block.
-
Write the packet as a Modbus block write (enter the command number, semaphore, and parameters at the same time).
Protected command block example
Command block Register number Command 2039 Semaphore 5 Parameters 1 -
Monitor the meter response registers for validity and completion.
Protected meter response example
Meter response Register number Status 2039 Result 0 Data 1 -
Write the semaphore back to the semaphore register to release it for another master to use.