I am using Mplab x Ide with v3.61 on Xc8 compiler, PIC18F24K40. I used MCC generated UART code for send and receive data. For understanding I am clubling my code and posting part of it. My main code look like this #include "mcc_generated_files/mcc.h" #define EUSART_TX_BUFFER_SIZE 8 #define EUSART_RX_BUFFER_SIZE 8 /** Section: Global Variables */ volatile uint8_t eusartTxHead = 0; volatile uint8_t eusartTxTail = 0; volatile uint8_t eusartTxBuffer[EUSART_TX_BUFFER_SIZE]; volatile uint8_t eusartTxBufferRemaining; volatile uint8_t eusartRxHead = 0; volatile uint8_t eusartRxTail = 0; volatile uint8_t eusartRxBuffer[EUSART_RX_BUFFER_SIZE]; volatile uint8_t eusartRxCount; #define LED_RX RC7 // Pin assigned RX LED #define LED_TX RC6 // Pin assigned …

Member Avatar
Member Avatar
+0 forum 2

Hello, I'm trying to read a serial port data from a controller and plot it using chart. I could read the data from the controller and see the data in a textbox earlier. Now I'm trying to use a chart along with the textbox. There are complication when I'm trying to use both together. I get an exception because I'm trying "data = sp.ReadLine();" for chart. I'd like to keep the textbox just to verify what I'm plotting, but I understand that I can also do that using putty. There's no response even when I use only the chart to …

Member Avatar
Member Avatar
+0 forum 4

i use vb.net 2012 and a pin terminal on serialport. Everthing works fine (sending en receiving), i want that the communication stop after 500 milliseconds if there no reaction from the terminal , reason pin terminal stopped or serial cable loose . How can i achieve this? This is code i have So far, but code does not work: Imports System.IO.Ports Imports System.IO Imports System.Threading Public Shared Sub Main() Dim mySerialPort As New SerialPort("COM1") mySerialPort.BaudRate = 9600 mySerialPort.Parity = Parity.Even mySerialPort.StopBits = StopBits.One mySerialPort.DataBits = 7 mySerialPort.Handshake = Handshake.None mySerialPort.ReadTimeout = 500 mySerialPort.WriteTimeout = 500 mySerialPort.RtsEnable = False mySerialPort.NewLine = …

Member Avatar
+0 forum 0

Hi. My company makes use of Motorola scanners to scan barcodes into the system through a C# application. A driver (Symbol COM Port Emulation Driver v 1.8.5) has been installed on the computers to make the scanner behave as simple COM Port Emulation and when the barcode is scanned, we are able to capture the text serially through the serialPort_DataReceived event. The application works fine on Windows XP and but does not work on Windows 7 64 bits as the Symbol COM Port Emulation Driver is not compatible. I have contacted Motorola for support and the response was to send …

Member Avatar
Member Avatar
+0 forum 1

iam new to c# and trying to work out on serial communication using timer i can send and receive the data but during printing of the received data the incoming data is overlapped on the previous data.. Please help me in advancing....and my code is as follows...` int nDataLen = newSerialport.ReadBufferSize; int nLeng = newSerialport.BytesToRead; if (nLeng != 0) { newSerialport.Read(chRead, 0, 20); for(int i=0;i<20;i++) stRecvData = System.Text.Encoding.UTF8.GetString(chRead); //textBox_Recv.Text = stRecvData; } else { ; } textBox_Recv.Text = stRecvData;`

Member Avatar
+0 forum 0

hi, i'm using winwedge to link up a balance to a computer, in order to gather the readings into an excel sheet. i've writen the code that starts winwedge at the press of a button, and created the macro that is supposed to request readings and send them to the excel sheet. Winwedge is configured to request excel to run the macro whenever a reading is sent. When i initiate winwedge and send data from the balance, it is displayed by winwedge but excel gives an error saying the macro is unavailable or disabled. If i run the macro manually …

Member Avatar
+0 forum 0

I'm a beginner in programming, and I'm doing a project that requires continously getting an input from the Serial Port. I already used the SerialPort class to retrieve the data and use it in my programm, and now I want to write those same SerialPort values (splitted into array[0]....array[7]) into .CSV Please, I need help

Member Avatar
Member Avatar
+0 forum 4

I am using the Comm API, i have made a small desktop app for sending sms. I cannot send sms one after the other since it gives "Port In Use Exception". I have closed the Input and output streams as well as the serial port but still it gives "Port in Use Exception". Can anybody help me with this please?

Member Avatar
Member Avatar
+0 forum 2

The End.