=====Monitoring GEM State Variables in TransSECS Devices===== GEM state variables are calculated and maintained automatically by the internal GEM state model so you should never manually change these. However these values are accessible for monitoring and can be written (to be read only) to a holding register or tag in your device. See also Configuring [[modbusdevicesexample_onlineoffline_localremote| OnlineOfflineState and LocalRemoteState VIDs]] to use Modbus 0x registers. ====GEM Control State (Modbus Example)==== The GEM Control state can be written (to be read only) to a Modbus 4x register. First add the 4x (Word) register to the ModbusTCPDeviceServer you want to use to hold this value in your project by adding a Word called "ControlState" and setting the register value (in this example we use 4x1). {{:pasted:20240206-164223.png}} In the configuration, be sure to set the Timebase to 0.0 (change this from the default 1.0). It is important to make this register write-only by setting the Timebase to 0.0, so that the current Control State value is only written to the register (and never read from this register). {{:pasted:20240206-164757.png}} In the TransSECS Devices project, configure the ControlState VID to use this newly defined register to store its value. Click on ControlState (under VIDs) and select ModbusTCP for the Device, and the TagName "ControlState". {{:pasted:20240206-165058.png}} Now when you build and run the deployment you will see the value of the tool's ControlState in the 4x1 register.