009b What is a PAC? Using the GSV instruction, Get System Variable in the conveyor logic.

plcprofessor
17 Apr 201520:00

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

00:00

πŸ“˜ 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.

05:02

πŸ” 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.

10:02

πŸ”„ 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.

15:08

πŸ—“οΈ 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

GS V stands for 'Get System Variable' instruction, which is a key concept in the video. It is used to retrieve specific attributes from the controller data object. In the context of the video, GS V is used to access the 'wall clock time' attribute, particularly the 'date and time', which is essential for tracking production based on time of the day.

πŸ’‘Wall Clock Time

Wall Clock Time is a class of data object within the controller that contains time-related attributes. The video discusses its use for day and shift differentiation in industrial controls, where it helps in tracking production values by different shifts. The attribute 'date and time' from this class is specifically retrieved using the GS V instruction.

πŸ’‘Controller Data Object

A Controller Data Object in the script refers to the internal data structures within the controller that store various system information. The video explains how to retrieve information from these objects using specific instructions, such as the GS V instruction for accessing the date and time.

πŸ’‘Tag

In the context of the video, a 'tag' is a label or identifier used in industrial control systems to organize and access data. The script describes creating tags such as 'control time' and 'year', 'month', 'day', etc., to store and manipulate the retrieved system variables.

πŸ’‘User-Defined Data Type (UDT)

A User-Defined Data Type (UDT) is a way to create a custom data structure consisting of multiple elements with specific data types. In the video, a UDT named 'time date' is created with seven members to organize the retrieved date and time data more cleanly and efficiently.

πŸ’‘Shift Differentiation

Shift Differentiation is the process of distinguishing between different work shifts, typically for the purpose of tracking production or other metrics. The video explains how wall clock time can be used for this purpose, allowing for the recording of production values by shift.

πŸ’‘Production Tracking

Production Tracking involves monitoring and recording the output or progress of a production process over time. The video demonstrates how system variables related to time can be used to track production on a per-shift basis, which is crucial for efficiency and analysis.

πŸ’‘Logic Engine

The Logic Engine in industrial controls refers to the system that processes logical operations and controls based on input data. The script mentions that while system information is available in the Logic Engine, it requires creating tags and using instructions like GS V to retrieve and populate these tags with data.

πŸ’‘SSB

SSB stands for 'Set System Variable' instruction, which is used to alter the controller data object, I/O modules, and bridge modules. Although not the main focus of the video, it is mentioned as another instruction that can be used for manipulating system variables.

πŸ’‘Rung

A 'rung' in the context of the video refers to a line of logic in a ladder diagram, which is a common programming language used in industrial control systems. The script describes adding rungs to the program to incorporate the GS V instruction for retrieving system variables.

πŸ’‘Move Instruction

A Move Instruction, represented by 'MOV' in the script, is used to transfer data from one location to another within the control system. The video demonstrates using move instructions to transfer the retrieved date and time data into individually named tags for easier access and manipulation.

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

play00:00

welcome to the next video lab discussion

play00:02

in support of complete PhD learn series

play00:06

volume 1 of the manual an introduction

play00:09

to rs.5000 this lab project gets system

play00:14

variable or using the GSP instruction is

play00:16

a subset of conveyor code which is found

play00:20

between pages roughly 80 and 112 in the

play00:25

manual this particular lab is going to

play00:28

be at approximately pages 95 through 96

play00:36

the GSB instruction in this lab project

play00:42

we use the GS V get system variable

play00:46

instruction to retrieve the date and

play00:49

time from the controller data object in

play00:51

the manual I included a chart to show

play00:54

you all the attributes of the class of

play00:57

objects wall clock time we are only

play01:00

after one attribute and that was date

play01:03

time but once you've used the GS v in

play01:06

this instance it works the same for

play01:09

anything else that you might want to

play01:10

retrieve and not just from wall clock

play01:14

time but from any other class of objects

play01:18

in the controller now for industrial

play01:23

controls wall clock time is most

play01:24

commonly used for day and shift

play01:27

differentiation in your logic where

play01:29

you're tracking production based on time

play01:32

of the day so you can record production

play01:35

values by shift now in the older

play01:38

