SSV Wallclock Operation

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.
 
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.

This looks to be an minor fault due to sending the command multiple times within 15-seconds. Refer to this tech note: Type 04 Code 06 on SSV to Wallclock

Cause
Executing SSV to Wallclock within 15 seconds of the last execution.
Solution
Space execution of SSV to Wallclock further than 15 seconds apart.


I suspect the SCADA system is sending the command twice at 5:30am.
 
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.

If the time is set back, then the CPUdatetime might cross the ONS trigger twice. That does not explain why this only happens at 0530*, but it does offer a possible explanation for a second SSV within 15s of the first.

Assuming a second SSV within 15s is the problem:

Try triggering the ONS based on the data pushed to SERVERdatetime instead.

Another option would be to run the ONS into a 20s TOF, and inhibit the ONS while the TOF/DN bit value is 1.

Another option would be to only run the SSV if the CPUdatetime and SERVERdatetime differ in the seconds field for (by?) more than 1s (or, say, 1000 scan cycles). Then the SSV would fix the difference. Hmm, on second thought, what is the cadence of pushing the SERVERdatetime data? This one needs some pondering.

* maybe it takes 24h of clock drift to accumulate a difference of 1s, which causes the ONS to fire twice
 

Similar Topics

I have problem to set wallclock for controllogix by using SSV.
4
Replies
3,582
Views
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...
8
Replies
4,265
Views
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...
4
Replies
3,954
Views
I have an application with CIP motion drives Kinetix 5700 where I need to set the exceptions for "excessive position error" and "excessive...
0
Replies
1,848
Views
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...
2
Replies
2,728
Views
Top