Overview

Skill Level: Intermediate

Basic skills in Maximo with a bit of understanding about Automation Scripting

Maximo has a feature to schedule PM work order generation based on time-based frequencies, but the minimum period supported by Maximo is 1 day. This recipe will help you enable hourly or even minute wise PM scheduling for work order generation.

Ingredients

  • Maximo EAM (version 7.6 or higher)

The version that has been used for this recipe is Maximo v7.6.1

Step-by-step

  1. Create a dummy Meter in Maximo

    We begin by creating a continuous meter in Maximo.

    • Navigate to the Meters application
    • Create a new record
    • Choose any name for the meter. In this case, we have named it as CLOCKMETER
    • Set the meter type as CONTINUOUS
    • Set the reading type as DELTA
    • Save the record

     

    create_meter

  2. Associate meter with desired assets and locations

    Now we will associate the created meter with an asset. Please note the same meter can be associated with multiple assets and locations.

    • Navigate to the Assets application
    • Choose an asset for which we will generate hourly PM work orders.
    • In the Meters tab within the asset record, add a new meter.
    • Select CLOCKMETER as the meter
    • Set the Average Calculation Method to ALL
    • Save the record

     

    associate_meter

  3. Create an Automation Script

    In this step, we will create a script to insert readings into the meter. Basically our objective is to increment the meter reading by 1 every hour.

    • Navigate to the Automation Script application
    • Create a new script (without launchpoint)

     

    In the following code, we are fetching an mboset of ASSETMETER and filtering it only for meters as CLOCKMETER. Then we’re looping through the entire mboset and incrementing the reading by 1.

     from psdi.mbo import MboRemote, MboSetRemote
    from psdi.server import MXServer

    maximo = MXServer.getMXServer()
    sysdate = maximo.getDate()

    assetMeterSet = maximo.getMboSet("ASSETMETER", runAsUserInfo)
    assetMeterSet.setWhere("METERNAME = 'CLOCKMETER'")

    assetMeterMbo = assetMeterSet.moveFirst()
    while assetMeterMbo:
    assetMeterMbo.setValue("ISDELTA", 1)
    assetMeterMbo.setValue("NEWREADING", "1")
    assetMeterMbo.setValue("NEWREADINGDATE", sysdate)
    assetMeterMbo.setValue("INSPECTOR", "MAXADMIN")
    assetMeterMbo = assetMeterSet.moveNext()

    assetMeterSet.save()
    assetMeterSet.clear()
    assetMeterSet.close()

    Please note, in case you’ve your dummy meter associated with locations as well, then perform the same activity on the LOCATIONMETER object.

    Once your script is ready, save the record.

     

    automation_script

  4. Schedule a Cron Task to run the script

    Once we have our script ready, we will create a cron task to schedule this script.

    • Navigate to the Cron Task application
    • Create a new cron task
    • Choose any name for your cron task. In this case, we have chosen ScriptCrontask
    • Set the Class as com.ibm.tivoli.maximo.script.ScriptCrontask
    • Set the Access Level as FULL
    • Create a new instance
    • Choose any name for the instance
    • Set the schedule to run every hour
    • Ensure the ACTIVE checkbox is checked
    • Set the SCRIPTNAME parameter as your script name. In this case, it is HOURLYCLOCK
    • Save the record
    • Reload the cron instance

     

    script_cron

     

    Verify that your cron is running as per the desired frequency.

    Please note, in case you need to schedule PM work orders at a minute level, you can set the cron frequency to 1 minute. The same logic applies if you want it every second, but I don’t think you’ll ever need to generate work orders scheduled at the second level.

    However, for this recipe we will stick to the hourly scheduling of PM work orders.

  5. Create a Preventive Maintenance (PM) record

    Now we will create the PM record and do the scheduling task.

    • Navigate to the Preventive Maintenance application
    • Create a new record
    • Select the asset/location that you’ve associated the meter with
    • In the Frequency tab, add a new row in the Meter Based Frequency sub-tab
    • Set the meter as CLOCKMETER
    • Set the desired frequency. In this case, we have chosen the frequency as 2 units (or hours in this case)
    • Inside the same tab, find the Work Order Generation Information section right above the sub-tabs
    • Ensure the following checkboxes are checked –
      • Generate Work Order Based on Meter Readings (Do Not Estimate)
      • Generate Work Order When Meter Frequency is Reached
    • Save the record
    • Change the PM status to ACTIVE

     

    define_pm

  6. Change the frequency of the PMWOGEN Cron Task

    There is a cron task called PMWoGenCronTask, that comes out of box with Maximo. This cron ensures that the work orders are generated based on the configured time-based or meter-based frequencies. The cron schedule is set to run once a day by default. In this case, we will change it to run once every hour, so that the cron can detect the change in our dummy meter reading, and generate work orders as per the selected frequency in the PM. After the changes are made, save the record and reload the cron instance.

    In case of minute wise PM scheduling, ensure that this cron schedule is also set accordingly. But, it is recommended to check how frequently we can run this cron without affecting its performance.

     

    pm_cron

  7. Check generated Work Orders

    That’s all. Now all we have to do is wait and watch for the work orders to be generated as per the desired frequency. As explained above, in this case we are expecting work orders to be generated every 2 hours.

    In order to verify,

    • Navigate to the Work Order Tracking application
    • Set the application where clause for easier search. In this case, we are using PMNUM=’1222′

     

    where_clause

    • The generated work orders should be showing up as follows –

    gen_wo

    • Notice that the work orders were generated every 2 hours
  8. Summary

    In this tutorial, you learnt how to schedule hourly PM work orders with the help of a very simple custom script. Although we are defining a time-based frequency, we are using the meter-based PM functionality in Maximo to achieve this.

    Hope you’ve enjoyed this. Leave a comment if you’ve any questions, or any suggestions.

    Thank you.

Join The Discussion