Logix5000 - Problem with GSV WallClockTime

glenncooper

Member
Join Date
Oct 2010
Location
Vermont
Posts
24
Hello.. I'm working to get myself up to speed with the use of the GSV instruction to retrieve controller time values in the Logix5000 world. But so far I'm just getting "0"s back. I'm sure I'm doing some bonehead thing here, and would love some insight on this. Here are the details:

> I'm using an older copy of RSLogix5000 (version 17 using firmware 16) to communicate with an emulated controller.
> I am online with the emulated controller, and the controller is in "Run Mode".
> If I right click on the controller from the navigation pane, I can go to the Date/Time tab and see that the controller is reporting the correct date and time.
> I have the GSV instruction alone on the first rung of the Main Routine under the Main Program in the Main Task. I have a timer running in this routine to verify that the routine is executing.
> The GSV is setup as follows:
Class Name: WallClockTime
Instance Name is blank
Attribute Name is LocalDateTime (have also tried DateTime).
Dest: CurrDateTime.Year

Where CurrDateTime is a controller tag with data type "DATE_TIME", which is a user defined data type.

> DATE_TIME has these members, all DINT;
Year
Month
Day
Minutes
Seconds
MicroSeconds

These all align with members of LocalDateTime for WallClockTime

> When I monitor the elements of CurrDateTime, such as CurrDateTime.Year (and all others) I see only 0's.

Any thoughts and help here would be much appreciated.
 
DISCLAIMER: this is just GUESSWORK ... but maybe it will help ...

you only listed 6 things - not seven (you left out hours) ... so maybe if the number of locations is wrong the GSV won't work ...

also -

I've never used the emulator - but it wouldn't surprise me to find out that it doesn't have a WALLCLOCK function at all ... so maybe that's contributing to your problem ...
 
Ron Beaufort said:
... so maybe if the number of locations is wrong the GSV won't work ...

A GSV that attempts to write to a destination that is too small for the data will throw a Minor Fault (Error Type 4 Code 7).

It's similar to a file boundary type fault.

G.
 
we do a little exercise in every class - where the students use a GSV to get the WALLCLOCK "Local Time" from a 1756-L55 processor and stick the results into a new 7-DINT array ...

we never have a problem with this - in spite of the fact that I never explain anything other than "make sure that you have a 7-DINT array" - and "use the GSV instruction to make the transfer" ... from there the students can just click through the pull-down menus for the GSV settings and "figure out" the details on their own ...

so ...

maybe the UDT is the issue ...

maybe the 6 locations rather than 7 locations is the issue ...

maybe using the Emulator rather than an actual hardware processor is the issue ...

but somewhere along the line, this should work ...
 
Ron - you nailed it! i.e. - yes, a bonehead move on my part. I added the hours and it came alive. Thanks everyone for your input!
 
I'm interested, academically, if the UDT could be made to work. I've always buffered into a DINT[7] but one would think it should work given a correctly sized UDT. Being late on Friday, I would probably just use the dint array, copy to my UDT, and go find a cold one...
🍻

Edit: I see that the OP posted his solution while I was typing. Nice work!
 
I did not state as much as I was just passing by on my first post, and the OP has sort of confirmed it either way, but yes, RSLogix 5000 Emulate does support an accessible WallClock. So I knew that was not the issue.

As for the Minor Fault. I was simply stating what actually happens when the destination for a GSV is too small, and was not stating that it could not be the issue. In case it was thought I was "shooting down" a theory. I was actually trying to support it and compliment it. It just logs the Minor Fault so it would not be that obvious. I should have added that the OP should check under the controller properties for the fault to verify the destination UDT discrepancy.

Another important setting that can be overlooked is that the destination address for the GSV must be set to the first and correct element of the intended destination tag and not too the destination tag itself. It must know where it has to begin writing the data within the destination.

The GSV will readout whatever object you point it to, but it must have a correctly sized destination of the correct data type. But, while it may throw a Minor Fault for an undersized destination, it does not do so when you have pointed to an incorrect starting element within a destination that is large enough to house the data.

Example:

If the DINT[6] UDT array was larger than required, say DINT[13], so that is 14 DINTs instead of 7, and the GSV was pointed at element 1 of the destination tag instead of 0, then the WallClockTime data would now be placed in members 1-7 instead of the intended 0-6.

If you are not careful in setting GSV destination addresses, especially in larger arrays that may be holding lots of separate blocks of data, you can unintentionally overwrite non related but important data.

Regards,
George
 
I'm interested, academically, if the UDT could be made to work. I've always buffered into a DINT[7] but one would think it should work given a correctly sized UDT. Being late on Friday, I would probably just use the dint array, copy to my UDT, and go find a cold one...

I always use this method, the help for the GSV/SSV will indicate the structure required for the particular C/I/O.

So long as the receiving "structure" i.e. UDT has the same size than the data to be transferred, then GSV/SSV are quite happy to proceed, in much the same way as COP/CPS does.

I find it particularly useful when retrieving Major Faults in fault handling routines. The important parts of the major fault are its Type and Code, both declared as INT values. But they are preceded by two DINT values (64-bit TimeStamp), and succeeded by a DINT array. Build your UDT according to the indicated structure in the help, and just GSV into the first named element....
 

Similar Topics

I am having a problem understanding how to assign tags for a simple stop - start push buttons. The Logix 5000 routine to stop and start the pump...
Replies
17
Views
4,949
I can view all Produced tags list in the project from Logic-->produced tags, can someone help me on how to view the consumed tag list ? Thanks in...
Replies
3
Views
1,611
Good Day Sirs! I'm now having problem on a system that runs formerly in version 17. I upgraded it to version 24. I simply Upload the program then...
Replies
4
Views
1,480
Problem in opening RSlogix5000 software. the grace period is over error occured. how solve these problem please help
Replies
4
Views
2,443
I'm working in Schneider PLC platform and not aware of RSlogix. In my new project I need to communicate my Quantum PLC with 1756-L55 controller...
Replies
1
Views
1,703
Back
Top Bottom