Topic: DMD0063

Help File Version: 2.10.0.636

DEVWRITE - Write Device Register


When the PLC system powers up, the Module Configurations and Device Configurations are read from the PLC's ROM and a copy is placed into the PLC's RAM. The Write Device Register (DEVWRITE) instruction is used to alter the register values that were placed in the Device Configurations at power up - this does not change the register values stored in the System Configuration in ROM, it only changes the values in the PLC's RAM copy.

 

The individual registers that can be written to, and the values that can be written to them are both determined by the Device that is selected. The companion instruction DEVREAD - Read Device Register can used to read the value of the Device register.

 

 


Parameters:

Note: Use the F9 key or click the 'three dot box' at the right edge of the parameter field to open the Default Element Selection Tool (the Element Picker or the Element Browser) or use the Down-Arrow key (Auto-Complete) on any parameter field to see a complete list of the memory locations that are valid for that parameter of the instruction.

 

Device selects which Device has the parameter to write to.

 

No devices available means there is no device that is appropriate for this instruction. Select one of the following to create the required device:

create device will open the Device Configuration dialog of the System Configuration to create a new device of the appropriate type.
 

create module will open the Module Configuration dialog of the System Configuration to create a new module configuration that can provide a device of the appropriate type.

Write Register selects the parameter to write to. The valid entries are determined by the Device selected. See the table below for the valid registers that can be selected.

 

Value is the value to write/ This value can be any constant value specified in the table below or any readable numeric location containing the same specified value.

 

Write Register

Value
 

Notes

 

If the selected Device is an SMTP Client the following options are valid:

SMTP Server: SMTP IP Address (DWord)


 

A 32-bit value that is the IP Address of the SMTP Server to use to process Send Email (EMAIL) instructions.

 

Use the 'IP Address' format selection in a Data View to see the IP Address stored in the DWord location in it's traditional dot-decimal notation (000.000.000.000).
 

The Name to IP Address (DNSLOOKUP) instruction can be used to find the IP Address assigned to a named device at runtime.

 

SMTP Server: SMTP IP Port (Word)
 

0 to 65535
 

The TCP/IP Port Number to assign to the SMTP Server.
 

SMTP Server: POP3 IP Address (DWord)

 

A 32-bit value that is the IP Address of the POP Server to use to process Send Email (EMAIL) instructions.

 

0 = use the same IP Address as the SMTP Server IP Address.

 

Non-0 = use this value as the IP Address for the POP3 process instead of the IP Address of the SMTP Server.

 

Use the 'IP Address' format selection in a Data View to see the IP Address stored in the DWord location in it's traditional dot-decimal notation (000.000.000.000).
 

The Name to IP Address (DNSLOOKUP) instruction can be used to find the IP Address assigned to a named device at runtime.

 

SMTP Server: POP3 IP Port (Word)
 

0 to 65535

 

The POP3 Port Number to assign to the SMTP Server.
 

SMTP Server: Server Name (String)

 

 

A String containing the data for the "Server Name "field of the SMTP configuration.

 

SMTP Server: "From" EMail Address (String)

 

 

A String containing the data for the Authentication "From Email Address "field of the SMTP server configuration.

SMTP Server: Authentication Account Password
(String)

 

 

A String containing the data for the Authentication "Password "field of the SMTP server configuration.

SMTP Server: Authentication Account User Name
(String)

 

 

A String containing the data for the Authentication "User Name "field of the SMTP server configuration.

SMTP Server: Authentication Mode (Word)

 

0 to 65535

The Authentication Mode for the SMTP Client to use:

 

0 = Disabled

1 = AUTH Login

2 = AUTH PLAIN

3 = POP before SMTP

 

SMTP Server: Timeout (Seconds)

 

0 to 65535

The number of seconds the SMTP Client will wait on a response from the SMTP server before logging an error.

 

 

If the selected Device is an MQTT Client the following options are valid:

MQTT Client: Authentication: Account Password

(String)

 

 

A String containing the data for the Authentication "Password "field of the MQTT Client configuration.

 

MQTT Client: Authentication: Account User Name

(String)

 

 

A String containing the data for the Authentication "User Name "field of the MQTT Client configuration.

 

MQTT Client: Client ID (String)

 

 

A String containing the data for the Client ID field of the MQTT Client configuration.

 

MQTT Client: LW&T Payload (String)

 

 

A String containing the data for the Payload field of the MQTT Client's Last Will & Testament.

 

MQTT Client: LW&T Topic (String)

 

 

A String containing the data for the Topic field of the MQTT Client's Last Will & Testament.

 

MQTT Client: Server IP Address (DWord)

 

 

Use the 'IP Address' format selection in a Data View to see the IP Address stored in the DWord location in it's traditional dot-decimal notation (000.000.000.000).

 

