DirectLogic 405 D4-450 Port 2 Setup V-Memory Addresses

Brian Holt9 min read
AutomationDirectPLC HardwareTechnical Reference
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Overview

The DirectLogic 405 D4-450 CPU exposes its two onboard serial communication ports through a fixed V-memory map that is populated by the DirectSOFT PLC Setup dialog and latched into the port-driver working registers by a dedicated trigger word. Engineers who modify Port 2 parameters (protocol, baud rate, parity, stop bits, duplex mode) frequently assume the changes are written to a specific pair of V-words, but the actual layout reserved by the CPU firmware is not always obvious from the setup dialog. This reference documents the correct V-memory assignments for Port 1 and Port 2, the V767 setup-complete trigger, the bit-packing of each setup word, the runtime procedure to re-initialize a port, and a verification sequence that confirms values are actually being committed to the CPU.

Hardware Architecture: D4-450 Communication Ports

Before mapping V-memory to a logical port, the physical configuration of the D4-450 must be understood. The base unit provides two onboard ports with distinct electrical characteristics:

  • Port 1 (lower port, RJ12 6P6C): RS-232C only, fixed DCE pinout, used for programming terminals, operator interfaces, and Modbus RTU master or slave.
  • Port 2 (upper port, RJ45 or 4-pin removable terminal depending on housing variant): RS-422 / RS-485 software-selectable, supports 4-wire (full duplex) and 2-wire (half duplex) modes. The electrical mode is selected by the DIP switches on the CPU face; the protocol, baud, parity, and stop bits are selected by V-memory.

Both ports share the same protocol stack (K-sequence, DirectNET, Modbus RTU, ASCII In/Out) but each port has its own pair of V-memory configuration words plus the shared V767 setup-complete trigger word. Pinouts and DIP-switch diagrams are documented in the AutomationDirect com port setup reference.

V-Memory Map for Port Configuration

The CPU firmware reserves specific V-memory words that are populated by the DirectSOFT PLC Setup dialog and copied into the port's working registers when the setup-complete word is written. Per the AutomationDirect com port setup documentation the layout is as follows:

V-Memory Address Octal Alias Function Writable from Ladder?
V766 V76600 Port 1 control / handshake enable Yes (read at boot)
V767 V76700 Port setup complete / trigger word Yes - pulse to commit
V772 V77200 Port 1 setup data word - low byte = protocol, high byte = port options Indirectly (via setup dialog)
V773 V77300 Port 1 setup data word - baud rate, parity, stop bits, data bits Indirectly (via setup dialog)
V774 V77400 Port 2 setup data word - low byte = protocol, high byte = port options Indirectly (via setup dialog)
V775 V77500 Port 2 setup data word - baud rate, parity, stop bits, data bits Indirectly (via setup dialog)
Read-only after commit: Once the values are latched into the port's working registers at boot or after a setup-complete pulse, the V-words reflect the last committed value but cannot be changed by writing to them from a running program. The CPU only re-reads V772-V775 when the V767 trigger word is pulsed with the appropriate commit pattern.

Bit and Field Encoding

Each setup data word is bit-packed. The standard encoding used by DirectSOFT's PLC Setup is shown below.

V772 and V774 - Protocol and Options Word

Bits Field Values
0-3 Protocol 0 = K-Sequence, 1 = DirectNET slave, 2 = DirectNET master, 3 = Modbus RTU slave, 4 = Modbus RTU master, 5 = ASCII In, 6 = ASCII Out
4 Duplex (Port 2 only) 0 = 4-wire, 1 = 2-wire
5 RTS / CTS handshaking 0 = disabled, 1 = enabled
6-7 Response delay low 0 = 0 ms, 1 = 10 ms, 2 = 100 ms, 3 = 500 ms
8-15 Response delay high / reserved Engineer-set, see manual

V773 and V775 - Baud, Parity, Stop Word

