NCD Device Communications Quick Start Guide
2012-08-29
: Controlanything Device Communications Quick Start Guide Device_Communications_Quick_Start_Guide QSG
Open the PDF directly: View PDF .
Page Count: 2
This manual will guide you through the setup and use of all Reactor Series relay controllers. Following this manual in the sequence outlined is absolutely essential to proper understanding and use of
Reactor Series Controllers. Please review the entire manual BEFORE contacting NCD technical support. NCD technical support staff will direct your questions to this manual when applicable.
Communicang with NCD Device Command Sets
Copyright © 2012
Naonal Control Devices
All Rights Reserved.
NOTICE: Porons of this Manual REQUIRE Internet Access
Device
Communicaons
Quick Start Guide
Incomplete DocumentationIncomplete DocumentationIncomplete Documentation
This manual will guide you through the setup and use of all Reactor Series relay controllers. Following this manual in the sequence outlined is absolutely essential to proper understanding and use of
Reactor Series Controllers. Please review the entire manual BEFORE contacting NCD technical support. NCD technical support staff will direct your questions to this manual when applicable.
Page 2 Quick Start Guide: Device Communicaons
Device Communicaons
Regardless of the Communication technology you have chosen to use, all NCD Devices have a command set. This
command set can be used to control relays, program settings, read the status of inputs, read the status of relays, and
much more. This command set forms the basis for which all NCD devices interact with your favorite interface
technology.
NCD Controllers are always waiting for the user to send a command. When the command has finished execution, the
controller sends back a confirmation. For instance, if you want to turn on the first relay, you can send the following
command:
254 Enters Command Mode
108 Activates the First Relay
1 Applies this command to bank 1 of the relay controller
When the controller has finished executing the command, the controller will send back a confirmation byte. In the case
of command 254, 108, 1 the controller will send back an 85 to let you know that it has finished turning on the first relay
and it is ready for the next command.
Most of the time, we use decimal values for our command set. Some programmers prefer to use Hexadecimal format,
which is easy to translate. If you prefer to use Hex, then simply translate the decimal values to Hex format. In the case
of 254, 108, 1 the Hex format would be 0xFE 0x6C 0x01 (with a confirmation byte of 0x55).
We will designate the command instructions in the following format throughout our guides:
Send Bytes: Byte 1: Byte 2: Byte: 3
Function: Command Activate Relay Bank
Decimal Values: 254 108 1
Hex Values 0xFE 0x6C 0x01
Receive Byte: Decimal: 85
Hex: 0x55
COMM Operator Examples:
254 108 1 Turn on first relay
NCD Component Library Command Method:
Not Yet Implemented
There is one very important rule that should be followed during communications using this method. Before
sending a command to the controller, it is absolutely essential that you clear the serial receive buffer. If you do NOT
clear the serial receive buffer, you will invariably run into the problem of unreliable or unexpected results. Data tends to
pile up in the Serial Receive Buffer, and when you ask the buffer for data, there’s a pretty good chance you will be read-
ing old data if you do not clear the buffer. Because of this, we highly recommend all users to follow this procedure when
communicating to any NCD device:
1. Clear the Serial Receive Buffer
2. Send a Command
3. Wait for a Response
If your software is written to follow these rules, you will be rewarded with software that stays in reliable communications
with the device. If you skip any of these rules, your software will appear to have bugs that cannot be resolved.