The Name to IP Address (DNSLOOKUP) instruction can be used to find the IP Address assigned to a named device at runtime.

 

MQTT Client: Server Name (String)

 

 

A String containing the data for the "Server Name "field of the MQTT Client configuration.

 

MQTT Client: Server Port (DWord)

 

0 - 65535

 

The POP3 Port Number the MQTT Client will use to establish the connection to the MQTT Broker.

 

MQTT Client: Comm Timeout (in seconds)

(DWord)

 

0 - 255

The amount of time (in seconds) the MQTT Client will wait for a response from the MQTT Broker when it tries to establish the connection to the MQTT Broker.

MQTT Client: User Specified Client ID ( String)

 

 

A String containing the 23 bytes of data to use as the Client ID.

 

 

If the selected Device is an FTP Client the following options are valid:

FTP Client: Authentication: Account Password

(String)

 

 

A String containing the data for the Authentication "Password "field of the FTP Client configuration.

 

FTP Client: Authentication: Account User Name

(String)

 

 

A String containing the data for the Authentication "User Name "field of the FTP Client configuration.

 

FTP Client: Server IP Address (DWord)

 

 

Use the 'IP Address' format selection in a Data View to see the IP Address stored in the DWord location in it's traditional dot-decimal notation (000.000.000.000).

 

The Name to IP Address (DNSLOOKUP) instruction can be used to find the IP Address assigned to a named device at runtime.

 

FTP Client: Server Name (String)

 

 

A String containing the data for the "Server Name "field of the FTP Client configuration.

 

FTP Client: Server Port (DWord)

 

0 - 65535

 

The Port Number the FTP Client will use to establish the connection to the FTP Server.

 

FTP Client: Timeout (in seconds)

(DWord)

 

0 - 255

The amount of time (in seconds) the FTP Client will wait for a response from the FTP Server when it tries to establish the connection to the FTP Server.

 

If the selected Device is the on-board Serial Port or any of theSerial ports on a SERIO modulethe following options are valid:

Serial Port: Baud Rate

 

115200

57600

38400

19200

9600

4800

2400

1200

 

 

Serial Port: Data Bits (7, 8)

 

7 = 7 data bits

8 = 8 data bits

 

 

Serial Port: Parity (0: None, 1: Even, 2: Odd)

 

0 = No Parity

1 = Even Parity

2 = Odd Parity

 

 

Serial Port: Stop Bits (1, 2)

 

1 = 1 Stop Bit

2 = 2 Stop Bits

 

 

Serial Port: Transmit / RTS Control

 

0x0? = Unconditional

0x1? = Wait For CTS

0x2? = Delayed for 5ms

0x3? = Delayed for 50ms

0x4? = Delayed for 250ms

0x5? = Delayed for 500ms

 

0x?0 = Follows Transmitter

0x?1 = Manual

0x?2 = Always OFF

0x?3 = Always ON

 

A BYTE value where High Nibble is the Transmit Control value and the Low Nibble is the RTS Control value.

 

If any of the 'Delayed for XXXms' selections are used then the RTS value will automatically be set to 0x00 - Follows Transmitter.
 

Examples:

0x00 = Unconditional / Follows Transmitter

0x30 = Delay 50ms after RTS (RTS control nibble automatically set to 0)

Serial Port: Manual RTS Control Line Value (0 or 1)

 

0x00 - lower the RTS line of the serial port
0x01 - assert the RTS line of the serial port

 

The low nibble of the Transmit / RTS Control value must be set to 1 (Manual) to enable programmatic control of the RTS line.

 

If the selected Serial Port or Serial Port POM is Configured as a K-Sequence Slave (Server) the following option is valid:

Serial Port: K-Sequence Server Station ID

 

1 to 90

 

 

 

If the selected Serial Port or Serial Port POM is Configured as a Modbus/RTU Slave (Server) the following option is valid:

Serial Port: Modbus/RTU Slave Unit ID

 

0 to 255

 

 

 

If the selected Serial Port or Serial Port POM is Configured as a Modbus/RTU Master (Client) the following options are valid:

Serial Port: Modbus/RTU Master Inter-packet Delay (uSec)

 

0 to 65535

 

The amount of time (in microseconds) the Modbus/RTU Client will place between packets as they are sent.

 

Serial Port: Modbus/RTU Master Retries

 

0 to 255

 

 

Serial Port: Modbus/RTU Master Timeout (ms)

 

0 to 32767

 

 

 


Status Display:

 


See Also:

CLOSE - Close Device

 

OPENDEV - Open Device

 

DEVCLEAR - Clear Device

 

DEVREAD - Read Device Register

 

DEVWRITE - Write Device Register

 


Related Topics:

HWCONFIG - Configure Hardware

 

HWINFO - Get Hardware Information

 

For more information on Devices, Device References, and how to configure them go to the Device Configuration section of the System Configuration.

 


Rung Example: