Jump to content



Photo
- - - - -

Program Using the PLC Real-Time Clock

  • Please log in to reply
2 replies to this topic

#1 MikeSparks

MikeSparks

    Newbie

  • MrPLC Member
  • PipPip
  • 5 posts
  • Location:Ohio
  • Country:United States
    United States

Posted 29 August 2008 - 01:03 PM

Hello All -
First time posting here, please allow some leniency if I'm not posting correctly...

It's been many years since I've programmed so I'm a bit rusty.

I have a SLC500 and use RSLogix500 to program the ladder logic.
I have a FactoryTalk View ME application were I'm using the ActiveX MEDataStorePlus control to capture process data from my SLC500. My goal is to send process data from the SLC500 to a .csv file at certain times (before the end of a shift), using FactoryTalk. The problem is the MEDataStorePlus control uses a trigger to activate the data collection. What I believe I need to do is write some code in the ladder logic to look at the real-time clock in the PLC. Once the PLC real-time clock equals 6:45 am, 2:45 pm and 10:45 pm respectively, I will set a bit in the PLC that is picked up through my FactoryTalk View ME application and thus sets the trigger for the MEDataStorePlus, collecting my process data.
Quite frankly I'm a bit rusty at programming and the scenario I explained is a bit over my head.

Does anyone have any suggestions to get me going or perhaps were I could view sample code using the SLC500 real-time clock in a ladder program? It appears the system or status bits I would be looking at our S40 (HH) and S41 (MM).

Best Regards,

Mike

#2 TConnolly

TConnolly

    Guru

  • MrPLC Member
  • PipPipPipPipPip
  • 939 posts
  • Gender:Male
  • Location:Salt Lake City
  • Country:United States
    United States

Posted 29 August 2008 - 08:08 PM

Hello All -
First time posting here, please allow some leniency if I'm not posting correctly...

It's been many years since I've programmed so I'm a bit rusty.

I have a SLC500 and use RSLogix500 to program the ladder logic.
I have a FactoryTalk View ME application were I'm using the ActiveX MEDataStorePlus control to capture process data from my SLC500. My goal is to send process data from the SLC500 to a .csv file at certain times (before the end of a shift), using FactoryTalk. The problem is the MEDataStorePlus control uses a trigger to activate the data collection. What I believe I need to do is write some code in the ladder logic to look at the real-time clock in the PLC. Once the PLC real-time clock equals 6:45 am, 2:45 pm and 10:45 pm respectively, I will set a bit in the PLC that is picked up through my FactoryTalk View ME application and thus sets the trigger for the MEDataStorePlus, collecting my process data.
Quite frankly I'm a bit rusty at programming and the scenario I explained is a bit over my head.

Does anyone have any suggestions to get me going or perhaps were I could view sample code using the SLC500 real-time clock in a ladder program? It appears the system or status bits I would be looking at our S40 (HH) and S41 (MM).

Best Regards,

Mike


Greetings Mike, and welcome to the forum.

Paste the following into an empty rung in an empty program. Insert a new rung, double click the rung number to the lef of the rung, and paste this text into the mnemonic field that opens.

EQU S:40 6 EQU S:41 45 OSR B3:0/0 OTE B3:0/1

This rung shows how to set a trigger at 6:45 am. In this example the trigger will last for just one scan because of the one-shot. Hopefully its enough to get you started.


#3 MikeSparks

MikeSparks

    Newbie

  • MrPLC Member
  • PipPip
  • 5 posts
  • Location:Ohio
  • Country:United States
    United States

Posted 01 September 2008 - 12:35 PM

Hello All -
First time posting here, please allow some leniency if I'm not posting correctly...

It's been many years since I've programmed so I'm a bit rusty.

I have a SLC500 and use RSLogix500 to program the ladder logic.
I have a FactoryTalk View ME application were I'm using the ActiveX MEDataStorePlus control to capture process data from my SLC500. My goal is to send process data from the SLC500 to a .csv file at certain times (before the end of a shift), using FactoryTalk. The problem is the MEDataStorePlus control uses a trigger to activate the data collection. What I believe I need to do is write some code in the ladder logic to look at the real-time clock in the PLC. Once the PLC real-time clock equals 6:45 am, 2:45 pm and 10:45 pm respectively, I will set a bit in the PLC that is picked up through my FactoryTalk View ME application and thus sets the trigger for the MEDataStorePlus, collecting my process data.
Quite frankly I'm a bit rusty at programming and the scenario I explained is a bit over my head.

Does anyone have any suggestions to get me going or perhaps were I could view sample code using the SLC500 real-time clock in a ladder program? It appears the system or status bits I would be looking at our S40 (HH) and S41 (MM).

Best Regards,

Mike


Greetings Mike, and welcome to the forum.

Paste the following into an empty rung in an empty program. Insert a new rung, double click the rung number to the lef of the rung, and paste this text into the mnemonic field that opens.

EQU S:40 6 EQU S:41 45 OSR B3:0/0 OTE B3:0/1

This rung shows how to set a trigger at 6:45 am. In this example the trigger will last for just one scan because of the one-shot. Hopefully its enough to get you started.



Yes, that will get me started.
Thanks for your help Alaric.

Have a good one,
Mike




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users