On this page
Keyence MC ASCII
KEYENCE MC is compatible with 3E ASCII address read and write driver
Compatible devices and models
| Device series / model examples | Connection requirements |
|---|---|
| KV-7500, KV-5500 (built-in Ethernet) | Enable MC protocol QnA-compatible 3E frames and match the selected plugin ASCII/binary encoding, TCP/UDP transport and port. Use the KEYENCE MC device map; Upper Link addresses such as DM cannot be used unchanged. |
| KV-7500/7300, KV-5500/5000/3000 + KV-EP21V | Use the KV-EP21V MC 3E service. KV-5500/5000/3000 require CPU function version V2 or later. Match encoding, port and device mapping to the module settings. |
| KV Nano: KV-N24, KV-N40, KV-N60, KV-NC32T + KV-NC1EP | Use CPU function version V2 or later and enable MC 3E through KV-NC1EP. Check the CPU device ranges. Upper Link services use the separate Nano plugin. |
Enable ASCII MC in KV STUDIO
This entry sends QnA-compatible 3E ASCII frames. It uses the same MC device mapping as Keyence MC Binary, with a different wire encoding. Upper Link commands belong to the separate Nano entry. See Collection configuration for shared scheduling and permissions.
-
Open the project matching the CPU and Ethernet unit. Choose Tool → Unit Editor and add the actual KV-EP21V, or open the built-in Ethernet settings. The manual specifies KV STUDIO V8.0 or later for KV-7500/7300.
-
Open the unit, reserve non-overlapping leading DM/relay ranges, and configure a fixed IP, mask and gateway. For a built-in interface, double-click the CPU under Unit configuration and open Set unit. The KV STUDIO 11.62/KV-8000 window below shows IP 192.168.1.22 and MC TCP port 5000. This gateway example uses 192.168.1.31; use the settings read back from your actual model. Source: Mech-Mind Keyence MC setup guide .
-
Check the MC protocol TCP port, default 5000, and set MC protocol communication code to ASCII. Port 8500 belongs to KV STUDIO and 8501 to Upper Link. UDP has its own MC port; Simple PLC Link UDP 5001 is a different service.
-
Save/transfer the configuration, apply or restart communication as required, and read back the settings. Connect the actual LAN port and gateway to the intended network and check addressing before enabling acquisition.
KV-EP21V/KV-NC1EP settings are in chapters 3 and 9 of the KEYENCE Ethernet Unit manual . Nano MC access through KV-NC1EP also requires the matching CPU function version and Nano device ranges.
Use PLC transfer → Monitor mode to open the transfer window. Check the target CPU and unit/Ethernet settings, then transfer according to the project change procedure, preserving the PLC program and variables.
Configure the gateway channel and device
Create a TcpClient to the actual MC listener, for example 192.168.1.31:5000. Select the complete Keyence MC ASCII plugin name and associate that channel.
UdpSession, SerialPort and TcpService are also selectable. Use matching UDP settings for UDP; serial requires a transport that forwards these MC frames, rather than the KV programming-port protocol. TcpService requires a peer that initiates the connection.
| Property | Meaning and selection |
|---|---|
| Network number | Default 0; the KV manual requires fixed 00, not the last IP octet. |
| Module station | Default 0, the KV target route value; not a port or CPU model. |
| Module I/O number | Default 1023/0x03FF; the MC target module identifier, not an input address. |
| PLC number | Default 255/0xFF. Keep the complete route at 0/0/1023/255. |
| Maximum pack length | Default 256. Same-area read-span budget; WORD areas count 16-bit words. Int32/Float use two words, Int64/Double four, and gaps consume span. A reduced budget must still fit each complete variable. |
| Read/write timeout | Default 3000 ms. Resolve framing, address and peer error codes before extending the wait. |
| Frame delay | Default 0 ms before each send; distinct from the device acquisition interval. |
| Reverse string bytes in WORDs | Off by default. Swaps two character bytes in each WORD according to the PLC layout; unrelated to ASCII frame encoding. |
| Data order | Default DCBA, with ABCD/BADC/CDAB alternatives. Compare known 16-bit and then 32-bit values. ASCII numeric text on the wire does not make this a character-encoding selector. |
| Retry count | Default 3. Retries cannot correct an unsupported address or service. |
| Read/write duty | Default 3, minimum 1; one read after n writes, not a percentage. |
| Write priority | Off by default; enabling allows writes to cancel current reads. |
Map KV devices to variable addresses
Prepare DM100=1234 in the KV STUDIO watch. Add D100, Int16, array length 1, read-only in the gateway. This entry expects MC names and does not accept DM100 directly.
Open Field editor and set area D, offset 100, without a bit number for a numeric value.
| Address field | Rules and examples |
|---|---|
| Device area | D/SD/R/TN/CN are decimal WORD areas; ZR/W are hexadecimal WORD areas. X/Y/B use hexadecimal bit numbering; M/L/SM/TS/TC/CS/CC use decimal bit numbering. Check the CPU-specific range. |
| Offset | Area-relative start, encoded in up to three bytes. Do not multiply WORD numbers by two or add 40001. |
| Bit | Boolean access to a WORD needs explicit 0–15, such as D100.3. M100 and XA3 already address bits and reject .0. |
| Data order override | Per-variable conversion such as D100;data=DCBA; does not change ASCII framing. |
| Encoding override | String character encoding only, such as ASCII/UTF-8; does not switch MC Binary/ASCII. |
| String byte length | D100;len=8 occupies four WORDs. Array length counts elements rather than string bytes. |
| BCD override | Use only for actual BCD/Gray-coded data. Leave ordinary binary integers unset. |
| Variable string length | Enable only when the source layout includes length information; it does not discover a character buffer’s capacity. |
There are no plugin-specific variable properties. Selectable types are Boolean, Byte, Int16, UInt16, Int32, UInt32, Int64, UInt64, Float, Double, String and Decimal; match the source width and device area.
| Source object | Gateway address and type |
|---|---|
| DM100=1234 | D100, Int16; use UInt16 for unsigned data. |
| DM100 bit 3 | D100.3, Boolean; DM100=8 yields true. Bit writing within a WORD can read/modify/write and conflict with PLC logic. |
| EM100 on larger KV families | D100100; the Nano mapping does not provide EM. |
| FM100 | R100; MC R is a file register, not the native KV R relay. |
| Native KV R word 10, bit 3 | Absolute bit 163=0xA3; use the documented XA3 or Y mapping, rather than R01003. |
| T10/C10 contacts | TS10/CS10, Boolean. |
| T10/C10 current values | TN10/CN10, UInt16. MC exposes 16 bits here and returns 65535 for an out-of-range native value. Int32 cannot recover a native 32-bit timer value. |
Compare values and diagnose communication
Check the saved device, D100 address, Int16 type and length 1. Enable the channel/device and compare against KV STUDIO; changes to source DM100 should update the live value and acquisition timestamp.
For a local comparison using the HSL 13.0.3 MC server, select ASCII mode, listen on 127.0.0.1:15027, and set D100=1234. Use that listener in the gateway and keep D100/Int16.
For a connection without valid responses, check the listener’s ASCII mode. Inspect complete ASCII responses in Protocol debug → Messages: C051 calls for checking point counts, C056 address ranges, and C059 supported commands. String encoding overrides cannot repair a Binary/ASCII frame mismatch.










