AutomationDirect
Search
Login | Register
Accounts & Orders
Cart
0
$0.00

Recent Orders

View and Manage | Request Cancellation
Loading Order History
Loading...Loading...

Your Account

Account Home

Checkout   $0.00


  • My Orders
  • Product Returns (RMAs)
  • Pay Proforma Invoices
  • Pay Freights
  • Invoices / Invoice Reprint
  • Quotes / Favs / BOMs
  • Packing List Reprint
  • My Product Docs
  • Credit Application
  • Tax Exemption
| Direct Sales in US and Canada | 1-800-633-0405 | About Us | Contact Us | Line Card
Products | Support
| Compare
  
Ordering Tools  
warning Cookies are not enabled on your browser.
Cookies are required for our site. Please enable cookies in your browser preferences to continue.
+
Navigation
+
Shopping Categories
  • Barcode / RFID / Vision
  • Bulk Wire & Cable
  • Cables (Terminated)
  • Circuit Protection / Fuses / Disconnects
  • Communications
  • Drives & Soft Starters
  • Enclosure Thermal Management & Lights
  • Enclosures & Racks
  • Field I/O
  • HMI (Human Machine Interface)
  • Hydraulic Components
  • Motion Control
  • Motor Controls
  • Motors
  • Pneumatic Components
  • Power Products (Electrical)
  • Power Transmission (Mechanical)
  • Process Control & Measurement
  • Programmable Controllers
  • Pushbuttons / Switches / Indicators
  • Relays / Timers
  • Safety
  • Sensors / Encoders
  • Stacklights
  • Structural Frames / Rails
  • Tools & Test Equipment
  • Valves
  • Water (Potable) Components
  • Wiring Solutions
  • Retired Products
+
Learn More
  • Brand Line Card
  • What's New
  • E-newsletter
  • Online PDF Catalog
  • Video Tutorials
  • Company Reviews
  • Learning Library
  • Affordable Training
  • Free Online PLC training
  • Cybersecurity
+
In Depth Product Sites
  • Programmable Logic Controllers
  • Productivity1000 PLCs
  • Productivity2000 PLCs
  • Productivity3000 PLCs
  • ProductivityCODESYS
  • LS Electric XGB Series PLCs
  • ProductivityOpen
  • CLICK PLCs
  • Do-more H2 PLCs or
    Do-more T1H Series
  • Do-more BRX PLCs
  • C-more Touch Panels
  • AC & DC Drives
  • Motion Control Components
  • Servos
  • StrideLinx
  • Pneumatics
+
Product Selectors &
Configuration Utilities
  • PLC Family Selector
  • P1000 PLC Systems
  • P2000 PLC Systems
  • P3000 PLC Systems
  • ProductivityCODESYS
  • CLICK PLC Systems
  • Do-more® BRX PLC Systems
  • LS-Electric® XGB PLC Systems
  • Productivity®Open Systems
  • Datalogic® Safety Light Curtains
  • LS-Electric® Servo Systems
  • Nitra® Pneumatic Grippers
  • Object Detection (Sensors)
  • PAL Controller Configurator
  • Precision Gearbox Selector
  • Protos X® Field I/O
  • Quadritalia® Modular Enclosures
  • Stellar® Soft Starters
  • Stepper System Selector
  • SureFrame T-slot Extrusion
  • SureMotion® XYZ Gantry
  • SureServo2® System Selector
  • SureStep® Linear Actuators
  • Timing Belts & Pulleys
  • Werma® Stacklights
  • ZIPLinks

Global and Local Variables - LS Electric XGB PLC from AutomationDirect



- To learn more: https://www.automationdirect.com/ls-electric-plc?utm_source=833QFnCHxkY&utm_medium=VideoTeamDescription

(VID-XG-0064)

LS XGB Help File Video: LP003

XG5000 V4.77 2024-06-28

To view the LS XGB Help File please visit: https://cdn.automationdirect.com/static/helpfiles/ls_plc/Content/Home.htm

**Please check our website for our most up-to-date product pricing and availability.

Related AutomationDirect.com Part Numbers: N/A


Hide Transcript
View Transcript

There are two types of user-created memory locations: global variables, and local variables. Global variables are available to any program in the PLC. Local variables are only available to the program the local variable is attached to. To view the global variables for this PLC, we are going to look at the “Global/Direct Variables” screen. To get there, we will go to the project browser on the left side of the screen and double-click on “Global/Direct Variables.” A new window opens with the “Global/Direct Variables” screen and several tabs. The “Global Variable” tab will show all global variables created. Any custom created global variables as well as auto-generated global variables associated with analog, specialty, or comms modules will appear here. Local variables are used in a specific program. To help visualize this, I have created a program called “LadderProgram1” and created a simple rung of logic in this program. This rung uses the global variables “Test 1,” and “Test 2,” and the local variable “Test 4.” If we go to the project browser and twirl down the “LadderProgram1” heading, we will see the program itself as well as the “Local Variables” screen. If we double-click “Local Variables,” it will pull up the “Local Variables” screen for this program. This screen lists both global and local variables used by the program. You can see that “Test1” and “Test2” are present, as well as “Test4.” If I go to the “Global/Direct Variables” screen you can see “Test1” and “Test2” are present here as well, but “Test4” is not. It is a local variable only and can only be used by its local program. It is important to be careful when naming local variables, as two different programs can have the exact same variable name for two different local variables. I could create a second program and create a second local variable in that program also called “Test4.” The PLC will know the difference, but it is very easy for a programmer to get confused if using this type of naming. It is recommended to name your local variables unique names even though they are only accessible by their local program. If we look at a global variable in the local variables screen, we can see that the type is no longer “VAR_GLOBAL” but has instead changed to “VAR_EXTERNAL.” This is important because it allows the global variable to be used in this scan program.



No data returned!
An error has occurred! Please contact support
Videos Home > Global and Local Variables - LS Electric XGB PLC from AutomationDirect
Contact, Connect & More
Sign Up
to receive:
FREE e-Newsletter
sign up today!
Connect With Us
Social Media Channels:
linkedin    facebook    x    instagram    youtube
Company Information
About Us
Brand Line Card
System Integrator Program
International Sales
Panel Builder Program
Site Help
Company Reviews
Download Price List
Contact Us
Contact Options
1-800-633-0405
Monday - Friday
9 a.m. - 6 p.m. ET
excluding holidays
Career Opportunities
Voted #1 mid-sized employer in Atlanta
We're a great place to work!
Check out our job openings

Need Training?
Affordable Training by Interconnecting Automation
Free Online PLC Training
FREE Video Tutorials
Information & News
What's New / In The News
FREE e-Newsletter
Automation Notebook
Product Literature
White Papers
News, Product and Training Bulletins
E-Books
Shop with confidence
Checked   Safe & Secure
payment methods


We accept VISA, MasterCard, Discover, American Express, PayPal or company purchase orders.
AutomationDirect

BBB Accredited

Voted #1 mid-sized employer in Atlanta
Check out our job openings

Copyright © 1999-2025 AutomationDirect.  ALL RIGHTS RESERVED.
Site Map     Send Us your Feedback     Unsubscribe     Email Preferences     Legal & Business Policies     YouTube Terms of Service
Clear login credentials



Back to Top


spinner Updating...
Info