Realbasic Serial Communication

Edited 3 years ago

I think the documentation generally needs to be reviewed. It often doesn't do a good job of explaining how to use various classes and language features. To find out how things work one needs to use this forum, and that shouldn't be.

Case in point, Serial. I spent a significant amount of time trying to work out the use of Serial.DataTerminalReady. I finally came to the forum and found out how it worked. That is: set Serial.DTR = True, set Serial.DataTerminalReady to True or False, then call Serial.Reset.

In the documentation, under Serial.Reset:

REALbasic was created by Andrew Barry. It was originally called CrossBasic due to its ability to compile the same programming code for Mac OS and Java (although the integrated development environment was Mac only). In 1997 CrossBasic was purchased by FYI Software which renamed it REALbasic as well as renaming the company REAL Software. At this time they dropped the Java target, later replacing it with a Windows target and database support. Serial communication is designed to allow just two devices to communicate across one serial bus. If more than one device is trying to transmit on the same serial line you could run into bus-contention.

'Changes to the serial device are queued so that you can modify multiple properties of it without them all taking effect immediately. For instance, you can set the baud, parity and stop bits as one operation instead of three. The same thing applies to the line state properties. Once you've made all your changes, you need to call .Reset on the serial device to reset the device to the new settings.'

So the information was there. But 'the line state properties'? Download pes 2019 pc full. That's kind of vague. I only read the documentation if I don't know about the thing already. Once you know, this statement makes sense, what if you don't?

I am still left wondering which properties exactly are 'queued', given that I have been setting .Baud without calling .Reset, and now wondering how on Earth that ever worked, or if it did.

And Serial.DTR..

Documentation: 'Enables DTR (Data Terminal Ready) flow control.'

Not knowing what that meant, it wasn't immediately clear that this was _not_ controlling the DTR line. Once you know what it means, then it makes sense. If you don't?

And doesn't one need to call Serial.Reset to have this take effect? It doesn't say so. But you can work that out through trial-and-error, right?

You might add, say: 'In order to use the DataTerminalReady property, the DTR property must be set to True. If DTR is set to False, then changing DataTerminalReady has no effect.'

And Serial.DataTerminalReady..

Documentation: 'Sets the state of the data terminal line.'

That is clear. Except that the author has omitted something: in order to set the state of DTR with this property, you must first set Serial.DTR = True, and then after setting Serial.DataTerminalReady, you must then call Serial.Reset. Now if you didn't know how to control DTR, and you looked at this documentation, you would not know that you must call Serial.Reset. So what do you do? You spend a significant amount of time f-ing around until you give up and come to this forum to find out how it works.

Now there is something else that was mystifying me, and it would take a scope to figure it out. That is, when you set DataTerminalReady to True, does the line go low or high? I believe it is low as this is the active state right? It doesn't waste a lot of ink to mention this as well. If someone is using this property, this might be useful information.

WHY NOT JUST WRITE DOCUMENTATION THAT WORKS SO WE DON'T HAVE TO COME TO THE FORUM ALL THE TIME FOR ANSWERS? The documentation in general does not present data in a way appropriate for someone who doesn't already know.

The company might start by sifting through this forum and finding out what questions are being asked, then go back to docs and see if the explanation can be improved.

Parallel versus serial communication.

In telecommunication and data transmission, serial communication is the process of sending data one bit at a time, sequentially, over a communication channel or computer bus. This is in contrast to parallel communication, where several bits are sent as a whole, on a link with several parallel channels.

Serial communication is used for all long-haul communication and most computer networks, where the cost of cable and synchronization difficulties make parallel communication impractical. Serial computer buses are becoming more common even at shorter distances, as improved signal integrity and transmission speeds in newer serial technologies have begun to outweigh the parallel bus's advantage of simplicity (no need for serializer and deserializer, or SerDes) and to outstrip its disadvantages (clock skew, interconnect density). The migration from PCI to PCI Express is an example.

Cables[edit]

Many serial communication systems were originally designed to transfer data over relatively large distances through some sort of data cable.