Bits Field Values
0-7 Baud rate divider Encoded divisor table: 19200, 9600, 4800, 2400, 1200, 600, 300, 110
8-9 Parity 0 = None, 1 = Odd, 2 = Even
10-11 Stop bits 0 = 1 stop, 1 = 2 stop (valid only with parity None)
12-15 Data bits 0 = 7 bits, 1 = 8 bits

Setup Complete Trigger (V767)

The CPU re-initializes the port hardware from V772-V775 only when V767 is written with the value 0x004C (decimal 76) on a single scan. Ladder code that wants to change port parameters at runtime therefore uses a one-shot:

STR  X0             ; user command to change port setup
OUT  V76700         ; pulse the setup-complete trigger (decimal 76)

In DirectSOFT stage programming the equivalent is:

IF (Port_Config_Changed = TRUE) THEN
    V76700 := 76    ; decimal 76 commits the port setup
END_IF

After the trigger is recognized, the CPU reloads V772-V775 into the port-driver working registers and the values remain in effect until the next trigger, power cycle, or mode change to RUN.

Step-by-Step Verification

  1. Connect DirectSOFT to the D4-450 and open a Data View window on V772, V773, V774, V775.
  2. Open PLC > Setup > Port 2 Setup from the menu bar.
  3. Change the protocol from K-Sequence to Modbus RTU Slave. Click OK and write the project to the CPU (place the mode switch in Stop first).
  4. Re-read V774. The low nibble should now read 3 (Modbus RTU slave) rather than the previous K-Sequence code 0.
  5. Change baud rate from 9600 to 19200. Re-write the project.
  6. Re-read V775. The baud-divider byte should change to the 19200 encoding. If V775 does not change, the value was not committed to the CPU even though V774 changed - this typically indicates a stale project file in DirectSOFT or that the CPU is in Program mode and the write to V775 was rejected because the previous comm setup is locked.
  7. Cycle power to the CPU and re-read V772-V775 to confirm the values persist in non-volatile storage.
  8. (Optional) Pulse V767 with decimal 76 from a one-shot rung and confirm a connected device sees the new baud rate on the very next character.

Troubleshooting Matrix

Symptom Likely Cause Corrective Action
V774 updates, V775 does not change baud or parity DirectSOFT project not re-compiled after edit; only the protocol field was saved File > Save Project, then PLC > Transfer > Write Project, then power cycle
V772-V775 all read 0 CPU in Program mode; setup values cleared at boot before user program runs Place CPU in Run mode and re-write PLC Setup
Port 2 still communicates at old parameters after setup change V767 trigger not written, port driver still uses cached values Add a one-shot pulse to V767 in the startup routine, value = 76 decimal
V772-V775 read 0xFFFF Non-volatile storage corruption; setup defaults to safe mode Re-enter setup via DirectSOFT, write to CPU, cycle power; if persistent, replace the CPU battery and clear memory
Port 2 communication works, but V774 does not reflect expected protocol DIP switch on CPU face overrides protocol register for Port 2 Verify DIP switch positions per the comportsetup diagram
Modbus RTU slave on Port 2 does not respond to its station address Station address is a separate V-memory byte outside the V772-V775 pair, not part of this mapping Locate the station-address word in the D4-450 user manual and write it directly
Port 2 transmits garbage after a duplex change DIP switches still in 4-wire position while V774 bit 4 is set to 2-wire Move DIP switches to match the V-memory duplex bit

Edge Cases and Field Notes

