Closed as off-topic by, Oct 24 '16 at 17:51 This question appears to be off-topic. The users who voted to close gave this specific reason:. 'Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, and what has been done so far to solve it.' – Drew, miken32, Machavity, doelleri, SZenC If this question can be reworded to fit the rules in the, please. Blog post import time import serial # configure the serial connections (the parameters differs on the device you are connecting to) ser = serial.Serial( port='/dev/ttyUSB1', baudrate=9600, parity=serial.PARITYODD, stopbits=serial.STOPBITSTWO, bytesize=serial.SEVENBITS ) ser.isOpen print 'Enter your commands below. R nInsert 'exit' to leave the application.'
PureBasic examples for the Windows UD library. The Windows UD library is the high-level Windows library/driver for the LabJack U3, U6 and UE9. Serial communications can be done via either direct to physical serial port connected to the computer or via a USB to serial converter interface. If the device do require a serial port and your computer don’t have any, you can make use of such converters easily.
Input=1 while 1: # get keyboard input input = rawinput(' ') # Python 3 users # input = input(' ') if input 'exit': ser.close exit else: # send the character to the device # (note that I happend a r n carriage return and line feed to the characters - this is requested by my device) ser.write(input + ' r n') out = ' # let's wait one second before reading output (let's give device time to answer) time.sleep(1) while ser.inWaiting 0: out += ser.read(1) if out!= ': print ' + out. #!/usr/bin/python import serial, time #initialization and open the port #possible timeout values: # 1. None: wait forever, block call # 2. 0: non-blocking mode, return immediately # 3.
» » » Using ActiveXperts Serial Port Component with Visual Basic 6.x ActiveXperts Serial Port Component is a software development kit (SDK) that enables the user to communicate to a device over a serial interface. Such a device can be: a weight indicator, a modem, a scanner, or any other device that is equiped with a serial port. It can even be another PC, connected via a NULL modem cable. ActiveXperts Serial Port Component features the following:. Direct COM port support (like 'COM1'). TAPI (Windows Telephony Device) support (like 'Standard 56000 bps Modem');.
Support for RS-232/RS422/RS485, up to 256 simultaneous ports;. Support for all types of Hayes compatible modems;.
Support for serial cable as well as USB cable or Bluetooth connections;. Support for Virtual COM ports (i.e.
COM ports redirected through the network);. Hardware flow control (RTS/CTS, DTR/DSR) and software flowcontrol (XON/XOFF) support;.
Configurable baudrate/parity/stopbits, full buffered data transfer, text/binary data transfer. Step 1: Download and install the ActiveXperts Serial Port Component Download the ActiveXperts Serial Port Component from the and start the installation. The installation guides you through the installation process. Step 2: Create a new Visual Basic project Launch 'Microsoft Visual Basic' from the Start menu, and choose 'New' from the 'File Menu'. The 'New Project' dialog appears. Select 'Standard Exe' and click 'OK': (Click on the picture to enlarge) Step 3: Refer to the ActiveXperts Serial Port Component Library and create the objects A new Project is created, with a blank form.
First, you must add a reference to Serial Port Component in the project to be able to use the object. To do so, choose 'References.' From the 'Project' menu. In the 'References' dialog that pops up, enable the 'Serial Port Component 2.2 Type Library' reference as shown in the following picture: (Click on the picture to enlarge) Click 'OK' to close the 'References.' Then, select the Project form and choose 'View Code' from the context menu: (Click on the picture to enlarge) On top of your code, declare the following object: Public objComport As AxSerial.ComPort Step 4: Create the object From the Code window, select 'Form'. The Private Sub 'FormLoad' will be displayed now. In the 'Form Load' function, create the object in the following way: Set objComport = CreateObject('AxSerial.ComPort') Step 5: Send an AT command to a connected Hayes compatible modem You can now send and/or receive data to and/or from a serial device.
The following code shows how to query a modem: '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ' DO NOT FORGET: ADD A REFERENCE TO THE SERIAL PORT COMPONENT LIBRARY FROM THE PROJECT-REFERENCE '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!