009b What is a PAC? Using the GSV instruction, Get System Variable in the conveyor logic.
Summary
TLDRThis instructional video lab discussion focuses on using the GS V (Get System Variable) instruction in a lab project to retrieve the date and time from a controller data object. It guides viewers through creating tags for year, month, day, hour, minute, second, and microsecond, and demonstrates how to populate these tags with the retrieved data. The video also introduces the concept of user-defined data types for cleaner and more organized code, and concludes with setting the correct date and time in the controller, emphasizing the importance of accurate time synchronization for industrial controls.
Takeaways
- 📘 The video is part of a lab discussion in the 'complete PhD learn series', focusing on the use of the GS V (Get System Variable) instruction in a specific lab project.
- 🔍 The GS V instruction is used to retrieve system variables such as date and time from the controller data object, which is detailed in the manual between pages 80 to 112.
- 📚 The lab manual specifically covers pages 95 to 96 for the GS V instruction usage, emphasizing its role in accessing attributes of the 'wall clock time' class of objects.
- ⏰ The primary attribute of interest in this lab is the 'date time' from the 'wall clock time', which is used for tracking production based on time of the day or shifts.
- 🔧 In older systems like the RS500 family, system information was easily accessible from the S2 file, but in the Logics engine, tags must be created to retrieve and populate data using GS V.
- 🏗️ The process involves creating tags for 'year', 'month', 'day', 'hour', 'minute', 'seconds', and 'microseconds', and then using the GS V instruction to populate these tags with the current date and time from the controller.
- 🔄 The video demonstrates how to use the GS V instruction by selecting the 'wall clock time' class and the 'date time' attribute, then assigning it to a destination tag array.
- 📝 The script includes a step-by-step guide on creating tags, using the GS V instruction, and monitoring the retrieved data through the controller tags.
- 🔄 An alternative method introduced is creating a user-defined data type (UDT) to simplify the organization and retrieval of date and time data from the controller.
- 🕒 The video also discusses the importance of synchronizing the controller's date and time with the current system time, and adjusting for daylight savings time if necessary.
- 🔑 The final takeaway is the preference for using UDTs for cleaner and more organized logic, and an invitation to explore more advanced topics in subsequent manuals.
Q & A
What is the main focus of the video lab discussion?
-The main focus of the video lab discussion is to demonstrate the use of the GS V (Get System Variable) instruction in a lab project to retrieve the date and time from the controller data object.
Where can the GS V instruction be found in the manual?
-The GS V instruction is discussed in the manual between pages 80 and 112, with the lab project specifically covered on pages 95 through 96.
What is the purpose of the GS V instruction in industrial controls?
-In industrial controls, the GS V instruction is used to retrieve system variables such as wall clock time, which can be used for day and shift differentiation in logic for tracking production based on time of the day.
How is the system information accessed in older RS500 products?
-In older RS500 products, system information was easily accessible from the S2 file, and memory locations could be directly used in logic.
What is the difference in accessing system information in the Logics engine compared to older products?
-In the Logics engine, system information is not directly accessible like in the S2 file of older products. Instead, a tag must be created and then populated with data using the GS V instruction.
What is the purpose of creating tags in the lab project?
-Tags are created to store the retrieved system variables such as year, month, day, hour, minute, seconds, and microseconds, allowing for their use in the logic of the industrial control system.
How many elements are in the 'control time' array tag created in the lab project?
-The 'control time' array tag has seven elements, each storing a different part of the date and time information.
What is the significance of using a user-defined data type (UDT) in the lab project?
-Using a UDT simplifies the organization and retrieval of the date and time information by providing a structured format with logical names for each element, making the code cleaner and more maintainable.
How does the video demonstrate updating the controller's date and time?
-The video shows updating the controller's date and time by manually setting it through the controller's date/time settings, illustrating how the retrieved data can be monitored and adjusted as needed.
What is the SSB instruction mentioned in the video, and what is its purpose?
-The SSB (Set System Variable) instruction is used to alter the controller data object, as well as I/O modules and bridge modules. It is mentioned for its capability to change system variables, but its detailed use is discussed in advanced manuals.
How can the retrieved date and time information be used in the logic of an industrial control system?
-The retrieved date and time information can be used to record production values by shift, trigger events based on specific times, or differentiate logic based on the time of day, enhancing the control and monitoring of industrial processes.
Outlines
📘 Introduction to GS V Instruction
This paragraph introduces the lab project focused on the GS V (Get System Variable) instruction within the RS.5000 system, a subset of the Conveyor code manual. The GS V instruction is used to retrieve system data, such as date and time, from the controller data object. The lab is situated between pages 95-96 of the manual and involves creating tags to store the retrieved data. The speaker discusses the use of wall clock time for industrial controls, the process of saving the project, and the creation of tags for year, month, day, hour, minute, seconds, and microseconds.
🔍 Implementing GS V to Retrieve Date and Time
The speaker demonstrates how to use the GS V instruction to retrieve the date and time from the controller's wall clock time data object. They guide through the process of adding a new rung in the routine, selecting the 'wall clock time' class, and specifying the 'date time' attribute. The retrieved data is then assigned to a tag named 'control time', which is an array of seven double integers. The speaker also explains the process of downloading the project to the processor and monitoring the tags to verify the retrieved year, which in the example is 1998.
🔄 Moving Data with Move Instructions
The paragraph describes the process of moving the retrieved date and time data into individual tags with logical names, such as 'year', 'month', 'day', 'hour', 'minute', 'seconds', and 'microseconds'. The speaker initially uses move instructions but then simplifies the process by creating a user-defined data type (UDT) called 'time date' with seven members corresponding to the date and time components. This UDT is then used to create a new tag called 'calendar', which stores the date and time information in a structured format.
🗓️ Adjusting and Synchronizing Controller Time
The final paragraph discusses the importance of setting the correct date and time in the controller for accurate data retrieval. The speaker shows how to adjust the controller's date and time to the current date and time, emphasizing the need for synchronization to ensure the retrieved data reflects the actual time. They also mention the possibility of adjusting for daylight saving time and the use of user-defined data types for cleaner and more organized logic implementation. The paragraph concludes with a brief mention of future topics to be covered in advanced manuals.
Mindmap
Keywords
💡GS V
💡Wall Clock Time
💡Controller Data Object
💡Tag
💡User-Defined Data Type (UDT)
💡Shift Differentiation
💡Production Tracking
💡Logic Engine
💡SSB
💡Rung
💡Move Instruction
Highlights
Introduction to the lab project focusing on the use of the GS V (Get System Variable) instruction in RS.5000.
GS V instruction is used to retrieve the date and time from the controller data object.
Explanation of the attributes of the class of objects 'Wall Clock Time' with a focus on 'Date Time'.
Difference between system information accessibility in older RS500 products and the Logics Engine.
Demonstration of creating tags in the controller for year, month, day, hour, minute, second, and microsecond.
Use of GS V to populate the created tags with data retrieved from the controller.
The process of saving the project and uploading tag values before saving.
Tutorial on creating an array tag called 'control time' with seven double integers.
Discussion on the use of the SSB (Set System Variable) instruction to alter controller data objects.
Explanation of how to use the GS V instruction with the 'Wall Clock Time' class to get the date and time.
Step-by-step guide on assigning the retrieved date and time to a destination tag.
The importance of using the correct element in an array when assigning data.
How to monitor and verify the retrieved data using the controller tags.
Introduction of the concept of user-defined data types (UDTs) for organizing data.
Demonstration of creating a UDT called 'time date' with seven members corresponding to date and time elements.
Using the UDT to simplify the process of assigning and using the retrieved date and time data.
The option to synchronize the controller's time with an external source for accuracy.
Final demonstration of updating the controller's date and time and reflecting the changes in the logic.
Conclusion and preview of the next section on production shift counts or production data.
Transcripts
welcome to the next video lab discussion
in support of complete PhD learn series
volume 1 of the manual an introduction
to rs.5000 this lab project gets system
variable or using the GSP instruction is
a subset of conveyor code which is found
between pages roughly 80 and 112 in the
manual this particular lab is going to
be at approximately pages 95 through 96
the GSB instruction in this lab project
we use the GS V get system variable
instruction to retrieve the date and
time from the controller data object in
the manual I included a chart to show
you all the attributes of the class of
objects wall clock time we are only
after one attribute and that was date
time but once you've used the GS v in
this instance it works the same for
anything else that you might want to
retrieve and not just from wall clock
time but from any other class of objects
in the controller now for industrial
controls wall clock time is most
commonly used for day and shift
differentiation in your logic where
you're tracking production based on time
of the day so you can record production
values by shift now in the older
products and we'll call it the rs500
family the system information was easily
accessible from the s2 file and you
could view it very easily and you could
actually use the memory locations
directly in your logic this is not the
case for the logics engine it it is
available but you have to create a tag
then use the GS v to retrieve and
populate the tag that you created with
the data
now you can also use the SSB set system
variable instruction to alter the
controller data object as well as i/o
modules and bridge modules we will
discuss those some in the advanced
manual but not in this manual you can
see on the screen here where we left off
so we're going to will save this project
so we can go up to file save or we could
have went over here to the floppy disk
symbol upload tag values before we save
we're going to continue with this
project we're not done with this project
this is part of the program that we're
going to use in multiple programs later
on but we want to build this program up
a little fatter before we start creating
multiple programs so we saved now we go
offline and we're going to create some
tags and in the lab I had you create
year month day hour minute seconds and
microseconds and instead of you watching
while I do all of them I'm going to
start then we're going to pause finish
the creation and then come back so we
had to go to the controller tags and
create a tag called control time
and then we made it a double integer but
we made it an array so remember you
don't make it a dent and then go back
and make it array you make it an array
right from the beginning even if it was
gonna be just one element array you
would put one in here for dimension but
we're going to put seven so we're going
to create a tag called controller time
that has seven double integers in it and
then we're going to create seven more
tags as single double integers not an
array but a single the next one we're
going to create is year and we'll leave
that as a double integer and I'm going
to pause now create the rest of them and
then come back okay there's the rest of
the single double double integers so we
have an array of seven double enters we
call control time then we have seven
single double integer tags dense that we
call year-month-day our minutes seconds
microseconds so now let's add a new rum
so we can close this down go to our main
routine
and we can't add a new rung just by
double-clicking at the end there and
then we want to use a GS V now we could
go along through here until we found the
GS V which now I'm hypnotized by this so
I think you thought it was input-output
I never use this yeah there it is right
there GS v it's Center input output but
instead of doing that
it's always something where just a
double-click on the rung open the ASCII
field up here and just type in g sv
doesn't even have to be uppercase okay
so there's our get system variable now
the class name is going to be wall clock
tang so we'll doing out of the bottom
here see those are already in there all
you have to do is click on the down
arrow to open up the list and scroll
down to find wall clock time this is not
a tag you created this is a class of
data object from the controller it's
already there then we're going to go to
attribute name because we don't want the
whole wall clock time we only want the
date time so it knows that we want a
wall clock time now we go down to date
time now we're going to give it a
destination and the destination is going
to be type in control time right there
hit enter and we have to put in the
first element so we can't just point
date time which is up 7 double integers
to control time we have to point date
time to control time the first element
so let's see now we have a happy rung
this instruction GSV gets system
variable we'll go to the class wall
clock time attribute name date time and
that's seven double integers and we'll
put it in the destination now the
destination begins with control time
element zero and it's a seven element
array now go ahead and save this you can
use the floppy disk symbol or you could
have one or two files save now we want
to download this who active processors
already right there you can set the
project path by the way if you set the
project path for this project then it
will always go to that processor but
we'll see down low we won't set the
project path downloading
back to the remote run mode now this is
interesting look at the the first
element is 1998 so control time element
zero out of zero through six is the year
1998 that should surprise you so go to
controller tags go to control time and
go to monitor tags expand control time
again so 1998 January 16th 634 in
seconds and microseconds now you could
have created a user-defined data type
called control time and then had its
members be year month day hour minute
seconds microseconds i'ma leave that for
you to do it some other time just for
entertainment because you only do this
once in some projects creating the
user-defined data type and then when you
need it going and finding it and
importing it or recreating it I just do
it this way now there are several
different ways that you can use this
information you can just remember which
data is in which elements starting with
0 for a year and working your way down
to by 4 seconds since six four
microseconds or you can create
individual tags with logical names like
we did and then add logic to move the
data into the new tags as such below now
remember there's an easier way to do
this and that is just create that
user-defined data type we're going to go
add some logic now so we're going to add
another rung at the end of the program
and we're going to put 7 move
instructions in there because there's
nothing in there I could tape MOV inner
and I've got to move and if I since I
need seven of them I can right-click
copy and then go control be V be four
five six seven control V control V
etcetera you can do all the shortcuts
you want now actually just dawned on me
I made this more difficult so I'm going
to go back and I'ma delete all but one
you'll see why we'll go to this one and
we'll see control times zero which is
right there
so I could I could type in control times
zero I could double click here and go
down and find control time and select
that element or since I see it right
there I can grab it and drag it down
there
okay now 1998 that's the year right so
if I type in a why e there's year hit
enter now right click right click copy
instruction control B so I simply go
here change the 0 to a 1 and go here
year month M Oh inner so we're going to
do this a couple more times I'm gonna
pause the video finish the other five
and then come back okay that was pretty
fast wasn't it you know so I did this so
fast you didn't see it so here we have
seven move instructions remember these
are word copies it's not really a move
but they call them the MOV and we've
moved all seven elements of the seven
element double integer array that we
moved our date and time into that you
can see right above their attribute name
date/time destination now we're moving
those into tags called year month day
hour minute seconds in microseconds now
it's unlikely that you're going to use
seconds or microseconds you may not even
use minutes because you can use the
trailing edge of the last hour of the
shift when it goes from say 2 to 3 you
know 2 p.m. to 3 p.m. the trailing edge
of 2 or the leading edge of 3 is the
first instant of the second shift in all
reality you probably wouldn't need
minutes seconds or microseconds but we
brought it all in just for fun ok now
we're going to do it a little bit easier
we're actually going to create a
user-defined data type it's safer to go
offline but I like to live dangerous so
I'm gonna go to user-defined data types
and you see we don't have any there's no
plus sign right here right click right
click new data type and in the lab we
call it same date
and then we added 7 double integers as
members I won't make you watch all this
I'll put one in the first one is year
and data type is D I enter ok I'll pause
now and create the rest of them ok and
there's our user-defined data type
called time date and it has seven
members year month day hour minute
seconds microseconds now it's up to you
whether you like year month days as in
plural days hours minutes seconds
microsecond or your month day hour
minute second microsecond really doesn't
matter so we're going to apply it say ok
and now we have another data type and in
the lab we would then add a copy
instruction go to the bottom double
click there that gives us a new empty
wrong
and double-click again then type in ce
o-- p enter now we can take the control
time which starts with zero and since we
have one showing right here and then we
create a new tag using that data type
and we can call it control time since
we've already used control time we'll
use we'll create a new tag call it
calendar and of course we have to define
that new calendar and when it comes to
data type you can type in we called our
user-defined data type time date I think
yep right there enter and a length of 1
because calendar is 7 double integers
it's one user-defined data type not
seven of them ok notice that as soon as
we take that in we got the eyes instead
of the ease so we will finalize that now
if we go to calendar right-click monitor
and expand it
there's your 1998 January 16th 646
30-some seconds in microsecond we've
used the wall clock time in two
different ways mature choice if you
actually use something like this in your
logic or not whether you do it one way
or the other axis I prefer the UDT
because it's a little cleaner one last
thing to point out here is this is not
1998 and it's not January 16th now it
could be January 16th the day that
you're watching this but it's never
going to be 1998 so we go to controller
we go to date/time
and we my time zone is Eastern Time
so I would have to scroll down through
here hook up Central Time Eastern Time
change date and time this today happens
to be August really doesn't even matter
what the day is I believe it's the 2nd
3rd 2013
and the time is 205 to 6
p.m. okay so I just went and set the
date and time in the controller to
August 30 2013 at 206 p.m. the seconds
in the microseconds
even the minutes doesn't have to be that
accurate now there is another way to do
this you can synchronize this time with
something we're not going to do that and
you could have adjust for daylight
savings time and what does click that
just for grins because where I'm located
today while I'm doing this recording
does use daylight savings time
okay so we'll save that and again you
can't see it off the bottom of screen
but I clicked on okay now look at the
calendar year the month the day and so
on remember we've got calendar we've
also got in our controller tags
go to monitor and now you see it's
changed there too so both runs of logic
are executing this one that this one
they're all executing a more thorough
examination of the controller data
object from once we retrieve this
information will be addressed at a later
time and the more advanced manuals thank
you for watching the little short lab on
get system variable as I said this was
in a way part 2 of the conveyor code the
next section will be on production shift
counts or on production data again thank
you for watching
5.0 / 5 (0 votes)