Asynchronous Serial Communication ActiveX, OCX and COM OLE components for rs-232, rs-422, rs-485. Serial Port I/O control with protocols ZMODEM, YMODEM, YMODEM-G, XMODEM, XMODEM-1K, KERMIT, MODBUS, 3964, RK512, LSV2. Supporting NET, C#, VB Net. Serial Communication ActiveX and components for asynchronous rs-232, rs-422, rs-485 Supporting NET, C#, C-Sharp,VB Net. Protocols ZMODEM, YMODEM, YMODEM-G, XMODEM, KERMIT, MODBUS, 3964, RK512, LSV2. Access to high numbered COM ports as COM17, overcome error 8020, KB318784.
FabulaTech Technical Documentation - Serial Port Control SDK - Developer API - Integration. Environment - Borland Component Integration - Borland Delphi 7. Serial Port and Firemonkey I would like to use Delphi XE2 Starter Firemonkey to make a 3D visualize the signals from an Inertial Measurment Unit (IMU). I am trying using DataReceived event of SerialPort class to read the data from Serial Port in the web page, but I am having the problem on.
MSComm In Binary Input Mode, replace PDQComm, SaxComm (?). Serial Communication ActiveX Control The SuperCom ActiveX (OLE/COM Control) for serial communications is a professional serial communication ActiveX that can be used to develop serial communication applications to control serial connections and attached serial devices (RS-232, RS-422, RS-485). The SuperCom ActiveX for serial communications supports common Windows development environment (IDE, Compiler) and provides the programmer with properties, methods and the events in order to develop serial data communication applications. The SuperCom ActiveX is also downwards compatible with the MSComm and compatible to PDQComm control and thus very easy to integrate into existing applications (see below how to replace with ease). Using the SuperCom ActiveX for serial communications you easily write applications to control serial ports, Modem, Barcode Scanner, Scales, PLC, POS, serial medical devices, serial printer etc.
Develop file transfer and file server application. With SuperCom the application can execute faster and smoother. Time is valuable. Developing communication software with the SuperCom serial communication ActiveX is extremely easy and starts by placing the ActiveX icon on a Windows Form.
The SuperCom ActiveX also provides that considerably speed-up the development process and produce fast, reliable solutions avoiding delaying or blocking of your application. No matter if data monitoring, receiving complex data packets or complex data transmission protocols, establishing connections or file transfer. It can run (without any special accord) optimized and transparently in background thus enabling the application to execute fast and smooth. Communications Events Applications using the SuperCom ActiveX can work event driven. The SuperCom ActiveX reports the events OnComm, OnDataPacket, OnConnect and OnFileInfo. The reported events enable the application to manage other tasks simultaneously while communications or file transfer last.
The OnComm event reports when characters received, when communication errors occur, status lines e.g. CTS, DSR or RING change state, etc. The OnConnect event provides information during the setup of a connection (e.g.
Modem dialup). The OnDataPacket event informs about the status of observed data packets for instance if an observed data packet is received. The OnFileInfo event provides status information during the file transfer. A progress dialog and/or file transfer statistics can be updated. The OnPlug event observes PnP (Plug And Play) serial devices and the TCP/IP network.
Based on the used SuperCom software, it reports when serial devices plugged in or get unplugged, a network failure (e.g. Cable, hardware or software failure). Enhanced Communications Events The SuperCom Communications ActiveX reports more than 35 different communications events.
The enhanced event reporting mechanism in SuperCom ActiveX enables you to receive events on any defined character (e.g. EOF(26), STX, ACK, NAK, etc). Polling Mode The SuperCom ActiveX also supports the polling mode of operation. This means to obtain with methods and properties the state of the status lines and to check the data flow for communication errors without the need to react on events. No matter which mode of operation the application is using, SuperCom will always perform serial data communication on multiple ports or connections simultaneously and in background. File Transfer High speed file transfers tasks are very easy to accomplish.
The following widely used standard protocols ZMODEM, YMODEM/BATCH, YMODEM, YMODEM-G, XMODEM-1K, XMODEM/CRC, XMODEM, KERMIT and ASCII are included. The SuperCom ZMODEM protocol includes important features like 'crash recovery', 32bit CRC and 'batch file transfer'. In fact, these protocols are running very stable since 1991. ActiveX Technology - ActiveX API It's the same ActiveX control shipped with other SuperCom packages too, like, etc. The runtime license, included with each packet, enables to control to perform serial port connections, TCP/IP, ISDN using one and the same component.
One library, one API! MSComm Compatible The SuperCom for Serial Communication ActiveX is compatible with the control and thus it's very easy to update existing applications using it.
Replacing MSComm with SuperCom ActiveX is a fast and smooth operation. Summary Using the SuperCom ActiveX up to 255 ports / connections can be opened simultaneously within the same application. Start as many instances of your application - no limit set. Lengthy functions like file transfer, connecting, observing the data stream for special data packets or strings, and many other, are working in background while your application is performing other tasks. With SuperCom, Your application does not 'freeze' waiting on a lengthy function to complete.
(The following briefly shows a simple example of the control operation using Visual Basic). Visual Basic Sample Sub FormLoad ' Select COM2 SCom. CommPort = 2 ' is it available? PortPresent(SCom.CommID) SCOMPORTAVAILABLEREADY Then Exit Sub ' COM2 not available End If ' set comm params SCom.
Settings = '115200,N,8,1' ' activate comm port SCom. PortOpen = True ' send data SCom. Output = 'Hello World' ' receive data s = SCom. Input: ' close comm port SCom. PortOpen = False End Sub Private Sub SCom OnComm 'Event function Dim scEvent As Integer ' get the event code scEvent = SCom. CommEvent If scEvent = SCOMMEVSEND Then ' or comEvSend ' all data sent, buffer is empty End If If scEvent = SCOMMEVRECEIVE Then ' or comEvReceive ' call SCom.Input to collect the received data.
Call ReadChars End If If scEvent = SCOMMEVCHAR Then ' User defined special char received e.g. EOF (26), NAK, STX Call HandleSpecialData End If:: End Sub Private Sub SCom OnDataPacket(Action, Data) ' The parameter Action informs about the current status.
' The parameter Data delivers the captured data packet ' OK, data available If Action = SCOMMDATAPACKETOK Then sAction = 'DATAPACKET OK' ' failed but some captured data may be available If Action = SCOMMDATAPACKETNOK Then sAction = 'DATAPACKET NOK' ' error e.g. Some property values provided was wrong ' check values of used 'DP.' Properties If Action = SCOMMDATAPACKETERR Then sAction = 'DATAPACKET ERR':: End Sub Private Sub SCom OnFileInfo(Action, Data) Select Case Action Case SCOMRXING S1 = 'RXING' Case SCOMTXING S1 = 'TXING' Case SCOMRXFIN S1 = 'RXFIN' Case SCOMTXFIN S1 = 'TXFIN' Case SCOMQUEUEFIN:: End Select End Sub Private Sub SCom OnConnect(Action, TimeLeft) If Action = SCOMCONNECTFAILED Then Debug.Print 'CONNECTFAILED' End If ' successfully If Action = SCOMCONNECTOK Then Debug.Print 'CONNECTED '; End If ' progress. If Action = SCOMCONNECTINFO Then Debug.Print '.'
; End If:: End Sub (Setup connection). Visual Basic Sample Private Sub SCom1 OnConnect(ByVal Action As Integer, ByVal TimeLeft As Long) If Action = SCOMCONNECTFAILED Then Form4.CTLINFO.Text = 'CONNECT FAILED' End If ' successfully If Action = SCOMCONNECTOK Then Form4.CTLINFO.Text = 'CONNECTED' End If ' progress.
If Action = SCOMCONNECTINFO Then Form4.CTLINFO.Text = 'CONNECT INFO.' End If End Sub:: SCom1.
PortOpen=True ' setup a link SCom1. ConnectAddress= '555-1234' SCom1.
Connect=True ' now connect: See the same for. The connection setup runs completely in background. The application receives events about the progress.
It does not matter which communication link it uses (Serial, TCP/IP or ISDN) it will require one common SuperCom API to use. The learning curve is extremely low with SuperCom!.
Simultaneously control up to 255 concurrent connections per application. Depending on product package, support for Serial (RS-232, RS-422, RS-485, TAPI) and (see also ). 100% buffered data transfer. Adjustable communication buffers (limited by RAM). Text or Binary data transfer (any char between 0 and 255).
Send and receive binary data. Send and receive hex strings. Send and receive Unicode strings. Report the OnPlug event when serial device plugged in or unplugged or when the TCP/IP network changes state (SuperCom with Serial and/or TCP/IP support presumed).
It includes nearly all known standard file transfer protocols:, YMODEM/BATCH, YMODEM, YMODEM-G, XMODEM-1K, XMODEM/CRC, KERMIT.
I am trying to connect to another Computer using a serial port. I have read the previous questions here and for the most part it seams that this is concidered to hard to do in code and the advice is to download an external componant like Async Pro. So far I have not been able to see how this can be built into a standalone delphi app as the documentation for it will not download. The code I am trying to run seems to put what I expect on the Serial port as I can see it using HDDs free device monitoring program.
The trouble is when I put an only protocol analyser on the end of the serial cable I get a garbled message. I have tested that the Baud rate, parity etc is correct (as far as I can see) so do not understand what I am doing wrong. Could some please look at my code and tell me what I am missing or explain why it cannot be done this way. I have tried using the code from Torry's Delphi pages but run into a (#87 invalid parameter) error on SetCommState when it is run. This happens when I use DCB or &DCB as the parameter The BuildCommDCB also did not work correctly and so I set the structure manually after the GetCommState initialization. My protocol Analyser that hangs off the end of the serial cable only shows correct output when set to 'No Parity' which I assume is due to the first problem.
I am sure there must be a simple issue here but I just cannot see it. Well, I only have a laptop with no serial port so I cannot test it myself. But maybe I can help you debug the issue as I understand some of the inner aspects of the problem (even though I myself used asyncfree ( ) but a looong time a go. You can try it as an alternative. It worked fine for me (I use to connect a palm via the cradel to my pc and do synchronization directly on the serial port (I written a client in java which ran on the palm). Comming back to the error.
I need to see exactly what values you pass in DCB. It's important since one of those is invalid.
![Delphi Delphi](http://www.sools.com/images/screenshots/unitportdetect.gif)
Keep in mind that you cannot put just any values there since they need to be supported by the com port. ByteSize = 7 StopBits = 1 BaudRate = 1200 I have tried Parity set to 0, 1 and 2 In the code trom Torries pages the parity is set to n which does not work (and if it did it would be using no parity which works anyway. It seems from the Analyzer (hp 4925A) that it is only sending parity as None as if I set the Analyzer to read any other parity values the message recieved is garbled. I have tested the Analyzer on odd and even parities from the machine (running OS2) that I am creating a replacement for and there is no problem with it. I am also not sure that the error from SetCommState may be a red herring as I have found other comments on the Internet that have commented that the return value from this is the same on their applications but it does not stop them working. Generally this error seams to be returned when the Baud rate is set to high. I have changed my code about to use a pointer to the DCB structure as specified in the Windows API.
The application runs the same with this updated code. I will look into your solution and get back to you. I will attach my latest code. The ShowMessage test at the end shows correct values for the DCB structure. Well, your code didn't change much:) using a PDCB by DCB^ is the saem as uing a TDCB as it is:) the '^' operator dereferences the pointor to its data. Os there is no functional change in the code.
Regarding your parity problems: are you sure that you have set both the analyzer and your applicaiton to use the exact same configuration? Because using the same phisical serial port, you can have an application running at 9600, with 8 bits, no stop bit, and even parity and another one with all the same stuff but bigger speed. Or something else changed. The crucial part is that both ends use the same configuration. You are saying that if you set 0 parity, it works.
But if you set 1 or 2, it does not. This makes no sense, because parity is used for error checking. If with no parity you get valid data, adding parity shoiuld not change that UNLESS your analyzer does not interpret that bit.
Could this be the case for why you appear to see it not working? Try writing a small applicaiton that read the data from the port and writes it in a memo. You will need a cable to connect 2 pcs for this, obviously. OR, if you have 2 COM ports, then connect one com port to the other:) here is a site on which it appears to explain everything nicely: I just googled it. The documentation I gathered when I dealed with this is vast and I didn't save the urls from where I got it. I also have schemes for connectors and cables since I also had to make a conversion cable to be used from the palm via the cradle to a printer for invoice printing. That was a weird one to do.
Anyway, read through that site and try to see if maybe your analyzer is messing things up for you. Trust me when I tell you: if it works with no parity, adding it should work as well, no matter which parity you use (odd or even), but provided that the other end is configured the same way. Settings: all Databit 7, Baud 1200, stopbits 1 Analyser Parity Code Parity Result None 0 Good None 1 Good None 2 Good Even 0 Garbled Even 1 Garbled Even 2 Garbled Odd 0 Gabled Odd 1 Garbled Odd 2 Garbled Settings Databit 7 StopBits 1, Parity 0 Analyser Baud Code Baud Result 3200 1200 Garbled 3200 3200 Garbled 1200 3200 Good Now if I set the Baud rate on the PC that the application is running on to 4800 and the parity to even or none but have the Analyzer and the Application to 1200 with the Analyzer to no parity it also works. I have confirmed that the Analyzer works correctly with other parity settings for the existing application that I am trying to replace. I can see know why I keep seeing the term 'Serial Comms Suk' on the various sites I have Googled:-) I am trying to use the asyncfree code at the moment (although there is not a BDS 2006 version) to see if I can use it. I will also try your advice on setting up a simple app with memo if this does not work.
Your data there is. WEIRD, to say the least. It make sno sense. I mean just imagine the second scenario: analyzer does not expect any parity bit. BUT, the program sends a parity bit.
You see, the program sends X bits, and the analyzer expects x-1 bits. And still, it looks ok. Moving on, the 5th scenario should actually work, because both are set on the same parity.
Further more, if you have different speeds, it should not work at all. I mean, look at the specs: (this is the first site I found with them) it clearly states: 'Both the transmitter and receiver must be programmed to use the same bit frequency. ' just imagine, you are at 3200 bits per second, and the analyzer reads at 1200.
That is in one second you send 400 bytes and in the same second, the analyzer reads 150 bytes. And bummer, it works fine??? It's impossible. And funny thing is, you don't even have 3200 in msdn: what happens if you leave all error handling in place (since some of them are commented) and apply msdn suggestion of using getlasterror to see the message? That is weird.
Basically, you have a 1111 for new app and 110 for old app. Which could well be 0110.if it were 1110 then we could have said it's the parity that is missing or wrong, but. I know I have spent my share time when dealt with this. It was over 3 months until I managed to get soemthing working, of course I also had the hardware issue to solve. Plus that I testet at least 8 serial communication components. Out of which only asynfree and a dccomms worked.
So all I can say is: patience:). It looks as though the recipient request message is just the ack as I am now occasionaly getting messages accepted and this is always followed by a '6' response. A garbled message is always followed by a '15' response. As the same message sometimes works and sometinmes doesn't I believe it is probably a timing issue. One thing to note is that I cannot use WriteString on the componant as my string contains SOH and ETX chars and this results in nothing being sent. I use a loop instead and write the chars our one at a time with a small delay in between.
Without the delay only the first char is sent. I will let you know what the final settings and code are when I get it working so that others can use this as a reference. Last piece of the puzzle was the delay between sending the individual chars. 100 ms was too long and only worked occasionaly. 1 to 10ms works every time function TFRIndicatorMain.SendToSerialPort(asInput: string): boolean; var lix: integer; liStringLength: integer; liDelay: integer; begin ComPort1.BaudRate:= SetBaudRate; ComPort1.ComNumber:= SetComPort; ComPort1.Databits:= SetDataBits; ComPort1.Stopbits:= SetStopBits; ComPort1.Parity:= SetParity; ComPort1.FlowControl:= SetFlowControl; liDelay:= StrToInt(EDDelay.Text); ComPort1.Open; liStringLength:= length(asInput); for lix:= 1 to liStringLength do begin ComPort1.WriteChar(asInputlix); sleep(liDelay); end; ComPort1.Close; end; Select all.
I had a few minutes free this morning so I downloaded and installed Async Pro. It installs and runs on BDS 2006 without needing modification (use the readme file that is included for the installation). I used Async Pro a couple years ago when I was developing a GPS application and was impressed with its capabilities - specifically the ability to parse incoming data using either control characters, specified strings or fixed width fields. It also takes care of hardware flow control RTS, DTR, etc.
It also has some cool features like a serial line status display (so you can have LED-like status of your comm port) such as a flashing LED when data is transmitted or received.