Hmmm normal oscilloscope.as u said the output lasts for a few minutes Is it a storage scope, set to capture on the first bit of data? You only get one shot at this, so if you miss it, you won't see it. adjusted the timeline and view the handshaking signal in various compressed forms >Did you have the right time-base on the scope, compatible with the baud rate of the serial line? Void SerialPutc(HANDLE *hCom, char txchar)īWriteRC = WriteFile(*hCom, &txchar, 1, &iBytesWritten,NULL) dcb.fDtrControl = DTR_CONTROL_HANDSHAKE //īPortReady = GetCommTimeouts (hCom, &CommTimeouts) ĬommTimeouts.ReadTotalTimeoutConstant = 5000 ĬommTimeouts.ReadTotalTimeoutMultiplier = 1000 ĬommTimeouts.WriteTotalTimeoutConstant = 5000 ĬommTimeouts.WriteTotalTimeoutMultiplier = 1000 īPortReady = SetCommTimeouts (hCom, &CommTimeouts) īReadRC = ReadFile(*hCom, &rxchar, 1, &iBytesRead, NULL) dcb.fDtrControl = DTR_CONTROL_DISABLE // HANDLE SerialInit(char *ComPortName, int BaudRate)īPortReady = SetupComm(hCom, 2, 128) // set buffer sizesĭcb.fOutX = FALSE // XON/XOFF off for transmitĭcb.fInX = FALSE // XON/XOFF off for receiveĭcb.fOutxCtsFlow = TRUE // turn on CTS flow controlĭcb.fRtsControl = RTS_CONTROL_HANDSHAKE //ĭcb.fOutxDsrFlow = FALSE // turn on DSR flow control
VISUAL STUDIO SERIAL PORT EXAMPLE WINDOWS
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
VISUAL STUDIO SERIAL PORT EXAMPLE CODE
The code is below (compiles without errors on Dev C++ ) Serial.h I would greatly appreciate any help u guys can give. (Meaning the oscilloscope fails to send a handshking signal back to the laptop.this might indeed be the case because oscilloscopes are not built to send handshking signals)Ģ.If so how can I bypass sending handshking signals and simply send the letter 'a' to the oscilloscope and view its voltage pattern?ģ.Can I do this by a simple adjustemnt to the code I have written below? Is it because there is no reply from the oscilloscope for the handshaking signal the laptop sends to it? (i am using a laptop to run the program) I cannot see any data signals corresponding to the letter 'a'. These pins correspond to Transmit data, Data set ready signals that are sent from the laptop to the oscilloscope.ġ. I saw a '1' from pin 3 and pin 6 of the R232 serial port when I ran the program. Instead I only see the handshaking signal (a data bit '1') coming from the serial port.( I was able to see the handshaking control signal/initializing signal but not the data signal (the data signal was the letter 'a') ).
The serial port is connected to a digital oscilloscope and I intend to see the voltage patterns that correspond to the letter 'a' as below.ġ1 01000001 0 = stop bits / data bits / start bitīut this voltage pattern is not shown in the oscilloscope. Now I am trying to verify the output.What I did was to write the letter 'a' to the serial port. I was using the Dev C++ compiler to write the code. I managed to compile and run a C++ program that intializes and reads/writes to a serial port. I am at my wits end on this problem.i would appreciate it if you could give any help.