AzeoTech ® DAQFactory ® Serial / Ethernet Communications Guide DAQFactory Seria
AzeoTech ® DAQFactory ® Serial / Ethernet Communications Guide DAQFactory Serial / Ethernet Communications Guide DAQFactory for Windows, Version 5.78, July 12th, 2008. Copyright © 2001-2008 AzeoTech, Inc. All rights reserved worldwide. Documentation Version 1.7. Information in this document is subject to change without notice. AzeoTech is a registered trademark of AzeoTech, Inc. DAQFactory is a registered trademark of AzeoTech, Inc. Other brand and product names are trademarks of their respective holders. Copyright © 2001-2008 AzeoTech, Inc. All rights reserved worldwide. No portion of this manual may be copied, modified, translated, or reduced into machine-readable form without the prior written consent of AzeoTech, Inc. Overview DAQFactory can communicate with a wide variety of devices with serial (RS- 232/422/485) and Ethernet connections. This guide explains how to start communicating with your device and how to create a protocol to interpret the language your device speaks. Since serial and Ethernet communications are done almost identically, we’ll simply refer to it as serial communications. Ethernet is actually a serial technique, meaning bits of data are sent over the wire one after another. There are additional layers with Ethernet handled by your operating system and your hardware, but as far as DAQFactory is concerned, Ethernet, RS- 232, RS-422 and RS-485 are pretty much identical. This allows you to apply any protocol to either serial or Ethernet ports. DAQFactory handles serial communications by splitting the transport layer: RS- 232, RS-422, RS-485, Ethernet, etc, from the protocol used on that layer: Modbus, DF1, NMEA. In less technical speak you can think of the transport layer as a telephone. There are many different types of telephones: ones that plug into a wall, cordless phones, cellular phones, and even VOIP. We then communicate on the phone. The protocol is the language that we speak: English, Swahili, Klingon, modem speak. By splitting the telephone from the language, we can use any language on any phone type. DAQFactory provides all the tools for communicate over the various phone types. DAQFactory provides several different languages to communicate with common devices, but also provides the tools for you to specify your own special languages. In order for you to communicate with your device, you have to select and configure the proper telephone type, and you have to speak the proper language over the phone. This guide assumes you have a basic knowledge of DAQFactory and have at least progressed through the guided tour in the user’s guide. If you are going to create your own protocol, we suggest reviewing the section on sequence scripting in the user’s guide as well. We assume a basic knowledge of DAQFactory scripting in our discussion of user protocols. This guide applies to DAQFactory 5.34 or newer. USB: It should be noted now, though, that USB devices, even though the S stands for Serial, are not handled by Windows the same way as Ethernet or normal RS232 serial communications. USB devices require very specialized software to allow for plug and play. The manufacturer of your USB device should provide you with a driver to help you communicate with the USB device. For some devices, such as mice and flash drives, this driver is included with Windows. For others, the manufacturer will provide a driver which will make your USB device appear like a Window’s resource. The most common examples of this are serial to USB converters. These devices include a driver which makes the USB device appear like a standard Windows serial RS232 comm port. Since it appears as a comm port, you should ignore the USB device and just pretend you have an extra comm port on your PC. For even more specialized devices, such as USB DAQ devices, the manufacturer should provide a DLL with functions you can call to communicate with the device. To use these devices in DAQFactory, you should use extern() function and perhaps create a user device. Bottom line: if you are trying to communicate with a USB device, and not a serial to USB converter (or device that appears as a serial port) you are reading the wrong guide. One more note about serial to USB converters. We have had several reports of problems from customers using multiple serial to USB converters on a single PC. There appears to be a backlog of some sort in the driver software that is included with these devices. Most of the cheap devices have the same chip internally and therefore use the same software driver even though they come from different manufacturers. If you are using only one converter you are probably OK, but if you are going to communicate on multiple ports, we strongly recommend purchasing a converter designed for industrial applications such as the ones from Sealevel Systems (www.sealevel.com). Getting Started Enough of the fine print on USB devices. Let’s start communicating with your device. The first step when trying to setup a new serial device in DAQFactory is to initialize and test the communications. To do this, we’ll create a new communications port and use the DAQFactory monitor window to talk to it. 1) Start DAQFactory, or go File-New if you have already started DAQFactory. 2) Select Quick – Device Configuration from the DAQFactory main menu, then select New Serial / Ethernet Device. This will open up the serial device configuration window. For now we’ll ignore most of it since we just want to talk to our device a little. 3) Click on either New Serial or New Ethernet depending on how you device connects to your PC. New Serial: 4) If you are doing a serial (RS-232, RS-422 or RS-485) connection: in the window that appears, give your comm port a name, then specify the comm port number and its parameters. This information is usually available from your device’s manual. The default timeout value of 1000 is fine. Most likely flow control will be off. New Ethernet: 5) If you are doing an Ethernet connection: in the window that appears, give your connection a name, then enter the IP address of the device. You will need to configure your device with a valid IP on your subnet. The device manual should explain how to do this. If you don’t know what a valid IP is, or for that matter what subnet means, you should ask an IT person or get help from the device manufacturer. There is also an Ethernet Primer at the end of this guide. Next, you will need to enter the IP port. Ethernet is really a big bundle of different communication lines. Each one is assigned a port number. You can think of it like a skyscraper. The IP address is the postal address, say 123 Main Street. The port is the office number. Without both you won't find your device. Certain ports have standard uses. For example, port 80 is typically used by the web for HTTP requests. ModbusTCP is typically on port 502. Once again, you will need to check with your device for the proper Ethernet port. If you don’t enter the correct port, you will not be able to communicate with your device. Finally, a timeout of 1000 is more then adequate for most cases. The Monitor Window 6) Once you have created your new port, click on the port in the port list so there is a check next to it, and then click the monitor button. This will display the DAQFactory serial monitor window. This window allows you to view the data being transmitted and received on the serial line. It also allows you to manually transmit data. This window is unique in several ways. First, it is what is called a modeless window. This means you can keep the window displayed and manipulate other parts of DAQFactory. In order to do much of that, though, you will need to move the window to the side and close the serial configuration window hiding underneath. Second, the monitor window displays binary data, or data that can’t normally be seen (like carriage returns, line feeds, tabs, etc) as three digit ASCII codes preceded by a backslash. At this point we go in three directions depending on your device. Streamed data: If your device is a scale, or GPS or similar device that simply streams data out without prompting (like a politician giving their opinion), then you should see data appearing in the window immediately. If you don’t then chances are either your device is not transmitting, or you have the communications parameters incorrect and you should go back and check them. Just remember you can leave the monitor window open while you tweak the settings. Polled data with simple protocol: If your device is of the more common sort that requires a little prodding, you will need to send it a command using the manual output. Refer to your device’s documentation and find a simple command you can send it. Enter that command in the output box at the top and hit Send. If you need to enter control or binary uploads/Management/ serial-guide.pdf
Documents similaires
-
20
-
0
-
0
Licence et utilisation
Gratuit pour un usage personnel Attribution requise- Détails
- Publié le Jui 13, 2021
- Catégorie Management
- Langue French
- Taille du fichier 0.1347MB