You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
Thread Tools Display Modes
Unread October 3rd, 2012, 01:04 PM   #1
bopol
Member
Philippines

bopol is offline
 
bopol's Avatar
 
Join Date: Feb 2008
Location: Singapore
Posts: 41
Omron Last Print Duration

Hi guys,

Just want to know if there is an easier way to do the below function using Omron CX Programmer (Cj2-CPU13).

Function:
1. Press Print
2. Date and time "saved" to currDate memory (retained)
3. CPU serial port sends text string to text printer thru txd_cpu command. Included in the printed text is the Current Date and Time and the Last Print Date and time (inititally, current date and last print date is the same)
4. After Printing is finished, currDate is "moved" to memDate
5. Press Print Again, the currDate memory is updated.
6. Printer Prints the Current Date and Time and the Last Print Date stored in memDate.
7. After Printing, the memDate is updated.

*Current Date/Time and Last Print Date/Time is input as string in a FB before printing

***This Part is Done***

Additional Requirement:

1. Add the "Duration" from the last print date to the current date in the printed text.

Ex:
Current Date: 4-10-2012 12:30:30
Last Print Date: 3-10-2012 14:20:30
Duration: 0Y 0M 0D 22h 10m 0s

How I am planning to fulfill the addt'l req:

1. extract the following strings: Day, Month, Year, Hour, Minutes, Seconds (both current and memory values)using the MID$ function then convert as integer.
2. Get the duration by using the attached FB "Duration FB". (I haven't actually written this in CX programmer yet, will be able to do it later at the office).
3. Convert the results back to string then include in the printed text.



If any of you guys have done something similar or know of a function that could do what is required, please point me in the right direction.

P.S. this is only my second time using Omron so i am not very familiar with the functions yet.



TIA and regards,

Paul S.
Attached Files
File Type: txt Duration FB.txt (1.2 KB, 3 views)
  Reply With Quote
Unread October 3rd, 2012, 09:57 PM   #2
bopol
Member
Philippines

bopol is offline
 
bopol's Avatar
 
Join Date: Feb 2008
Location: Singapore
Posts: 41
now i see there is a function called CSUB for my requirement.. thanks for viewing! ;P
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
PVPlus 700 Display Print Error Viks LIVE PLC Questions And Answers 6 December 19th, 2011 08:31 AM
Omron Communications Cable SouthPahw LIVE PLC Questions And Answers 8 June 14th, 2011 07:54 PM
Troubleshooting basic code johnfarrugi LIVE PLC Questions And Answers 10 January 27th, 2009 07:41 PM
Omron, SCADA and OPC BobB LIVE PLC Questions And Answers 14 March 22nd, 2006 01:34 AM
Wanted technical support for Omron PLC (Sysmac: C 60 K) kailashmariappan LIVE PLC Questions And Answers 0 December 1st, 2004 12:37 PM


All times are GMT -5. The time now is 11:14 PM.


.