This document discusses how to communicate with test instruments over a local area network (LAN) using Visual Basic. It provides instructions for connecting instruments to the LAN, verifying the connection, and programming Visual Basic to send commands and receive responses. Code examples are provided to connect to the instrument, send commands using sockets, and read the response. Complete Visual Basic and C++ projects demonstrating communication with Agilent instruments over LAN are available for download.
This document describes a Python project to create a subnet calculator. It includes an introduction describing the project goal of developing a tool to calculate subnet configuration details. It outlines the use of Tkinter for the GUI and various Python functions and modules used. Pseudocode is provided showing the general logic and functions to calculate subnet information for different IP address classes.
Wireshark is a free and open-source packet analyzer that is used for network troubleshooting, analysis, protocol development, and education. It allows for deep inspection of hundreds of protocols, live packet capture, offline analysis, and display filtering. Wireshark can be used to analyze VoIP calls, DNS queries, troubleshoot internet access issues, and understand SSL encrypted traffic flows.
This document defines and provides examples of compare, contrast, iMovie, and Pages. Compare is finding similarities, contrast is finding differences. iMovie allows combining videos and photos into a movie. Pages is Apple's version of Microsoft Word for creating and editing documents.
Digital identity refers to the persona one develops through online activities and digital engagement. It can be easily influenced by social media posts, likes, and interactions, which shape others' perceptions. While a digital identity brings pressure to curate a positive online image, it can also be managed by being selective about what is shared, where it is shared, and with whom one connects online. With care, our digital identities can support rather than hinder our real identities.
Leveraging Partnerships to Increase your Library's ImpactBeth Yoke
This presentation offers libraries some basic strategies for establishing and maintaining strategic partnerships in order to increase impact and community value.
Quantum composers white paper ethernet connectivityQuantum Composers
This document describes how to set up Ethernet communication with Quantum Composers pulse generators using raw TCP/IP connectivity. It details how to determine the pulse generator's IP address using Digi Device Discovery software, and how to test communication using National Instruments' VISA Interactive Control utility by manually entering the pulse generator's IP address as a TCPIP resource. Communication can be tested by sending commands like "*IDN?" and reading the response.
This document describes a Python project to create a subnet calculator. It includes an introduction describing the project goal of developing a tool to calculate subnet configuration details. It outlines the use of Tkinter for the GUI and various Python functions and modules used. Pseudocode is provided showing the general logic and functions to calculate subnet information for different IP address classes.
Wireshark is a free and open-source packet analyzer that is used for network troubleshooting, analysis, protocol development, and education. It allows for deep inspection of hundreds of protocols, live packet capture, offline analysis, and display filtering. Wireshark can be used to analyze VoIP calls, DNS queries, troubleshoot internet access issues, and understand SSL encrypted traffic flows.
This document defines and provides examples of compare, contrast, iMovie, and Pages. Compare is finding similarities, contrast is finding differences. iMovie allows combining videos and photos into a movie. Pages is Apple's version of Microsoft Word for creating and editing documents.
Digital identity refers to the persona one develops through online activities and digital engagement. It can be easily influenced by social media posts, likes, and interactions, which shape others' perceptions. While a digital identity brings pressure to curate a positive online image, it can also be managed by being selective about what is shared, where it is shared, and with whom one connects online. With care, our digital identities can support rather than hinder our real identities.
Leveraging Partnerships to Increase your Library's ImpactBeth Yoke
This presentation offers libraries some basic strategies for establishing and maintaining strategic partnerships in order to increase impact and community value.
Quantum composers white paper ethernet connectivityQuantum Composers
This document describes how to set up Ethernet communication with Quantum Composers pulse generators using raw TCP/IP connectivity. It details how to determine the pulse generator's IP address using Digi Device Discovery software, and how to test communication using National Instruments' VISA Interactive Control utility by manually entering the pulse generator's IP address as a TCPIP resource. Communication can be tested by sending commands like "*IDN?" and reading the response.
This document describes three experiments connecting LEDs to a computer's parallel port and controlling them using Visual Basic programs. The first experiment lights all LEDs at once. The second uses a timer to turn the LEDs on and off sequentially. The third lights each LED individually by incrementing the value sent to the parallel port. Setting up the hardware involves connecting a breadboard with LEDs and resistors to the parallel port. Software includes using the NTPORT control to interface with the parallel port and write code to control data output.
CPU224XP Ethernet borad
CPU224XP Digital 14input 10output/CPU226XP Digital 24input 16output
Analog 2 channel input/1 channel output
DC24V 1A
2 channel PPI port(support Modbus)
Comes with a perpetual calendar, which can be maintained for 2 years after power failure
PPI communication interface supports 187.5K, supports Modbus protocol
Up to 7 modules can be connected
Automatic saving of power-down data
Software supports all instructions in Siemens v4.0 Step 7
This document describes using MATLAB Simulink to program and communicate between two dsPIC30f microcontrollers over a Controller Area Network (CAN) protocol. It presents the development of a real-time digital system using Simulink, Real-Time Workshop and Embedded Coder to generate C code from Simulink models. The C code is then compiled and run on the dsPIC30f microcontrollers. Specifically, it communicates engine RPM values transmitted by one microcontroller over CAN to the other microcontroller, which decodes and displays the RPM on an LCD screen. The decoding algorithm is also described.
IoT Workshop with Sigfox & Arduino - Copenhagen Business SchoolNicolas Lesconnec
Hands On IoT Workshop, using an Arduino MKRFOX board
(March 2019)
First steps on the Sigfox network :
* Send first messages
* Use the Sigfox Cloud to check incoming data
* Set up first callbacks to push data
* Complex frame handling
* Downlink communication
* Event monitoring
A Computer Based Artificial Neural Network Controller with Interactive Audito...theijes
The proposed design offers a complete online and offline solution to manage the industrial systems. The designed hardware able to, read analog signals, digital signals, and controls many devices in real time. The heart of the hardware part is microcontroller PIC18F4550 which communicate with a computer via USB. The software part is programmed using Visual C# software to control managed system requires. The system operator can monitor system and diagnostic faults manually or automatically based on artificial neural network. Finally, the system has been simulated and implemented successfully.
The document provides an overview of connecting and communicating with an ESP8266 WiFi module via serial. It discusses the hardware connections needed, including using an FTDI or Arduino board. It then demonstrates some basic AT commands to check the module status, list available networks, connect to a network, and act as both a TCP client and server.
This document describes a lab activity using Wireshark to capture and analyze network traffic. Students will use Wireshark to capture ICMP data from pings to local and remote IP addresses. For the local analysis, students will ping another PC on their LAN and examine the captured frames in Wireshark to identify the source and destination IP addresses and MAC addresses. For the remote analysis, students will ping an external address and again examine the captured frames. The goals are to understand how packet headers transport data and to gain experience using Wireshark for network analysis and troubleshooting.
This document provides an overview of Sigfox and how to communicate using Sigfox networks. Some key points:
- Sigfox is a network operator that provides connectivity for low-bandwidth IoT devices using its proprietary radio protocol.
- The Sigfox protocol is designed for energy efficiency to enable battery-powered devices to send small payloads up to 140 times per day.
- Developers can get started easily by sending simple AT commands to Sigfox modules to transmit 12-byte payloads over the global Sigfox network.
- The document covers Sigfox concepts like ultra narrowband communication, security, and how developers can receive uplink data and send downlink messages to devices through the Sigfox backend and callbacks
The document discusses Real Time Operating Systems (RTOS). It defines RTOS as a multitasking operating system intended for real-time applications. RTOS provides deterministic timing behavior and limited resource utilization for applications that require logically correct results within strict deadlines, such as those found in automotive and industrial systems. The document outlines some key RTOS concepts like multitasking, interrupt handling, and memory management. It explains that while not necessary for simple embedded systems, RTOS is beneficial for more complex real-time applications as it helps manage hardware resources and schedule tasks to meet application demands and deadlines.
There are three main topics in here. First technologies – simply put, this part is mainly for early adopters. It’s about coding, developing toys, plugging in kettles on the web (and we and many others actually did that!).
The second part is about new ideas, prototyping and new technologies that are in the lab. It’s about research papers, and software philosophy, and about researchers worldwide. Third part is about end-users and products.
This document provides information about integrating a keyboard and LCD display with a microcontroller and creating a CID calculator project. It includes:
1) Block diagrams and classifications of microprocessors and microcontrollers.
2) Instructions on connecting a 4x4 keyboard to a microcontroller port and reading button presses.
3) Details on initializing and writing text and numbers to a 16x2 LCD display connected to a microcontroller.
4) An overview of the steps needed to program a microcontroller and create a CID calculator, including required components and sample code.
A scenario on basic incident response and showing how Microsoft uses a service that automatically creates a Man in the Middle incident. It also covers an overview on some inherent tools and how to use them for security operations
Research project for Digital Systems that helped us understand better how to extend the communication aspects of micro-controllers and their connected interfaces to develop an IoT systems that can communicate with an online service without human intervention.
This document describes connecting various sensors and devices to an OpenPicus Flyport, including a BMP085 temperature and pressure sensor over I2C, an HD44780 LCD display over I2C, and sending sensor data to cloud services. Specifically, it connects a BMP085 sensor to measure temperature and pressure, sends the measurements to Pachube for storage and graphing, and displays some values locally on an I2C LCD. It also describes setting the Flyport's real-time clock from a web time source and using alarms to trigger regular sensor readings. Paraimpu is used to generate tweets when sensor readings meet certain thresholds.
DHT11 based remote temparature Monitor. Uses ESP8266 and DHT11 to monitor temperature remotely using a WiFi connection and Thingspeak and NMA application.
Control of Industrial Pneumatic & Hydraulic Systems using Serial Communicatio...IJSRD
it has been observed that machines have become more intelligent, especially in manufacturing industries and power plants. Day by day use of hydraulic & pneumatic systems has been increasing rapidly. Some industries have only pneumatic systems for various operations. Instead of other rotary actuators industries are using pneumatic and hydraulic actuators to get better accuracy and smooth operations. Simultaneously engineers are focusing on computer control also. To construct a pneumatic system with a higher control features, the one and only option is computer control. It means that engineer would be able to control the whole system with the help of on board computer attached with the unit. To build such a system serial control techniques to control pneumatic & hydraulic systems have been shown in this paper. This system has been designed using Arduino Microcontroller (ATMEGA 168, 8 bit ATMEL), Matlab software, Arduino software, GUI (graphical user interface) toolbox, pneumatic components and some electromechanical switches. Verification of the pneumatic circuit can be done using Automsim premium software.
Control of Industrial Pneumatic & Hydraulic Systems using Serial Communicatio...IJSRD
This document discusses using Matlab software to control industrial pneumatic and hydraulic systems through serial communication with an Arduino microcontroller. Matlab code is used to send signals serially to an Arduino, which then activates solenoid valves controlling pneumatic cylinders. A graphical user interface in Matlab allows user control. Relay circuits are used to amplify signals from the Arduino to the pneumatic components. The system provides flexible, reliable and accurate control of pneumatic circuits for applications in manufacturing.
IJERA (International journal of Engineering Research and Applications) is International online, ... peer reviewed journal. For more detail or submit your article, please visit www.ijera.com
Mechatronics is a multidisciplinary field that refers to the skill sets needed in the contemporary, advanced automated manufacturing industry. At the intersection of mechanics, electronics, and computing, mechatronics specialists create simpler, smarter systems. Mechatronics is an essential foundation for the expected growth in automation and manufacturing.
Mechatronics deals with robotics, control systems, and electro-mechanical systems.
More Related Content
Similar to communicate with instrument by using lan
This document describes three experiments connecting LEDs to a computer's parallel port and controlling them using Visual Basic programs. The first experiment lights all LEDs at once. The second uses a timer to turn the LEDs on and off sequentially. The third lights each LED individually by incrementing the value sent to the parallel port. Setting up the hardware involves connecting a breadboard with LEDs and resistors to the parallel port. Software includes using the NTPORT control to interface with the parallel port and write code to control data output.
CPU224XP Ethernet borad
CPU224XP Digital 14input 10output/CPU226XP Digital 24input 16output
Analog 2 channel input/1 channel output
DC24V 1A
2 channel PPI port(support Modbus)
Comes with a perpetual calendar, which can be maintained for 2 years after power failure
PPI communication interface supports 187.5K, supports Modbus protocol
Up to 7 modules can be connected
Automatic saving of power-down data
Software supports all instructions in Siemens v4.0 Step 7
This document describes using MATLAB Simulink to program and communicate between two dsPIC30f microcontrollers over a Controller Area Network (CAN) protocol. It presents the development of a real-time digital system using Simulink, Real-Time Workshop and Embedded Coder to generate C code from Simulink models. The C code is then compiled and run on the dsPIC30f microcontrollers. Specifically, it communicates engine RPM values transmitted by one microcontroller over CAN to the other microcontroller, which decodes and displays the RPM on an LCD screen. The decoding algorithm is also described.
IoT Workshop with Sigfox & Arduino - Copenhagen Business SchoolNicolas Lesconnec
Hands On IoT Workshop, using an Arduino MKRFOX board
(March 2019)
First steps on the Sigfox network :
* Send first messages
* Use the Sigfox Cloud to check incoming data
* Set up first callbacks to push data
* Complex frame handling
* Downlink communication
* Event monitoring
A Computer Based Artificial Neural Network Controller with Interactive Audito...theijes
The proposed design offers a complete online and offline solution to manage the industrial systems. The designed hardware able to, read analog signals, digital signals, and controls many devices in real time. The heart of the hardware part is microcontroller PIC18F4550 which communicate with a computer via USB. The software part is programmed using Visual C# software to control managed system requires. The system operator can monitor system and diagnostic faults manually or automatically based on artificial neural network. Finally, the system has been simulated and implemented successfully.
The document provides an overview of connecting and communicating with an ESP8266 WiFi module via serial. It discusses the hardware connections needed, including using an FTDI or Arduino board. It then demonstrates some basic AT commands to check the module status, list available networks, connect to a network, and act as both a TCP client and server.
This document describes a lab activity using Wireshark to capture and analyze network traffic. Students will use Wireshark to capture ICMP data from pings to local and remote IP addresses. For the local analysis, students will ping another PC on their LAN and examine the captured frames in Wireshark to identify the source and destination IP addresses and MAC addresses. For the remote analysis, students will ping an external address and again examine the captured frames. The goals are to understand how packet headers transport data and to gain experience using Wireshark for network analysis and troubleshooting.
This document provides an overview of Sigfox and how to communicate using Sigfox networks. Some key points:
- Sigfox is a network operator that provides connectivity for low-bandwidth IoT devices using its proprietary radio protocol.
- The Sigfox protocol is designed for energy efficiency to enable battery-powered devices to send small payloads up to 140 times per day.
- Developers can get started easily by sending simple AT commands to Sigfox modules to transmit 12-byte payloads over the global Sigfox network.
- The document covers Sigfox concepts like ultra narrowband communication, security, and how developers can receive uplink data and send downlink messages to devices through the Sigfox backend and callbacks
The document discusses Real Time Operating Systems (RTOS). It defines RTOS as a multitasking operating system intended for real-time applications. RTOS provides deterministic timing behavior and limited resource utilization for applications that require logically correct results within strict deadlines, such as those found in automotive and industrial systems. The document outlines some key RTOS concepts like multitasking, interrupt handling, and memory management. It explains that while not necessary for simple embedded systems, RTOS is beneficial for more complex real-time applications as it helps manage hardware resources and schedule tasks to meet application demands and deadlines.
There are three main topics in here. First technologies – simply put, this part is mainly for early adopters. It’s about coding, developing toys, plugging in kettles on the web (and we and many others actually did that!).
The second part is about new ideas, prototyping and new technologies that are in the lab. It’s about research papers, and software philosophy, and about researchers worldwide. Third part is about end-users and products.
This document provides information about integrating a keyboard and LCD display with a microcontroller and creating a CID calculator project. It includes:
1) Block diagrams and classifications of microprocessors and microcontrollers.
2) Instructions on connecting a 4x4 keyboard to a microcontroller port and reading button presses.
3) Details on initializing and writing text and numbers to a 16x2 LCD display connected to a microcontroller.
4) An overview of the steps needed to program a microcontroller and create a CID calculator, including required components and sample code.
A scenario on basic incident response and showing how Microsoft uses a service that automatically creates a Man in the Middle incident. It also covers an overview on some inherent tools and how to use them for security operations
Research project for Digital Systems that helped us understand better how to extend the communication aspects of micro-controllers and their connected interfaces to develop an IoT systems that can communicate with an online service without human intervention.
This document describes connecting various sensors and devices to an OpenPicus Flyport, including a BMP085 temperature and pressure sensor over I2C, an HD44780 LCD display over I2C, and sending sensor data to cloud services. Specifically, it connects a BMP085 sensor to measure temperature and pressure, sends the measurements to Pachube for storage and graphing, and displays some values locally on an I2C LCD. It also describes setting the Flyport's real-time clock from a web time source and using alarms to trigger regular sensor readings. Paraimpu is used to generate tweets when sensor readings meet certain thresholds.
DHT11 based remote temparature Monitor. Uses ESP8266 and DHT11 to monitor temperature remotely using a WiFi connection and Thingspeak and NMA application.
Control of Industrial Pneumatic & Hydraulic Systems using Serial Communicatio...IJSRD
it has been observed that machines have become more intelligent, especially in manufacturing industries and power plants. Day by day use of hydraulic & pneumatic systems has been increasing rapidly. Some industries have only pneumatic systems for various operations. Instead of other rotary actuators industries are using pneumatic and hydraulic actuators to get better accuracy and smooth operations. Simultaneously engineers are focusing on computer control also. To construct a pneumatic system with a higher control features, the one and only option is computer control. It means that engineer would be able to control the whole system with the help of on board computer attached with the unit. To build such a system serial control techniques to control pneumatic & hydraulic systems have been shown in this paper. This system has been designed using Arduino Microcontroller (ATMEGA 168, 8 bit ATMEL), Matlab software, Arduino software, GUI (graphical user interface) toolbox, pneumatic components and some electromechanical switches. Verification of the pneumatic circuit can be done using Automsim premium software.
Control of Industrial Pneumatic & Hydraulic Systems using Serial Communicatio...IJSRD
This document discusses using Matlab software to control industrial pneumatic and hydraulic systems through serial communication with an Arduino microcontroller. Matlab code is used to send signals serially to an Arduino, which then activates solenoid valves controlling pneumatic cylinders. A graphical user interface in Matlab allows user control. Relay circuits are used to amplify signals from the Arduino to the pneumatic components. The system provides flexible, reliable and accurate control of pneumatic circuits for applications in manufacturing.
IJERA (International journal of Engineering Research and Applications) is International online, ... peer reviewed journal. For more detail or submit your article, please visit www.ijera.com
Similar to communicate with instrument by using lan (20)
Mechatronics is a multidisciplinary field that refers to the skill sets needed in the contemporary, advanced automated manufacturing industry. At the intersection of mechanics, electronics, and computing, mechatronics specialists create simpler, smarter systems. Mechatronics is an essential foundation for the expected growth in automation and manufacturing.
Mechatronics deals with robotics, control systems, and electro-mechanical systems.
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELijaia
As digital technology becomes more deeply embedded in power systems, protecting the communication
networks of Smart Grids (SG) has emerged as a critical concern. Distributed Network Protocol 3 (DNP3)
represents a multi-tiered application layer protocol extensively utilized in Supervisory Control and Data
Acquisition (SCADA)-based smart grids to facilitate real-time data gathering and control functionalities.
Robust Intrusion Detection Systems (IDS) are necessary for early threat detection and mitigation because
of the interconnection of these networks, which makes them vulnerable to a variety of cyberattacks. To
solve this issue, this paper develops a hybrid Deep Learning (DL) model specifically designed for intrusion
detection in smart grids. The proposed approach is a combination of the Convolutional Neural Network
(CNN) and the Long-Short-Term Memory algorithms (LSTM). We employed a recent intrusion detection
dataset (DNP3), which focuses on unauthorized commands and Denial of Service (DoS) cyberattacks, to
train and test our model. The results of our experiments show that our CNN-LSTM method is much better
at finding smart grid intrusions than other deep learning algorithms used for classification. In addition,
our proposed approach improves accuracy, precision, recall, and F1 score, achieving a high detection
accuracy rate of 99.50%.
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Sinan KOZAK
Sinan from the Delivery Hero mobile infrastructure engineering team shares a deep dive into performance acceleration with Gradle build cache optimizations. Sinan shares their journey into solving complex build-cache problems that affect Gradle builds. By understanding the challenges and solutions found in our journey, we aim to demonstrate the possibilities for faster builds. The case study reveals how overlapping outputs and cache misconfigurations led to significant increases in build times, especially as the project scaled up with numerous modules using Paparazzi tests. The journey from diagnosing to defeating cache issues offers invaluable lessons on maintaining cache integrity without sacrificing functionality.
Null Bangalore | Pentesters Approach to AWS IAMDivyanshu
#Abstract:
- Learn more about the real-world methods for auditing AWS IAM (Identity and Access Management) as a pentester. So let us proceed with a brief discussion of IAM as well as some typical misconfigurations and their potential exploits in order to reinforce the understanding of IAM security best practices.
- Gain actionable insights into AWS IAM policies and roles, using hands on approach.
#Prerequisites:
- Basic understanding of AWS services and architecture
- Familiarity with cloud security concepts
- Experience using the AWS Management Console or AWS CLI.
- For hands on lab create account on [killercoda.com](https://killercoda.com/cloudsecurity-scenario/)
# Scenario Covered:
- Basics of IAM in AWS
- Implementing IAM Policies with Least Privilege to Manage S3 Bucket
- Objective: Create an S3 bucket with least privilege IAM policy and validate access.
- Steps:
- Create S3 bucket.
- Attach least privilege policy to IAM user.
- Validate access.
- Exploiting IAM PassRole Misconfiguration
-Allows a user to pass a specific IAM role to an AWS service (ec2), typically used for service access delegation. Then exploit PassRole Misconfiguration granting unauthorized access to sensitive resources.
- Objective: Demonstrate how a PassRole misconfiguration can grant unauthorized access.
- Steps:
- Allow user to pass IAM role to EC2.
- Exploit misconfiguration for unauthorized access.
- Access sensitive resources.
- Exploiting IAM AssumeRole Misconfiguration with Overly Permissive Role
- An overly permissive IAM role configuration can lead to privilege escalation by creating a role with administrative privileges and allow a user to assume this role.
- Objective: Show how overly permissive IAM roles can lead to privilege escalation.
- Steps:
- Create role with administrative privileges.
- Allow user to assume the role.
- Perform administrative actions.
- Differentiation between PassRole vs AssumeRole
Try at [killercoda.com](https://killercoda.com/cloudsecurity-scenario/)
Build the Next Generation of Apps with the Einstein 1 Platform.
Rejoignez Philippe Ozil pour une session de workshops qui vous guidera à travers les détails de la plateforme Einstein 1, l'importance des données pour la création d'applications d'intelligence artificielle et les différents outils et technologies que Salesforce propose pour vous apporter tous les bénéfices de l'IA.
Digital Twins Computer Networking Paper Presentation.pptxaryanpankaj78
A Digital Twin in computer networking is a virtual representation of a physical network, used to simulate, analyze, and optimize network performance and reliability. It leverages real-time data to enhance network management, predict issues, and improve decision-making processes.
Generative AI Use cases applications solutions and implementation.pdfmahaffeycheryld
Generative AI solutions encompass a range of capabilities from content creation to complex problem-solving across industries. Implementing generative AI involves identifying specific business needs, developing tailored AI models using techniques like GANs and VAEs, and integrating these models into existing workflows. Data quality and continuous model refinement are crucial for effective implementation. Businesses must also consider ethical implications and ensure transparency in AI decision-making. Generative AI's implementation aims to enhance efficiency, creativity, and innovation by leveraging autonomous generation and sophisticated learning algorithms to meet diverse business challenges.
https://www.leewayhertz.com/generative-ai-use-cases-and-applications/
Software Engineering and Project Management - Software Testing + Agile Method...Prakhyath Rai
Software Testing: A Strategic Approach to Software Testing, Strategic Issues, Test Strategies for Conventional Software, Test Strategies for Object -Oriented Software, Validation Testing, System Testing, The Art of Debugging.
Agile Methodology: Before Agile – Waterfall, Agile Development.
Open Channel Flow: fluid flow with a free surfaceIndrajeet sahu
Open Channel Flow: This topic focuses on fluid flow with a free surface, such as in rivers, canals, and drainage ditches. Key concepts include the classification of flow types (steady vs. unsteady, uniform vs. non-uniform), hydraulic radius, flow resistance, Manning's equation, critical flow conditions, and energy and momentum principles. It also covers flow measurement techniques, gradually varied flow analysis, and the design of open channels. Understanding these principles is vital for effective water resource management and engineering applications.
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
communicate with instrument by using lan
1. Communicate with Test Instruments
Over LAN Using Visual Basic
Application Note 1555
When you order a new test and measurement instrument, you may
discover that it has a local area network (LAN) interface along with
the more traditional GPIB interface. Test and measurement instru-ment
makers Agilent Technologies, Racal Instruments, Keithley and
others have been shipping instruments with LAN (Ethernet) inter-faces
for more than a year. Using LAN lets you communicate with
your instruments remotely; it is fast and simple, and you don’t need
any additional proprietary software or cards. In this application note
we show you how to communicate with instruments on the LAN from
your PC using Microsoft® Visual Basic. You can download the code
examples from www.agilent.com/find/socket_examples.
Connecting the instrument
You can connect a test instrument
directly to a network LAN port
with a LAN cable, or you can con-nect
your instrument directly to
the PC. If you decide to connect
the instrument directly to the PC
LAN port, you will need a special
cable called a crossover cable.
Once the instrument is connected,
you must establish an IP address
for it. Dynamic Host Configuration
Protocol (DHCP) is typically the easiest way to configure an
instrument for LAN communication. DHCP automatically assigns
a dynamic IP address to a device on a network. See the instrument’s
user’s guide for more information on this topic.
Figure 1.
Ethernet connection
to LAN on an N6700A
modular power system
2. Testing communication using the Windows command prompt
Once you have an IP address, test the IP address from your PC.
Go to the MS DOS command prompt window (in Windows 2000 the
menu sequence is Start>Programs> Accessories>Command Prompt).
At the command prompt, type
ping <IP address>. The IP address
is four groups of numbers separat-ed
2
by decimal points. If everything
is working, your instrument will
respond. Figure 2 shows a suc-cessful
ping response.
Testing communication
using HyperTerminal
Alternately, you can test the communication to the instrument with the
Windows HyperTerminal program (Start >Programs >Accessories >Com-munications
>HyperTerminal). When the Connection Description dialog
box appears, type a name and click OK. The name will be used to save
your settings. Next, in the Connect To dialog box, select TCP/IP
(Winsock) and type in the IP address for the instrument. The port num-ber
determines the protocol for the communication.
We will use ASCII characters and instrument SCPI
commands. The Internet Assigned Number Authority
(IANA) registered port number for the instrument
SCPI interface is 5025. Some instrument manufac-tures
may choose to use a unique port number; check
the instrument documentation for the the port num-ber.
Now go to the File>Properties menu and select the
Settings tab and click ASCII Setup…. Select Send line
ends with line feed and Echo typed characters locally (see
Figure 3). Click OK to close the dialog boxes. In the
terminal window type in *IDN?, and hit Enter. Do not
use the backspace key or any editing keys. If every-thing
is working, you will get back the manufacturer
and model number. Save the settings with Save as…
In order to communicate with the instrument from Visual Basic, you
will need both the port number and the IP address. It is a good practice
to verify both before you begin programming.
Using MS Visual Basic to communicate
Now that the connections are confirmed, we are ready to use
Visual Basic. Visual Basic 6.0 comes with Winsock control. From
the Components dialog box (Ctrl-T), find and select the Microsoft
Winsock control. Once the Winsock control is available in the
Toolbox, place it on the form. There are three steps to make a
connection to the instrument in the Form Load event: first you
Figure 2.
Response to a ping for a
working LAN connection
Figure 3.
ASCII setup for Windows
HyperTerminal for LAN
communications
3. must insert the IP address (RemoteHost), as well as the port number
(RemotePort), then invoke the connect method. The code created
by the Winsock control is shown below.
If (Winsock1.State = sckClosed) Then
' Invoke the Connect method to initiate a connection.
Winsock1.RemotePort = "5025"
Winsock1.RemoteHost = "177.140.77.204"
Winsock1.Connect
3
End If
The connection may take a bit of time, so this is a good place to add
a wait statement or to test the connection status. You can test the
connection status with this code
Dim status as Long
If Winsock1.State = sckConnected then debug.Print "Connected"
Once connected, the Windows Sockets object is ready for
communication.
Sending instrument commands
Sending a string to the instrument is straightforward. Note that we add
a carriage-return line feed at the end of the command.
Winsock1.SendData "*IDN?" & vbCrLf
You can get the response in one of two ways. If the above string is in
a button, clicking the button sends the string command and then exits
the subroutine. When exiting the subroutine, Visual Basic is idle and
events can be executed. In that case, receiving the data is just a
matter of waiting for the DataArrival event to fire and then
retrieving the data like this:
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
Winsock1.GetData strData, vbString
End Sub
4. However, most of the time you want to write and read several times
without exiting the subroutine. To do this, we wrote a simple ReadString
routine that will allow you to do just that. The ReadString routine
immediately checks the connection buffer and then executes a DoEvents
until the buffer has increased in size indicating the arrival of the latest
data. DoEvents allows VB to pause the subroutine and capture an
event such as the instrument response to a query on the LAN.
This is a shortened version of the ReadString subroutine contained
in the example VB project.
Public Function ReadString(skt As Winsock) As String
Dim strData As String
Dim numbBytes As Long
Dim i As Long
numbBytes = skt.BytesReceived
DoEvents
' check repeatedly if there is new data.
For i = 1 To 10000
If skt.BytesReceived > numbBytes Then Exit For
DoEvents
Next i
' Gets the data and Clears buffer
skt.GetData strData, vbString
ReadString = strData
End Function
Rather than add a carriage return line feed every time we send a string,
we also wrote a WriteString routine that adds the vbCrLf
Public Sub WriteString(skt As Winsock, ByVal cmd As String)
skt.SendData cmd & vbCrLf
Using these two routines, you can check the ID of an instrument and
place it into a text box with the following code:
4
End Sub
WriteString Winsock1, "*idn?"
txtID.Text = ReadString(Winsock1)
5. 5
Examples downloads
A complete Visual Basic and C++ project that demonstrates sockets
with Agilent instruments is available for the Agilent 33220A function
generator and the N6700A modular power system at www.agilent.
com/find/socket_examples. All the instrument-specific code is in one
command button subroutine. You
can easily modify either of these
projects for other instruments.
The example Visual Basic code
brings up a dialog box for making
the LAN connection. The port
number is set to 5025. If it
needs to be changed, change
the constant RemPort in the
modWinSock module. Start the
code. Type in the IP address and
click on Connect. The progress of
the connection will be shown in
the Messages field. The instru-ment-
specific code is in the click
event for the button labeled Start.
Conclusion
Using sockets in Visual Basic with LAN-enabled instruments
eliminates the need for proprietary I/O library code loaded to
the PC. This approach is very fast, it enables remote operation,
and it is easy to implement in Microsoft Visual Basic.
Figure 4.
User interface of VB
software example to make
connection to instrument
with sockets
Related Agilent literature
Publication title Publication Publication Web address
type number
33220A 20MHz
Function Arbitrary Waveform Data sheet 5988-8544EN http://cp.literature.agilent.com/litweb/pdf/5988-8544EN.pdf
Generator
N6700-series Modular Data sheet 5989-1411EN http://cp.literature.agilent.com/litweb/pdf/5989-1411EN.pdf
DC Power Supply