GE Fanuc PLC programming

unsaint33

Member
Join Date
Sep 2019
Location
MInnesota
Posts
114
Our PLC output 7 opens a valve to move a cylinder rod. The output turns on every minute. The output is supposed to be ON for 10.56 seconds. But I think the actual duration of the output ON is not consistent.

So, I want to measure the PLC output ON duration. Then, I want to record the time to a group of registers.

Would you please let me know how I can program this?

Software: Proficy Machine Edition 6.5
PLC: GE Fanuc 90-30

Thank you.
 
I don't know about proficy specifically, but usually there is a free-running clock, sometimes it is a real-time clock, that counts in milliseconds or microseconds.

If you can access such a clock via proficy, you can save one value on the scan during which the output becomes 1 (rising edge), and then a second value on the scan during which the output returns to 0 (falling edge), and subtract one from the other, and put the result in a tag "accumulator."

Another way is if there is a register containing the duration of the last scan. On the rising edge of the output, set a spare 32-bit integer or floating-point tag "accumulator" to zero. Also, on any scan where the output is 1, including the scan when of its rising edge, add that duration-of-the-last-scan to that same "accumulator" tag. Any time the output is 0, that tag will have the duration of the last duration of the output.

Caveats


  • The units of the accumulator tag are the units of the clock, which may need to be scaled to seconds to compare against the 10.56 target. E.g. A-B MicroLogix they are ticks of a 10MHz clock, so any sum would need to be multiplied by 1e-4 to get seconds, or 1e-1 to get ms.
  • The accuracy of the method is affected by
    • the sum of the durations of the first and last scans, typically some small number of ms;
    • the accuracy of the PLC internal clock
  • Storing the accumulator values into a series of registers is left as an exercise.
    • If indirect addressing is available, perhaps a array of N registers themselves could be the accumulators, with via an index that increments by 1 on each output falling edge; the index would run from from 0 to N-1, and be reset to 0 whenever its value is N (or, if N is a power of 2, then index = index (BitwiseAndOperator) (2**N)-1) e.g. index = index [AND] 32 for N=32
I wrote several program to investigate the accuracy of TON timers using this method; the approach might be adaptable to Proficy; see here.
 
In Proficy, use an "SVC_REQ" block to call info from PLC.
SVC REQ (Service Request) 16 is number of seconds since power up in 32 bit (Store to DINT).
You can use a 1-shot to pull seconds and do again to pull and compare time elapsed.
You will have to have 2 storage registers (DINTs) to compare time between on and off.

Use SVC_REQ 16 to read the system's elapsed time clock. The elapsed time clock measures the time in seconds since the CPU was powered on. The parameter block has a length of three words used for output only.
Output
Address Seconds from power on (low order)
Address+1 Seconds from power on (high order)
Address+2 100 microsecond (μs) ticks
The first two words are the elapsed time in seconds. The last word is the number of 100 μs ticks in the current second.
The resolution of the CPU's elapsed time clock is 100 microseconds (μs). The overall accuracy of the elapsed time clock is ±0.01%. The accuracy of an individual sample of the elapsed time clock is approximately 105 μs.

Use a Service Request function to request one of the following control system services:
SVC_REQ 1: Change/Read Constant Sweep Timer
SVC_REQ 2: Read Window Modes and Time Values
SVC_REQ 3: Change Controller Communications Window Mode
SVC_REQ 4: Change Backplane Communications Window Mode and Timer Value
SVC_REQ 5: Change Background Task Window Mode and Timer Value
SVC_REQ 6: Change/Read Number of Words to Checksum
SVC_REQ 7: Read or Change the Time-of-Day Clock
SVC_REQ 8: Reset Watchdog Timer
SVC_REQ 9: Read Sweep Time from Beginning of Sweep
SVC_REQ 10: Read Target Name
SVC_REQ 11: Read Controller ID
SVC_REQ 12: Read Controller Run State
SVC_REQ 13: Shut Down (STOP) CPU
SVC_REQ 14: Clear Controller or I/O Fault Table
SVC_REQ 15: Read Last-Logged Fault Table Entry
SVC_REQ 16: Read Elapsed Time Clock
SVC_REQ 17: Mask/Unmask I/O Interrupt
SVC_REQ 18: Read I/O Forced Status
SVC_REQ 19: Set Run Enable/Disable
SVC_REQ 20: Read Fault Tables
SVC_REQ 21: User-Defined Fault Logging
SVC_REQ 22: Mask/Unmask Timed Interrupts
SVC_REQ 22: Mask/Unmask Timed Interrupts
SVC_REQ 23: Read Master Checksum
SVC_REQ 24: Reset Module
SVC_REQ 25: Disable/Enable EXE Block and Standalone C Program Checksums
SVC_REQ 29: Read Elapsed Power Down Time
SVC_REQ 32: Suspend/Resume I/O Interrupt
SVC_REQ 45: Skip Next I/O Scan
SVC_REQ 50: Read Elapsed Time Clock
SVC_REQ 51: Read Sweep Time from Beginning of Sweep
SVC_REQ 56: Logic Driven Read of Nonvolatile Storage
SVC_REQ 57: Logic Driven Write to Nonvolatile Storage

The following Service Requests are used in CPU HSB redundancy applications.
Refer to the PACSystems Hot Standby CPU Redundancy User’s Guide, GFK-2308. For non-HSB applications, refer to PACSystems RX7i & RX3i TCP/IP Ethernet Communications User Manual, GFK-2224.
SVC_REQ 26 Role switch (redundancy)
SVC_REQ 27 Write to reverse transfer area (Hot Standby Redundancy)
SVC_REQ 28 Read from reverse transfer area (Hot Standby Redundancy)
SVC_REQ 43 Disable data transfer copy in backup unit (Hot Standby Redundancy)
SVC_REQ 55 Set application redundancy mode (non-Hot Standby Redundancy)
 
Last edited:
Timers in the 90-30 use three consecutive %R register addresses. The first of the three is the address that shows under the timer function block in the rung. If the ladder logic program uses either of the other two %R registers elsewhere in the program it could cause the inconsistent operation you're seeing. I suggest you check for that. Back when I ran classes on 90-30 programming one of the exercises I used was to deliberately overlap timer addresses to show what the operation looks like when you do.

Are you using the OFDT_HUNDS instruction with a preset of 1056 to get an output to turn on for 10.56 seconds? If so, what triggers the off-delay timer? The output of that timer function stays on while the enabling logic is true. That timer only begins timing when the enabling logic goes false, so the triggering logic should be a one-shot.

To answer your question, use the SHFR_WORD function. The enabling logic at the top left node should be a one-shot. Whatever %R address you use to track the duration of the output being energized goes at the IN node. The %R address at the ST node is the first address of the stack you'll be creating with the function. The size of the stack is determined by the length parameter, which is the number you enter in the body of the function block. Best practice is to create a WORD array of the same length as that of the function block.
 

Similar Topics

Good afternoon all, hope everyone is doing well. Could someone explain the pic attached on the wrt.not instruction? To me, it looks the same as...
Replies
6
Views
2,081
Hey everyone, So to preface the situation I'm the IT Manager for an electronic manufacturing company so PLC's aren't my area of expertise by any...
Replies
8
Views
4,363
Hi All Using GE RX3 I would like to create a function block that recive UDT (uder defined data type) manipulate it and return it after...
Replies
1
Views
2,539
Hi all: I'm not familiar with Ge-Fanuc PLC.But the new machine which I maintain these day uses Ge-Fanuc CNC system.So who has the Programming...
Replies
13
Views
13,716
Got an old machine with a IC610CPU104 CPU. A bit of research told me this is the same as DL305 so DirectSoft from AutomationDirect should work...
Replies
15
Views
1,921
Back
Top Bottom