serial-port

Implementing ActiveX Control for web browser

大城市里の小女人 提交于 2020-01-07 08:32:26
问题 My requirement is to develop a ActiveX control which can send the byte stream to serial port. The ActiveX control should expose only one function like SendData(char* data, int nLen, int nPort) This function should be able to be invoked by pressing a button developed in java rendered in Internet Explorer(both 32 and 64 bit). I am confused whether i should go with windowless ActiveX control using MFC/ATL or Browser Helper Objects. In future i may need to support Firefox also. Any help will be

How to send float through serial port in c#? [duplicate]

我与影子孤独终老i 提交于 2020-01-07 06:24:48
问题 This question already has an answer here : how to convert float into binary in c#? (1 answer) Closed 5 years ago . I have two float now,say f1 and f2. I want to send them to my micro controller through my computer serial port, how should I do it? My understanding is we need to convert f1 and f2 to binary first,then send to micro, after that cnvert back to float again. So I am confused that HOW DO I CONVERT FLOAT TO BINARY BEFORE I SEND THEM OUT? My code now is b1 = System.BitConverter

permanent USB port names? (Linux) [closed]

有些话、适合烂在心里 提交于 2020-01-07 04:58:25
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I have two Arduinos now used by my program. SInce I'm on Linux and new to Linux, the port isn't static, like "com3" and "com6", I think it's "ttyUSB0" for the first Arduino which is connected, and "ttyUSB1" for the second and so on. But since both are connected when the OS boots, can I be certain that the port

NModbus4 read TXT from PLC

时光总嘲笑我的痴心妄想 提交于 2020-01-07 02:01:09
问题 I'm programming a Click PLC with a C# application with NModbus4. (RS232) Now i'm trying to read and write TXT data. This is the code and result: When I check the Click PLC software I can see that for each two chars one Modbus address is used. How can I get the text saved in the PLC? Someone got an idea? The text stored in the PLC is "Dit is tekst" 回答1: A Modbus register is 16-bit wide, so it can store two chars. This is why each two chars share the same address. That said, you need to infer

How to know when QSerialPort is ready for more data in Qt5?

。_饼干妹妹 提交于 2020-01-06 23:51:00
问题 Is there some way to be notified when my serial device is ready to receive more data? I am implementing a program that feeds commands to a servo controller over serial using the asynchronous API of QSerialPort. The program works, but it seems that I am experiencing congestion. In my application I keep a registry of most updated servo position that I wish to synchronize with the controller with as low latency as possible. My attempt at pushing new data to the serial port as quickly as time

Read arduino from serial in C

守給你的承諾、 提交于 2020-01-06 19:51:20
问题 I have the following program that tries to read data from an arduino using the serial port, the thing is it mostly doesn't read anything, except sometimes it reads a piece of what I'm sending. The arduino code its just writing a single letter in a loop. #include <cstdio> #include <cstring> #include <unistd.h> #include <fcntl.h> #include <errno.h> #include <termios.h> int main() { int serialfd = open("/dev/ttyUSB0", O_RDWR | O_NOCTTY | O_NDELAY); if (serialfd == -1) perror("Error opening the

ser.write() hex string Raspberry

我的未来我决定 提交于 2020-01-06 14:49:11
问题 I have a problem with sending/reading hex data over RS485. I'm not sure if I send the correct string over the serial port. The hex code is: E1 14 75 81 . I have read that i can write: data = "\xE1\x14\x75\x81" ser.write(data) To check if the correct code is send, I added print(ser.write(data)) But I get this Output back: True 4 ▒ I also want to read the answer of the hex string. For this i only have to added ser.read() Here the ful code: import serial import struct ser = serial.Serial( port='

Free compiler or interpreter for TCL, and TCL serial port (COM1) commands

爷,独闯天下 提交于 2020-01-06 14:36:08
问题 1) Is there any freeware which combine tcl editor and compiler (or interpenter)? 2) After opening of the serial connection (COM1) using fconfigure , how can I send via the connection, a string of several words? I need to connect to some HW and I want to be able running a scripts on its CLI. Thanks 回答1: Is there any freeware which combine tcl editor and compiler (or interpenter)? The Tcl source code is thoroughly openly available. Download and build to get an “interpreter” (actually, it

Java serial comms : way to set receieve threshold when using async. read notification

我只是一个虾纸丫 提交于 2020-01-06 07:21:32
问题 I have some code that's using the JavaComm API. It implements SerialPortEventListener and the reception of characters happens asynchronously. This works fine except that my serialEvent callback is notified after about 17 chars have been received, for my packet parsing I need it to be notified when <= 6 characters have been received. Is there any way to configure the serial API to call the async. notification when a specified no. of characters have been received? Thank you, fred. 回答1: All you

Extract wrong data from a frame in C?

穿精又带淫゛_ 提交于 2020-01-06 06:58:25
问题 I am writing a program that reads the data from the serial port on Linux. The data are sent by another device with the following frame format: |start | Command | Data | CRC | End | |0x02 | 0x41 | (0-127 octets) | | 0x03| ---------------------------------------------------- The Data field contains 127 octets as shown and octet 1,2 contains one type of data; octet 3,4 contains another data. I need to get these data. Because in C , one byte can only holds one character and in the start field of