Practically all long-distance communication transmits data one bit at a time, rather than in parallel, because it reduces the cost of the cable. The cables that carry this data (other than 'the' serial cable) and the computer ports they plug into are usually referred to with a more specific name, to reduce confusion.

Keyboard and mouse cables and ports are almost invariably serial—such as PS/2 port, Apple Desktop Bus and USB.

The cables that carry digital video are almost invariably serial—such as coax cable plugged into a HD-SDI port, a webcam plugged into a USB port or Firewire port, Ethernet cable connecting an IP camera to a Power over Ethernet port, FPD-Link, etc.

Other such cables and ports, transmitting data one bit at a time, include Serial ATA, Serial SCSI, Ethernet cable plugged into Ethernet ports, the Display Data Channel using previously reserved pins of the VGA connector or the DVI port or the HDMI port.

Serial buses[edit]

RS-232 connector.

Many communication systems were generally designed to connect two integrated circuits on the same printed circuit board, connected by signal traces on that board (rather than external cables).

Integrated circuits are more expensive when they have more pins. To reduce the number of pins in a package, many ICs use a serial bus to transfer data when speed is not important. Some examples of such low-cost serial buses include RS-232, SPI, I²C, UNI/O, 1-Wire and PCI Express. In IC, serial bus may be typically implemented by using multiplexer (which utilizes technique called multiplexing).[1]

Serial versus parallel[edit]

The communication links, across which computers (or parts of computers) talk to one another, may be either serial or parallel. A parallel link transmits several streams of data simultaneously along multiple channels (e.g., wires, printed circuit tracks, or optical fibers); whereas, a serial link transmits only a single stream of data.

Although a serial link may seem inferior to a parallel one, since it can transmit less data per clock cycle, it is often the case that serial links can be clocked considerably faster than parallel links in order to achieve a higher data rate. Several factors allow serial to be clocked at a higher rate:

  • Clock skew between different channels is not an issue (for unclocked asynchronous serial communication links).
  • A serial connection requires fewer interconnecting cables (e.g., wires/fibers) and hence occupies less space. The extra space allows for better isolation of the channel from its surroundings.
  • Crosstalk is less of an issue, because there are fewer conductors in proximity.

In many cases, serial is cheaper to implement than parallel. Many ICs have serial interfaces, as opposed to parallel ones, so that they have fewer pins and are therefore less expensive.

Examples of architectures[edit]

  • ARINC 818 Avionics Digital Video Bus
  • Atari SIO (Joe Decuir credits his work on Atari SIO as the basis of USB)
  • Binary Synchronous Communications BSC - Binary Synchronous Communications
  • CAN Control Area Network Vehicle Bus
  • ccTalk Used in the money transaction and point-of-sale industry
  • CoaXPress industrial camera protocol over Coax
  • DMX512 control of theatrical lighting
  • Fibre Channel (high-speed, for connecting computers to mass storage devices)
  • InfiniBand (very high speed, broadly comparable in scope to PCI)
  • I²C multidrop serial bus
  • MIDI control of electronic musical instruments
  • RS-232 (low-speed, implemented by serial ports)
  • RS-422 multidrop serial bus
  • RS-485 multidrop multimaster serial bus
  • SDI-12 industrial sensor protocol
  • SONET and SDH (high speed telecommunication over optical fibers)
  • SpaceWire Spacecraft communication network
  • T-1, E-1 and variants (high speed telecommunication over copper pairs)
  • Universal Serial Bus (for connecting peripherals to computers)
  • UNI/O multidrop serial bus
  • 1-Wire multidrop serial bus

See also[edit]

  • High-Level Data Link Control (HDLC)
  • Universal asynchronous receiver/transmitter (UART)

References[edit]

  1. ^'Circuit Implementation Using Multiplexers'. www.ee.surrey.ac.uk. Retrieved 2019-04-30.

External links[edit]

Serial port
  • Serial Interface Tutorial for Robotics (contains many practical examples)
Retrieved from 'https://en.wikipedia.org/w/index.php?title=Serial_communication&oldid=945690234'