====== MPINO STUDIO 2 Phase 6 · Serial and Ladder Monitoring ====== This page explains how to view data sent and received by Arduino Code in the Serial Monitor and how to inspect contact, coil, memory, and power-flow states with ladder monitoring. {{ :en-us_products:mpino_studio2:monitoring-overview.svg?1000 |Two monitoring paths for Arduino Code serial data and ladder-logic states }} ===== 1. Serial and Ladder Monitoring ===== The two features inspect different data and present different results. ^ What you need to inspect ^ Feature ^ What the screen shows ^ | Output from ''Serial.print()'' and data sent from the PC | Serial Monitor | Text or HEX bytes | | Ladder contacts, coils, memory, and power flow | Ladder monitoring | ON/OFF states, live values, and energized color | Use the Serial Monitor to inspect data exchanged by Arduino Code through a board serial port. Use ladder monitoring to inspect the internal state of the ladder logic running on the board. ===== 2. Connect the Serial Monitor ===== - Choose the PC serial port under **Select port** at the right of the status bar. - Select **Serial Monitor** on the Activity Bar, or open the **Serial Monitor** tab in the bottom panel. - Select the same baud rate used by ''Serial.begin()'' in Arduino Code. - Select the receive encoding, then choose **Connect**. - Confirm that the state changes to **Connected**. {{ :en-us_products:mpino_studio2:serial-monitor-connect-marked.svg?1000 |Serial Monitor marked with the target port, baud rate, encoding, and Connect button }} * **1** Target port: The PC serial port selected on the status bar. * **2** Baud rate: Select the value used by ''Serial.begin()''. * **3** Encoding: Select how received bytes are decoded as text. * **4** Connect: Connect, disconnect, and check the reconnecting state. The receive encodings are **UTF-8**, **EUC-KR (Korean)**, **Shift-JIS (Japanese)**, **Latin-1 (ISO-8859-1)**, and **Windows-1252**. The default is UTF-8. Encoding affects received data in ASCII view only; it does not affect HEX view or transmitted data. Changing the baud rate while connected does not update the active connection. Select **Disconnect**, then connect again. If the selected rate differs from ''Serial.begin()'', text may be garbled or no data may appear. ===== 3. Receive and Send Data ===== The following code sends a counter value once per second and resets it to zero when the PC sends ''R'' or ''r''. unsigned long previousMillis = 0; int count = 0; void setup() { Serial.begin(9600); // Set the Serial Monitor to 9600 baud as well. Serial.println("Counter ready. Send R to reset."); } void loop() { if (millis() - previousMillis >= 1000) { // Send a value once per second. previousMillis = millis(); count++; Serial.print("count = "); Serial.println(count); } if (Serial.available() > 0) { // Read data received from the PC. char received = Serial.read(); if (received == 'R' || received == 'r') { count = 0; Serial.println("-- reset --"); } } } Build and upload the code, then connect the Serial Monitor at 9600 baud. ''count = 1'', ''count = 2'', and later values appear once per second. Enter ''R'' and press ''Enter'' or **Send** to see ''> R'' followed by the board response ''-- reset --''. {{ :en-us_products:mpino_studio2:serial-rx-tx.svg?1000 |Serial Monitor receiving counter values, sending R, and receiving the reset response }} ==== ASCII and HEX Views ==== ASCII view decodes received bytes as text with the selected encoding. HEX view shows the same data as two-digit uppercase bytes separated by spaces, such as ''41 42 0D 0A''. {{ :en-us_products:mpino_studio2:serial-ascii-hex.svg?1000 |The same serial data displayed as ASCII text and HEX bytes }} Switching the view clears the previous receive buffer and begins displaying data in the new mode. The button names the mode you will switch to, rather than the current mode. ==== Line Endings ==== Use the selector beside the input field to choose the bytes appended to transmitted data. ^ Selection ^ Appended bytes ^ Use when ^ | None (no LE) | None | Send only the entered data | | Newline (LF) | ''0A'' | The code waits for ''\n'' | | Carriage Return (CR) | ''0D'' | The code waits for ''\r'' | | Both NL & CR (CRLF) | ''0D 0A'' | The code waits for ''\r\n'' | {{ :en-us_products:mpino_studio2:serial-line-ending.svg?1000 |Bytes appended by None, LF, CR, and CRLF line-ending settings }} Text entered in ASCII view is always transmitted as UTF-8. In HEX view, enter raw bytes such as ''52'' or ''52 0D 0A''. ''520D0A'' without spaces is also accepted. Input containing a non-hexadecimal character or an odd number of digits is not sent. **Copy** copies the entire current receive buffer to the clipboard. **Clear** empties the displayed buffer without disconnecting. ===== 4. Configure Ladder Monitoring ===== The project sends ladder-monitoring data through the selected board communication channel. Select the channel first, then rebuild and upload the project to apply the change to the board. {{ :en-us_products:mpino_studio2:monitoring-setup-flow.svg?1000 |Monitoring port selection followed by build, upload, and monitoring }} - Open **File → Preferences → Ladder Settings → Monitoring Port**. - Select the board communication channel connected to the PC. - Build and upload the project again. - Select the corresponding PC serial port on the status bar. {{ :en-us_products:mpino_studio2:monitoring-port-setting-marked.svg?1000 |Selecting the Monitoring port under Ladder Settings }} Only channels available on the selected board appear in the list. Selecting **Off** prevents the firmware from generating ladder-monitoring data. The available ''Serial'', ''Serial1'', and ''Serial2'' entries follow the communication channels defined for the selected board. MPINO-8A4R(T)-S shows **Off**, ''Serial'', and ''Serial1''. If you start monitoring after changing the channel but before uploading, an upload notice appears. Select **Upload** to apply the new channel to the board. {{ :en-us_products:mpino_studio2:monitoring-upload-needed.svg?1000 |Notice that the monitoring channel change requires an upload }} > **Port conflict:** Monitoring data conflicts with project communication or Arduino Code that uses the same board channel. If a conflict notice appears, select a dedicated monitoring channel or change the communication settings and code using that channel. ===== 5. Start and Stop Ladder Monitoring ===== After setting the port and uploading, start or stop ladder monitoring in any of these ways: * The **Monitoring** button in the Serial Monitor header * **Monitoring ON** or **Monitoring OFF** on the ladder context menu * ''Ctrl + M'' {{ :en-us_products:mpino_studio2:monitoring-toggle-methods.svg?1000 |Three ways to toggle monitoring: the Serial Monitor button, ladder context menu, and Ctrl M }} Shortcuts can be changed under **File → Preferences → Keyboard Shortcuts**. If **Monitoring port** is **Off**, the **Monitoring Port Required** notice opens. Select **Open Preferences** and complete the settings in section 4. {{ :en-us_products:mpino_studio2:monitoring-port-required.svg?1000 |Notice shown when no monitoring port is configured }} If no PC serial port is selected, choose one on the status bar and start monitoring again. When monitoring starts, the button and context-menu state change to ON. Stopping monitoring closes the connection and removes live indications from the ladder. ===== 6. Read Ladder States ===== While monitoring is on, the ladder shows both power flow and live cell values. {{ :en-us_products:mpino_studio2:ladder-monitoring-live-marked.svg?1000 |Ladder monitoring marked with box-function, word, timer, and comparison values }} ^ Cell type ^ What to inspect ^ | Bit contact or coil | Yellow power-flow indication and ON/OFF state | | Box function | Live value of the target address inside the box | | Word memory | Numeric live value below the cell | | Timer or counter contact | Energized state of the done condition | | Comparison contact | Live values on both sides and the comparison result | | Address entered in an empty cell | ON/OFF for a bit address or the live numeric value | * **1** Box-function value: Inspect the live timer, counter, or calculation target inside the box. * **2** Word value: Inspect D, C, T, and similar values below the cell. * **3** Timer value: Inspect a timer address in time units or as a number. * **4** Comparison values: The live operands appear below the contact, and power flow shows the comparison result. If the board stops or the connection is lost, the last received values and power-flow indication may remain on screen. The time-driven ''@F'' special bit stops flashing in this state. When values stop changing, check the monitoring connection first. ===== 7. Display Formats ===== Right-click a ladder cell to select the format used for live numeric values. A check mark identifies the selected format. {{ :en-us_products:mpino_studio2:monitoring-number-formats.svg?1000 |One 16-bit value displayed in five number formats }} ^ Format ^ Interpretation ^ | Signed Decimal | Display the value as a signed decimal number for its data type | | Unsigned Decimal | Interpret an integer bit pattern as an unsigned decimal number | | Hexdecimal | Display the bit pattern as hexadecimal beginning with ''0x'' | | Binary | Display the bit pattern as binary beginning with ''0b'' | | Floating Point | Interpret a 16-bit integer as half precision or a 32-bit integer as single precision | The image compares one 16-bit value. A 32-bit value uses eight digits in Hexdecimal and 32 digits in Binary. R memory is displayed from its stored 32-bit floating-point value. The format is a global setting for all projects on this PC, rather than a setting for one cell or project. It persists after restarting the application. The default is **Signed Decimal**. ==== Timer Live Values ==== When a timer preset uses time syntax such as ''TON T0 1m10s'', Signed Decimal displays the live value with time units such as ''1m10s'', ''43s210ms'', or ''500ms''. A numeric preset produces a numeric live value. {{ :en-us_products:mpino_studio2:monitoring-timer-format.svg?1000 |Comparison of timer live values for a numeric preset and a time-syntax preset }} Selecting a format other than Signed Decimal displays the timer value in that number format instead of time syntax. Counter presets do not use time units. ==== Comparison Contact Values ==== During monitoring, a comparison such as ''D0 > D1'' shows live operands such as ''5 > 3'' below the contact. Binary values wrap onto multiple lines; the other formats use one line. {{ :en-us_products:mpino_studio2:monitoring-comparison-value.svg?1000 |Single-line comparison values and wrapped Binary comparison values }} ===== 8. Port Sharing ===== The Serial Monitor and ladder monitoring share the one PC serial port selected on the status bar, so they cannot be connected at the same time. {{ :en-us_products:mpino_studio2:monitoring-port-ownership.svg?1000 |Port ownership transitions between the Serial Monitor and ladder monitoring }} ^ Current state ^ Action ^ Result ^ | Serial Monitor connected | Start ladder monitoring | Disconnects the Serial Monitor and starts ladder monitoring at 115200 baud. | | Ladder monitoring active | Connect the Serial Monitor | Stops ladder monitoring and connects the Serial Monitor at the selected baud. | | Ladder monitoring active | Send data | The transmit input is disabled. | | Serial Monitor connected | Start an upload | Disconnects temporarily and reconnects to the same port and baud after the upload. | | Ladder monitoring active | Start an upload | Stops monitoring temporarily and reconnects after the upload. | The baud selected in the Serial Monitor remains unchanged while ladder monitoring connects at 115200 baud. The saved value is used when you reconnect the regular Serial Monitor. If the board is disconnected, the regular Serial Monitor attempts to reconnect up to five times. After a successful reconnect, a reconnect notice is added to the receive buffer. If automatic attempts end without a connection, check the port list and cable, then reconnect manually. If ladder-monitoring values stop, do not wait for an automatic recovery; turn monitoring off and on again. An upload disconnects the active owner first and restores the previous Serial Monitor or ladder-monitoring connection after the upload, whether it succeeds or fails. If neither feature was connected, both remain off. Running a build without uploading does not disconnect them. During ladder monitoring, ''Serial.print()'' output on the same channel at 115200 baud can still appear in the Serial Monitor receive view. Because user data can mix with monitoring frames, use separate channels for Arduino Code communication and ladder monitoring whenever possible. ===== 9. Troubleshooting ===== ^ Symptom ^ What to check ^ Action ^ | **Connect** does not establish a connection. | Status-bar port and current connection state | Select the required PC serial port again and connect. | | The board is missing from the port list. | Cable, USB detection, and port list | Reconnect the cable and reopen the port list. | | Received text is garbled. | ''Serial.begin()'' baud and receive encoding | Select the same baud and match the firmware's character encoding. | | No data is received. | Connection, baud, and whether ''Serial.print()'' runs | Check the Serial Monitor connection and the baud used by ''Serial.begin()''. | | HEX transmission fails. | Hexadecimal characters and an even digit count | Enter ''AB CD 01'' or ''ABCD01''. | | Ladder monitoring cannot start. | Monitoring port and PC port on the status bar | Set the port, rebuild and upload, then select the PC port. | | Monitoring is on but no power flow or values appear. | Upload after changing the port and the physical channel | Rebuild and upload with the new setting, then check the connected channel. | | Values stop changing and the last value remains. | Board operation and monitoring connection | Check board power and communication, then reconnect monitoring. | | ''Serial.print()'' output is not visible. | Channel, baud, and ladder-monitoring state | Connect the regular Serial Monitor, or during ladder monitoring verify that the output uses the same channel at 115200 baud. Sharing the channel is not recommended because data can conflict. | | A monitoring-port conflict notice appears. | Communication settings and Arduino Code using the same channel | Select a dedicated monitoring channel or change the settings and code using that channel. | ===== Related Documentation ===== * [[en-us_products:mpino_studio2:activity_bar|Phase 8 · Activity Bar and Side Panels]] * [[en-us_products:mpino_studio2:menus_settings|Phase 7 · Menus and Preferences]] * [[en-us_products:mpino_studio2:first_project|Phase 1 · Create Your First Project]] — build, upload, and port selection * [[en-us_products:mpino_studio2:memory|Phase 2 · Understand Memory]] — memory types used by monitored values * [[en-us_products:mpino_studio2:ladder_editing|Phase 3 · Ladder Editing Basics]] — contacts, coils, and comparison contacts * [[en-us_products:mpino_studio2:box_functions|Phase 4 · Box Functions]] — timer and counter box functions * [[en-us_products:mpino_studio2:code_editor|Phase 5 · Editing Arduino Code]] — writing the serial example * [[en-us_products:mpino_studio2|MPINO STUDIO 2 User Manual]]