The structure of all NuDAM commands is:
(LeadingCode)(Addr)(Command)[Data][Checksum]<CR>
Guidebook: such as $(read configuration), # (output),% (set configuration),~(watchdog related)
Address: Two digit hexadecimal (00~FF)
Command code: such as 2-read configuration, 6-read input, M-read module name
Checksum (optional): When enabled, accumulates and takes the lower byte of the ASCII code for all characters (including boot code, address, command, data), represented in two hexadecimal digits
Example (verification disabled): $302<CR>configuration for reading address 30.
Response:! 30400600<CR> —— ! Indicates validity, 30 is the address, 40 is the digital I/O type, 06=9600, 00=check off.
2. Digital output control
ND-6050/6060/6063 single module output:
All channels: # (Addr) 00 (OutData)<CR>, such as # 300003<CR>, set channel 0 and 1 at address 30 to 1 (the rest to 0).
Single channel: # (Addr) 1X (0/1)<CR>, such as # 301201<CR>, set channel 2 to 1 (address 30).
ND-6056 (high and low byte separated):
All: # (Addr) T (OutDataH) (OutDataL)<CR>, high bytes correspond to 14~8, low bytes correspond to 7~0.
Single port: # (Addr) H (Data)<CR>or L (Data) respectively controls high/low bytes.
Single channel: # (Addr) H (ChNo) (Bit)<CR>, for example, # 30H31 sets channel 11 (H=high byte, 3 represents channel 11) to 1.
ND-6058 (three ports A/B/C):
Similar to the above, port identifiers are 0A, 0B, 0C, and single channel commands are # (Addr) A (ChNo) (Bit), etc.
Note: If a port of ND-6058 is set to input mode, the output command will be ignored.
3. Digital input reading
General command: $(Addr) 6<CR>. The response formats of each module are different:
6050:! (DataOut) (DataIn) 00- Simultaneously read back the output status and input value.
6052:! (DataIn) 0000- Input value (8-bit).
6053:! (DataInH) (DataInL) 00-16 bit input.
6054: Same as 6053.
6056:! (DataOutH) (DataOutL) 00- Read back the output status (actual output value).
6058:! (IOFlag) (DIn) (DataA) (DataB) (DataC) - Contains pattern flags, 4-bit dedicated inputs, and three port data.
6060:! (DataOut)(DataIn)00。
6063:! (DataOutH)0000。
4. Synchronous sampling function (multi module synchronization)
For scenarios where multiple module input values need to be read simultaneously, the synchronous sampling command # * *<CR>(unresponsive) can be used. This command will trigger all synchronized modules on the network to simultaneously latch the current input value. Subsequently, send $(Addr) 4<CR>to read the latch data one by one, and the status bit (first digit) in the response indicates whether the data is being read for the first time (1 indicates first time, 0 indicates read already). This mechanism effectively avoids the time difference caused by polling and is suitable for time alignment of analog or high-speed digital events.
Watchdog timer - the core guarantee for system self-healing
The NuDAM module has two levels of watchdogs:
Internal hardware watchdog (fixed for 150ms): monitors the MCU operation of the monitoring module itself. If timeout occurs due to interference or software runaway, the module will automatically reset and the output will return to the safe value (default power on state).
Host programmable watchdog: The timeout period (100ms~25.5s, step size 100ms) is set by the user. When the host does not send the "Host is OK" command (~* *<CR>) within the timeout period, the module automatically switches all digital outputs to the preset "safe value" to prevent actuator misoperation after the host crashes.
Set host watchdog and security values (taking ND-6050 as an example)
Command format:~(Addr) 2 (Flag) (TimeOut) (SafeValue)<CR>
Flag: 0=disabled, 1=enabled
TimeOut: hexadecimal 01~FF, multiplied by 100ms for actual timeout
SafeValue: Two hexadecimal digits, each corresponding to an output channel, with 1 indicating that the channel outputs a high level (or a relay is engaged)
Example:~0621121C<CR>
Address 06, enable watchdog, timeout=0x12=18 × 100ms=1800ms, safety value 0x1C (binary 00011100, where channels 2, 3, and 4 are high and the rest are low).
For multi byte output modules (6056/6058), the security values are specified by high and low bytes or three ports respectively, and the corresponding command format is~ .. (SafeH) (SafeL) or~ ... (SafeA) (SafeB) (SafeC).
Host "feeding dog" operation
After the watchdog is enabled, the host must periodically send~* *<CR>(no response) within the timeout period. This command takes effect simultaneously for all modules, so the host only needs to broadcast once to reset the watchdog timer for all modules. If the host stops sending due to a malfunction, each module will independently switch to its own safe value to ensure that the on-site equipment is in a controllable state.
View current watchdog settings
Use~(Addr) 3<CR>to read the current enabled status, timeout value, and security value for verifying the configuration.
Key points of wiring and anti-interference
1. RS-485 network topology
Using shielded twisted pair cables, it is recommended to match the terminal resistance (120 Ω).