Three operational caveats frequently cause confusion on the D4-450 and are worth documenting explicitly.

  1. DIP switch versus V-memory precedence. For Port 2 the physical DIP switches on the CPU select the electrical mode (RS-422 4-wire, RS-485 2-wire, RS-485 4-wire). The V-memory bits only control protocol, baud, and parity. If the DIP switches are set to 2-wire but V774 is programmed for full-duplex 4-wire, the port will physically be 2-wire regardless of the V-memory value.
  2. Run-mode versus Program-mode writes. The CPU only accepts writes to the PLC Setup block when the mode switch is in Stop; some firmware revisions also accept the write in Program. Attempting to write PLC Setup while in Run results in V772-V775 being read back unchanged even though the write dialog reports success. The classic symptom is V774 (protocol) updating while V775 (baud / parity) does not - the protocol byte was committed on a previous Stop-mode write but the baud change was attempted in Run mode.
  3. Battery-backed RAM versus setup storage. The PLC Setup values are stored in a separate non-volatile area, not in standard V-memory battery-backed RAM. Power cycling the CPU with a dead battery will not erase the port setup; it will only clear data V-memory (V0-V9999 by default for the D4-450). This is sometimes mistaken for "the setup survived a bad battery" when in fact the two storage areas are independent.

Commissioning Procedure Summary

For engineers bringing up Port 2 on a new D4-450 installation, the recommended commissioning sequence is:

  1. Place the CPU mode switch in Stop.
  2. Set the Port 2 DIP switches for the desired electrical mode (RS-422 4-wire, RS-485 2-wire, or RS-485 4-wire).
  3. Open DirectSOFT, select PLC > Setup > Port 2 Setup, choose protocol, baud, parity, stop bits, and station address, and click OK.
  4. File > Save Project, then PLC > Transfer > Write Project to the CPU.
  5. Place the mode switch in Run.
  6. In Data View, read V774 and V775 to confirm the values match the setup dialog.
  7. From a terminal or Modbus master on the RS-422 / RS-485 bus, send a known request and confirm a response at the new baud rate and station address.
  8. Record the V-memory image (V772-V775) in the project documentation so future firmware updates can be sanity-checked against the expected values.

Cross-Reference: Related D4-450 Resources

Engineers integrating Port 2 into a multi-drop RS-485 network should also review the D4-450 user manual chapter on communication ports and the DirectSOFT help file for the PORT2 setup dialog. Key cross-references include the station address (a separate V-memory byte outside the V772-V775 pair), the ASCII terminator configuration for ASCII In / Out protocols, and the timeout value for DirectNET master mode. The official comportsetup page is the authoritative source for the bit-level encoding summarized above.

FAQ

What are the correct V-memory addresses for Port 2 setup on a D4-450?

Per the AutomationDirect com port setup documentation, Port 2 setup data is stored in V774 (protocol and options) and V775 (baud, parity, stop bits, data bits). V772 and V773 hold the equivalent data for Port 1. V767 is the shared setup-complete trigger word and is written with decimal 76 to commit a new configuration.

Why does V774 update but V775 not change when I modify Port 2 in DirectSOFT?

Most commonly the DirectSOFT project was not re-compiled, or the CPU was in Run mode when the PLC Setup was written, so only the protocol byte in V774 was committed while the baud / parity byte in V775 was rejected. Place the CPU in Stop, re-save the project, re-write to the CPU, and cycle power; V775 will then reflect the new baud and parity.

Can I change Port 2 parameters from ladder logic at runtime?

Yes. Write the desired protocol and options to V774 and the baud / parity to V775, then pulse V767 with the decimal value 76 on a single scan. The CPU re-initializes the port hardware from the new values within one port-driver tick and the new parameters remain active until the next trigger, power cycle, or mode change.

Do V772-V775 survive a power cycle without a battery?

Yes. Port setup values are stored in a dedicated non-volatile area of the D4-450 that is independent of the V-memory battery. A dead battery clears data V-words but leaves the port setup intact, so comm parameters do not need to be re-entered after a battery replacement.

Is the D4-450 Port 2 electrically RS-232, RS-422, or RS-485?

Port 2 is software-selectable between RS-422 and RS-485 (both 4-wire and 2-wire). The selection is made by the DIP switches on the CPU face, not by V-memory. RS-232 is available on Port 1 only. The V-memory duplex bit in V774 must match the DIP switch position or the port will not communicate reliably.

Back to blog