products and we'll call it the rs500

play01:42

family the system information was easily

play01:46

accessible from the s2 file and you

play01:49

could view it very easily and you could

play01:52

actually use the memory locations

play01:55

directly in your logic this is not the

play01:57

case for the logics engine it it is

play02:00

available but you have to create a tag

play02:03

then use the GS v to retrieve and

play02:07

populate the tag that you created with

play02:10

the data

play02:11

now you can also use the SSB set system

play02:15

variable instruction to alter the

play02:16

controller data object as well as i/o

play02:19

modules and bridge modules we will

play02:21

discuss those some in the advanced

play02:24

manual but not in this manual you can

play02:27

see on the screen here where we left off

play02:29

so we're going to will save this project

play02:32

so we can go up to file save or we could

play02:38

have went over here to the floppy disk

play02:40

symbol upload tag values before we save

play02:45

we're going to continue with this

play02:47

project we're not done with this project

play02:48

this is part of the program that we're

play02:52

going to use in multiple programs later

play02:54

on but we want to build this program up

play02:56

a little fatter before we start creating

play02:59

multiple programs so we saved now we go

play03:02

offline and we're going to create some

play03:10

tags and in the lab I had you create

play03:14

year month day hour minute seconds and

play03:17

microseconds and instead of you watching

play03:23

while I do all of them I'm going to

play03:24

start then we're going to pause finish

play03:28

the creation and then come back so we

play03:30

had to go to the controller tags and

play03:36

create a tag called control time

play03:44

and then we made it a double integer but

play03:48

we made it an array so remember you

play03:53

don't make it a dent and then go back

play03:55

and make it array you make it an array

play03:57

right from the beginning even if it was

play03:59

gonna be just one element array you

play04:02

would put one in here for dimension but

play04:03

we're going to put seven so we're going

play04:06

to create a tag called controller time

play04:09

that has seven double integers in it and

play04:14

then we're going to create seven more

play04:17

tags as single double integers not an

play04:21

array but a single the next one we're

play04:23

going to create is year and we'll leave

play04:28

that as a double integer and I'm going

play04:32

to pause now create the rest of them and

play04:34

then come back okay there's the rest of

play04:37

the single double double integers so we

play04:40

have an array of seven double enters we

play04:43

call control time then we have seven

play04:47

single double integer tags dense that we

play04:53

call year-month-day our minutes seconds

play04:57

microseconds so now let's add a new rum

play05:01

so we can close this down go to our main

play05:06

routine

play05:11

and we can't add a new rung just by

play05:14

double-clicking at the end there and

play05:18

then we want to use a GS V now we could

play05:22

go along through here until we found the

play05:27

GS V which now I'm hypnotized by this so

play05:39

I think you thought it was input-output

play05:43

I never use this yeah there it is right

play05:46

there GS v it's Center input output but

play05:49

instead of doing that

play05:50

it's always something where just a

play05:52

double-click on the rung open the ASCII

play05:55

field up here and just type in g sv

play05:59

doesn't even have to be uppercase okay

play06:04

so there's our get system variable now

play06:07

the class name is going to be wall clock

play06:11

tang so we'll doing out of the bottom

play06:17

here see those are already in there all

play06:19

you have to do is click on the down

play06:21

arrow to open up the list and scroll

play06:24

down to find wall clock time this is not

play06:26

a tag you created this is a class of

play06:29

data object from the controller it's

play06:32

already there then we're going to go to

play06:35

attribute name because we don't want the

play06:38

whole wall clock time we only want the

play06:41

date time so it knows that we want a

play06:44

wall clock time now we go down to date

play06:46

time now we're going to give it a

play06:49

destination and the destination is going

play06:52

to be type in control time right there

play06:56

hit enter and we have to put in the

play07:02

first element so we can't just point

play07:05

date time which is up 7 double integers

play07:08

to control time we have to point date

play07:11

time to control time the first element

play07:19

so let's see now we have a happy rung

play07:22

this instruction GSV gets system

play07:25

variable we'll go to the class wall

play07:29

clock time attribute name date time and

play07:32

that's seven double integers and we'll

play07:35

put it in the destination now the

play07:37

destination begins with control time

