SSV Wallclock Operation

BenL

Member
Join Date
Feb 2015
Location
Florida
Posts
26
Hello,

Been struggling with getting a 1769 L33ER PLC clock to accept an HMI entered time. I can successfully get the date/time to change but it goes back to some misc. time/date, 1969.

I've read up on the Epoch deal and maybe getting the current Epoch time, converting it to hex, dividing by 1,000,000 then using the hex seconds as the value to write in CurrentValue[0],[1] registers.

Seems like there has to be an easier way. Very convoluted to just change an hour/minute, which is all I need.

I'm using an SSV from a 7 register array to the current value. I guess I'm losing it at the lower/higher bits of a 64 bit LINT being split between the two currentvalue arrays.

Any guidance/advice on accomplishing this would be very appreciated as usual!

Cheers 🍺
 
Why don't you use a 7-DINT array and write to LocalDateTime? Dealing with CurrentValue and LINT could be frustrating.

If you don't know the date-time is organized inside a 7-DINT array, go to RSLogix > Help and look for wallclocktime object.
 
Hello,

Been struggling with getting a 1769 L33ER PLC clock to accept an HMI entered time. I can successfully get the date/time to change but it goes back to some misc. time/date, 1969.

I've read up on the Epoch deal and maybe getting the current Epoch time, converting it to hex, dividing by 1,000,000 then using the hex seconds as the value to write in CurrentValue[0],[1] registers.

Seems like there has to be an easier way. Very convoluted to just change an hour/minute, which is all I need.

I'm using an SSV from a 7 register array to the current value. I guess I'm losing it at the lower/higher bits of a 64 bit LINT being split between the two currentvalue arrays.

Any guidance/advice on accomplishing this would be very appreciated as usual!

Cheers 🍺
You are writing to the wrong attribute, CurrentValue.

The 7 DINT array is correct for writing to DateTime, or LocalDateTime, but CurrentValue is a LINT or an array of 2 DINTs.

When you look at the Help for the WallClockTime object, it will suggest you use a 7 DINT array....

DINT[0] = Year
DINT[1] = Month
DINT[2] = Day
DINT[3] = Hour
DINT[4] = Minute
DINT[5] = Second
DINT[6] = uSeconds

Save yourself some troubles remembering which is which by creating a UDT with 7 named DINTs declared as members...

.Year DINT
.Month DINT
.Day DINT
.Hour DINT
.Minute DINT
.Second DINT
.uSeconds DINT

Anytime you want to GSV or SSV the WallClock data, use tags created in this UDT, it makes life a lot easier because you have named data fields. You'll still need to specify (in GSV and SSV) the first of the 7 DINTs, so it'll be PLCClock.Year, instead of PLCClock[0]
 
I initially tried using an SSV to the localdatetime[#] array and that would update those values, but the processor clock would not change. There is an existing GSV from wallclock, writing to localdatetime[#].

The only time I got the actual clock in the properties date/time tab was when attempting SSV to currenttime.

Thanks for the input. I'll work with it today a bit.
 
I initially tried using an SSV to the localdatetime[#] array and that would update those values, but the processor clock would not change. There is an existing GSV from wallclock, writing to localdatetime[#].
Correct me if I'm wrong: there's a GSV reading the date & time and writing that information into an existent 7 DINT array.

So, you have to create a second array and use it to set the time & date, via SSV. Did you do that way?
 
The GST is reading LocalDateTime from Wallclock function to datetime[7]. Datetime[7] is moving to s[#].

I've created an array HMI_SetDatetime[7] with input values and SSV written to both s[#] and datetime[#]. These will change but the processor clock time does not change, on the date/time properties tab of processor.
 
nhatsen,

Thanks! That was it, I revisited writing to those registers and got the clock to change.

Appreciate the insight!:geek:
 
GSV and SSV error

little issue with a L73 controller. I use GSV to populate a DINT[7] of date and time CPUdatetime[7]. I also use a SSV to set the wallclock to match the scada server time using logic reading archestra tags pushed into SERVERdatetime[7]. the code syncs the time of the controller with the server every hour. the strange issue is that the time sync for 5:30AM, generates a minor fault, type 04 program fault, code 6 GSV/SSV operand invalid every time it fires at 5:30AM. However it syncs 24 times a day, 1:30, 2:30, 3:30 etc etc, but this is the only one that generates a fault.
it is simple ONS logic based on for example CPUhour = 1, CPUminute = 30, CPUsecond=0 which then fires the ONS for the SSV instruction to update WallClockTime.
Any ideas? this is the only minor fault in the PLC, and i just want rid of it.
 

Similar Topics

I have problem to set wallclock for controllogix by using SSV.
Replies
4
Views
2,806
I'm picking apart an existing machine file tonight, and I'm curious about a command I haven't used yet... SSV. I did a screen print of a portion...
Replies
8
Views
1,465
Hello dear forum users, I have a system consisting of: RSLogix5000 v20.04 software Hardware Emulator v16-21 Executed on a VM Virtual Box virtual...
Replies
4
Views
2,800
I have an application with CIP motion drives Kinetix 5700 where I need to set the exceptions for "excessive position error" and "excessive...
Replies
0
Views
1,043
I have a few cells with v28 that have ssv for program enable/disable. I copied the logic to replicate this on other, slightly older cells with...
Replies
2
Views
1,675
Back
Top Bottom