serial-port

Qt serial port: write and read data

廉价感情. 提交于 2019-12-11 14:26:44
问题 I'm able to connect to my serial port, but I need to read data from it all the time. It's working for about 39 minutes, but after it stops at line serial.flush() . When I stop Qt and start it again it also stops at serial.flush() . I need to restart my modem to let it work again... I'm not sure I'm executing this properly... // Open Serial connexion QSerialPort serial; serial.setPortName("usbserial-26214A"); serial.open(QIODevice::ReadWrite); serial.setBaudRate(QSerialPort::Baud115200);

Cross-thread InvalidOperationException while trying to access SerialPort dynamically

血红的双手。 提交于 2019-12-11 14:17:05
问题 I have multiple serial devices connected to my PC and I am working on a program that allows users select as many as ports they want and then the program will dynamically creates TabPage and adds them to TabControl . Each tab page will also have a multiline TextBox that will show the incoming data from the assigned serialport to it. Here is my code that tries to create these controls dynamically: private void AddSerialPort(string portName) { ActiveSerialPorts.Add(portName); if (

Reinstate Virtual Com Port after using libftdi on FT232RL

ε祈祈猫儿з 提交于 2019-12-11 13:58:55
问题 I'm trying to use libftdi to toggle some pins on an ft232rl, then use the regular Virtual Com Port (/dev/ttyUSB0). I've got a microcontroller (LPC1114) connected to an FT232RL for programming. To get it into ISP mode, it has to be reset with one line held low, and to execute code after programming, it has to be reset. I'm trying to automate this with the ft232. I've got libftdi working, and toggling pins correctly, but once the program finishes, the VCP has disappeared from /dev. Even using

Maximize Arduino serial output

给你一囗甜甜゛ 提交于 2019-12-11 13:47:41
问题 There are a multiple questions intersperced throughout this post. Kindly read carefully and answer the pieces you can for an upvote. Use Case Create a time series csv file of pressure reads. These reads need to be of maximum frequency, but I only need it to last less than 10 seconds or so. Material Arduino Uno Clone (unalterable) serial over USB 2.0 (alterable) pyserial (Python 3) SSD Problem Identify and fix the bottleneck preventing frequency from maximum reads/s. The code Arduino void

Handle serial thread event in WPF GUI class

旧时模样 提交于 2019-12-11 13:41:31
问题 I have a serial port class, and I would like to control send/receive via my GUI, and have the GUI update based on receipt of data from the serial port (or other events). So the two relevant classes are the serial class and the main window class. I have the code below which compiles, but I get an exception when I try to run. public class MySerThread { public SerialPort serport; public event SerialDataReceivedEventHandler newSerData; public MySerThread() { serport = new SerialPort("COM1",

pySerial can write, but not read

若如初见. 提交于 2019-12-11 13:39:52
问题 I am trying to use pySerial on a Windows 10 machine (Python 3.6.4, 32 bit) to read serial data from a piece of lab equipment that would normally log its data to a serial ASCII printer. Connecting using a USB-to-serial adaptor. If I connect the computer to the printer, I can print using serial.write(), so I know my adaptor is working. However, when I connect the computer to the lab equipment and try to read data using the following code, I get nothing all: import serial ser = serial.Serial(

How to change this code to read all data from serial port in one part (not 2 part)?

放肆的年华 提交于 2019-12-11 13:09:14
问题 This code is reading data from RFID module(EM-18) .I have a big problem here. When my application was running and I was passing RFID card from em module, It was reading data in 2 part. First read 8 byte's card ID then send 4 bytes. Like this: [root@FriendlyARM /fgit]# ./RFIDMonitor -qws enter the port name: ttySAC3 open_port: succesfully open port open_port: succesfully open port RFID MONITORING => '010B7528' RFID MONITORING => '297E' RFID MONITORING => '010B7528' RFID MONITORING => '297E' I

Disable RTS/DSR Handshaking while keeping lines high in PySerial

橙三吉。 提交于 2019-12-11 12:43:45
问题 I'm using PySerial to read serial messages form a device. The device communicates in TTL. The TTL->RS-232 converter (which is then emulated on its USB input) requires DSR and RTS lines be high to receive power. So I attempt to send data: import serial port = serial.Serial(arguments...,rtscts=True,dsrdtr=True) port.write(b'Hello World) This script will hang forever (or I've never seen it exit). I'm assuming this is because my handshaking lines are dictating I currently can't send a message. Is

Serial communication using commConneciton API in j2me

你离开我真会死。 提交于 2019-12-11 12:40:22
问题 I have develop one j2me application for Centrino chip. That chip connected to one EZ power meter. I want to read data from EZ meter over serial communication RS-232 using Modbus protocol. I have some code for send Modbus request for read Holding Register. //declare variable here CommConnection commConn; InputStream inStream; OutputStream outStream; // here open com port using commconnection String strCOM = "comm:COM1;baudrate=9600;bitsperchar=8;stopbits=1;parity=even;blocking=on;autocts=off

Opening a COM port in QBasic on Windows 7

孤人 提交于 2019-12-11 12:29:20
问题 I'm having difficulty opening a COM port in QBasic (obtained from www.qbasic.net) like so OPEN "COM4:9600,N,8,1,BIN" FOR OUTPUT AS #1 However when I execute this statement in QBasic the open keyword is highlighted and I get the error message Bad file name . 回答1: Is Com4: one of the available serial ports? Look in control panel and make it is one of the available ports. Also, you must make sure no other programs have the port open. 回答2: The following works FreeBasic Open Com "COM1:9600,N,8,1"