play07:39

element zero and it's a seven element

play07:44

array now go ahead and save this you can

play07:50

use the floppy disk symbol or you could

play07:53

have one or two files save now we want

play07:56

to download this who active processors

play08:00

already right there you can set the

play08:03

project path by the way if you set the

play08:05

project path for this project then it

play08:08

will always go to that processor but

play08:10

we'll see down low we won't set the

play08:12

project path downloading

play08:25

back to the remote run mode now this is

play08:29

interesting look at the the first

play08:33

element is 1998 so control time element

play08:41

zero out of zero through six is the year

play08:43

1998 that should surprise you so go to

play08:47

controller tags go to control time and

play08:51

go to monitor tags expand control time

play08:56

again so 1998 January 16th 634 in

play09:07

seconds and microseconds now you could

play09:10

have created a user-defined data type

play09:15

called control time and then had its

play09:19

members be year month day hour minute

play09:22

seconds microseconds i'ma leave that for

play09:25

you to do it some other time just for

play09:28

entertainment because you only do this

play09:30

once in some projects creating the

play09:35

user-defined data type and then when you

play09:36

need it going and finding it and

play09:38

importing it or recreating it I just do

play09:41

it this way now there are several

play09:44

different ways that you can use this

play09:47

information you can just remember which

play09:50

data is in which elements starting with

play09:52

0 for a year and working your way down

play09:54

to by 4 seconds since six four

play09:57

microseconds or you can create

play10:00

individual tags with logical names like

play10:02

we did and then add logic to move the

play10:05

data into the new tags as such below now

play10:09

remember there's an easier way to do

play10:11

this and that is just create that

play10:12

user-defined data type we're going to go

play10:15

add some logic now so we're going to add

play10:19

another rung at the end of the program

play10:25

and we're going to put 7 move

play10:31

instructions in there because there's

play10:33

nothing in there I could tape MOV inner

play10:35

and I've got to move and if I since I

play10:39

need seven of them I can right-click

play10:42

copy and then go control be V be four

play10:48

five six seven control V control V

play10:51

etcetera you can do all the shortcuts

play10:53

you want now actually just dawned on me

play10:56

I made this more difficult so I'm going

play10:58

to go back and I'ma delete all but one

play11:00

you'll see why we'll go to this one and

play11:05

we'll see control times zero which is

play11:07

right there

play11:08

so I could I could type in control times

play11:11

zero I could double click here and go

play11:15

down and find control time and select

play11:18

that element or since I see it right

play11:21

there I can grab it and drag it down

play11:23

there

play11:24

okay now 1998 that's the year right so

play11:29

if I type in a why e there's year hit

play11:33

enter now right click right click copy

play11:40

instruction control B so I simply go

play11:45

here change the 0 to a 1 and go here

play11:50

year month M Oh inner so we're going to

play11:56

do this a couple more times I'm gonna

play11:58

pause the video finish the other five

play12:00

and then come back okay that was pretty

play12:04

fast wasn't it you know so I did this so

play12:06

fast you didn't see it so here we have

play12:08

seven move instructions remember these

play12:10

are word copies it's not really a move

play12:12

but they call them the MOV and we've

play12:15

moved all seven elements of the seven

play12:18

element double integer array that we

play12:21

moved our date and time into that you

play12:24

can see right above their attribute name

play12:26

date/time destination now we're moving

play12:29

those into tags called year month day

play12:32

hour minute seconds in microseconds now

play12:35

it's unlikely that you're going to use

play12:37

seconds or microseconds you may not even

play12:41

use minutes because you can use the

play12:45

trailing edge of the last hour of the

play12:48

shift when it goes from say 2 to 3 you

play12:53

know 2 p.m. to 3 p.m. the trailing edge

play12:57

of 2 or the leading edge of 3 is the

play12:59

first instant of the second shift in all

play13:03

reality you probably wouldn't need

play13:05

minutes seconds or microseconds but we

play13:07

brought it all in just for fun ok now

play13:10

we're going to do it a little bit easier

play13:14

we're actually going to create a

play13:15

user-defined data type it's safer to go

play13:19

offline but I like to live dangerous so

play13:21

I'm gonna go to user-defined data types

play13:23

and you see we don't have any there's no

play13:25

plus sign right here right click right

play13:29

click new data type and in the lab we

play13:31

call it same date

play13:34

and then we added 7 double integers as

play13:39

members I won't make you watch all this

play13:42

I'll put one in the first one is year

play13:44

and data type is D I enter ok I'll pause

play13:53

now and create the rest of them ok and

play13:58

there's our user-defined data type

play13:59

called time date and it has seven

play14:03

members year month day hour minute

play14:05

seconds microseconds now it's up to you

play14:09

whether you like year month days as in

play14:13

plural days hours minutes seconds

play14:16

microsecond or your month day hour

play14:18

minute second microsecond really doesn't

play14:24

matter so we're going to apply it say ok

play14:27

and now we have another data type and in

play14:32

the lab we would then add a copy

play14:35

instruction go to the bottom double

play14:42

click there that gives us a new empty

play14:44

wrong

play14:45

and double-click again then type in ce

play14:49

o-- p enter now we can take the control

play14:53

time which starts with zero and since we

play15:01

have one showing right here and then we

play15:08

create a new tag using that data type

play15:11

and we can call it control time since

play15:14

we've already used control time we'll

play15:17

use we'll create a new tag call it

play15:22

calendar and of course we have to define

play15:26

that new calendar and when it comes to

play15:32

data type you can type in we called our

play15:36

user-defined data type time date I think

play15:39

yep right there enter and a length of 1

play15:46

because calendar is 7 double integers

play15:51

it's one user-defined data type not

play15:55

seven of them ok notice that as soon as

play15:58

we take that in we got the eyes instead

play16:01

of the ease so we will finalize that now

play16:06

if we go to calendar right-click monitor

play16:12

and expand it

play16:14

there's your 1998 January 16th 646

play16:19

30-some seconds in microsecond we've

play16:22

used the wall clock time in two

play16:25

different ways mature choice if you

play16:27

actually use something like this in your

play16:29

logic or not whether you do it one way

play16:31

or the other axis I prefer the UDT

play16:34

because it's a little cleaner one last

play16:38

thing to point out here is this is not

play16:41

1998 and it's not January 16th now it

play16:49

could be January 16th the day that

play16:50

you're watching this but it's never

play16:52

going to be 1998 so we go to controller

play16:56

we go to date/time

play16:59

and we my time zone is Eastern Time

play17:08

so I would have to scroll down through

play17:11

here hook up Central Time Eastern Time

play17:24

change date and time this today happens

play17:32

to be August really doesn't even matter

play17:35

what the day is I believe it's the 2nd

play17:41

3rd 2013

play17:48

and the time is 205 to 6

play18:06

p.m. okay so I just went and set the

play18:12

date and time in the controller to

play18:13

August 30 2013 at 206 p.m. the seconds

play18:17

in the microseconds

play18:19

even the minutes doesn't have to be that

play18:21

accurate now there is another way to do

play18:23

this you can synchronize this time with

play18:27

something we're not going to do that and

play18:30

you could have adjust for daylight

play18:31

savings time and what does click that

play18:35

just for grins because where I'm located

play18:37

today while I'm doing this recording

play18:39

does use daylight savings time

play18:43

okay so we'll save that and again you

play18:49

can't see it off the bottom of screen

play18:51

but I clicked on okay now look at the

play18:54

calendar year the month the day and so

play18:58

on remember we've got calendar we've

play19:00

also got in our controller tags

play19:14

go to monitor and now you see it's

play19:17

changed there too so both runs of logic

play19:23

are executing this one that this one

play19:28

they're all executing a more thorough

play19:31

examination of the controller data

play19:33

object from once we retrieve this

play19:35

information will be addressed at a later

play19:38

time and the more advanced manuals thank

play19:41

you for watching the little short lab on

play19:44

get system variable as I said this was

play19:47

in a way part 2 of the conveyor code the

play19:50

next section will be on production shift

play19:54

counts or on production data again thank

play19:57

you for watching

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
PLC ProgrammingSystem VariablesDate-TimeAutomationControl SystemsLab DiscussionData RetrievalTag CreationShift DifferentiationProduction Tracking